Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Webview Context Menu

Post Reply
jc4golf
Posts: 32
Joined: Wed Jun 23, 2021 12:33 am

Webview Context Menu

Post by jc4golf »

I have a project which uses a Windowless Browser. When I right click on a web page the context menu appears, but it is grayed out and is not functional. I tried the same thing in the Windowless Browser demo and the same thing happens.
User avatar
salvadordf
Posts: 4563
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Webview Context Menu

Post by salvadordf »

The embedded browser decides what context menu items are enabled or disabled.

The WindowlessBrowser demo shows the context menu correctly when it loads the default web page.
jc4golf
Posts: 32
Joined: Wed Jun 23, 2021 12:33 am

Re: Webview Context Menu

Post by jc4golf »

But why are all menu items grayed? This happens in the WindowlessBrowser demo as well.

There must be some setting in my system somewhere that is causing this, but I can't find anything when I Google the issue.
User avatar
salvadordf
Posts: 4563
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Webview Context Menu

Post by salvadordf »

As you can see in the snapshot, I can't reproduce this issue with the demo unless you provide more details.
Image

The WindowlessBrowser demo uses the TWVBrowser.OnContextMenuRequested event to add a custom context menu item called 'Execute custom JavaScript...'
It doesn't disable any other menu entry and I still can see the correct context menu after navigating to other websites.

Check that the web page that you're testing doesn't disable the context menu using JavaScrtipt.
jc4golf
Posts: 32
Joined: Wed Jun 23, 2021 12:33 am

Re: Webview Context Menu

Post by jc4golf »

I don't know what it is in my system that causes this behavior in the Windowless Browsers, but I tried the MiniBrowser demo, and the context menu works correctly. So now I'm in the process of changing my project to not use a Windowless Browser, and it's working so far.
Post Reply