Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser: Add option to force showing browser-native context menu? #1585

Open
sratz opened this issue Nov 10, 2024 · 4 comments
Open

Browser: Add option to force showing browser-native context menu? #1585

sratz opened this issue Nov 10, 2024 · 4 comments

Comments

@sratz
Copy link
Member

sratz commented Nov 10, 2024

When setting a custom menu to a Browser the browser-native context menu is suppressed.

The native menu, however, is typically the entry point to browser troubleshooting and debug tools. Accessing them is cumbersome and requires code changes to temporarily remove the menu customization.

For troubleshooting / development use-cases it would be nice to have Browser ignore suppressed context menus and always show the native context menu.

I am thinking about having a VM parameter such as org.eclipse.swt.browser.ignoreSuppressedContextMenu=true or similar to force-enable the native context menu.

This menu might then show in addition to the custom menu.

@HeikoKlare wdyt?

@laeubi
Copy link
Contributor

laeubi commented Nov 10, 2024

I am thinking about having a VM parameter such as org.eclipse.swt.browser.ignoreSuppressedContextMenu=true or similar to force-enable the native context menu.

Should it from SWT perspective not being some kind of SWT.SHOW_NATIVE_MENU? Of course users can pass this flag then based on a system property of their choice.

@sratz
Copy link
Member Author

sratz commented Nov 11, 2024

I am thinking about having a VM parameter such as org.eclipse.swt.browser.ignoreSuppressedContextMenu=true or similar to force-enable the native context menu.

Should it from SWT perspective not being some kind of SWT.SHOW_NATIVE_MENU? Of course users can pass this flag then based on a system property of their choice.

We already can do that with the current API:

if (vm parameter not set) {
  browser.setMenu(...);
}

but it requires each consumer to handle this.

I am looking for a more central I want to debug Browser / javascript, please let me access the context menu / dev tools switch.

@HeikoKlare
Copy link
Contributor

The proposal sounds reasonable to me. When I ran into the situation that I wanted to have the native context menu when a custom one was implemented, I also manually changed the according code temporarily. So I definitely see a use case for this.

@N1k145
Copy link

N1k145 commented Nov 13, 2024

With 2024-06 it was possible to press F12 to open the Edge Debug Menu, with 2024-09 this is no longer working.
This could also be an Entrypoint for debugging with the/a corresponding Flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants