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

Shift+right click opens context menu in Firefox #161

Open
1j01 opened this issue Jan 6, 2020 · 4 comments
Open

Shift+right click opens context menu in Firefox #161

1j01 opened this issue Jan 6, 2020 · 4 comments
Labels

Comments

@1j01
Copy link
Owner

1j01 commented Jan 6, 2020

Right mouse button is used to access the secondary (background) color, and shift is used to make equal width/height shapes.
Shift+right click is clearly an escape hatch for users of Firefox, to access the context menu on sites that block it willy-nilly. I'd like to preserve this ability where it doesn't conflict.

Plan: listen for and prevent contextmenu globally while canvas-related gesture is active.
May need a timeout after pointerup if contextmenu comes after pointerup.

This should also fix dragging with right click over a window like About Paint showing a context menu. I'm not sure about the Help window, which uses an iframe to display the content.

This should also let me un-revert setPointerCapture for 98.js.org integration.

@1j01 1j01 added the bug label Jan 6, 2020
1j01 added a commit to 1j01/98 that referenced this issue Apr 1, 2020
To https://github.com/1j01/jspaint/tree/8a0f27172d29802fb97fd9e031c872166d8a89cc

jspaint now uses os-gui, so the theme is applied from the desktop into jspaint!

Note: setPointerCapture for iframe integration has been reverted in 1j01/jspaint@ecb7459
See issue: 1j01/jspaint#161
@AlexHRodrii
Copy link

Since some firefox updates is impossible to absolutely disable the context menu because if you disable it firefox core automatically sets the context menu shortcut to Shift + Right Click, the user itself can disable it in the firefox settings going to:

Tools > Options > Content > Advanced and the activate 'Enable Javascript' and 'Disable or replace context menus' settings.

Due to this I think this shouldn't be catalogued as 'bug'.

@1j01
Copy link
Owner Author

1j01 commented Feb 6, 2023

@AlexHRodrii How do I get to "Tools > Options > Content > Advanced"? What version of Firefox does this apply to?

@AlexHRodrii
Copy link

Since the latests firefox updates you need to do aditional steps. Here it's a guide about how to disable the context menus.
image

  1. First, open a new tab and write in the navigation bar 'about:config' (accept to enter if a warning pop up is shown)
  2. Then, search for 'dom.event.contextmenu.enabled'
  3. If you want to disable it, set this setting to false
  4. Restart firefox

@1j01
Copy link
Owner Author

1j01 commented Feb 13, 2023

Disabling dom.event.contextmenu.enabled appears to disable the contextmenu event entirely, making webpages unable to prevent the context menu in any case, so this wouldn't help anyone looking for a workaround.

I poked around and found some discussion of this on the Firefox bug tracker: 1, 2, 3. There doesn't seem to be many people pointing out use cases, so I might join the discussion. I'm writing my notes here in case I come back to this later:

Two use cases I see, aside from user interfaces that directly use Shift+right click as a gesture, are:

  1. JS Paint, where to draw a circle or square (rather than an ellipse or rectangle) you can hold Shift, and to draw using the secondary ("background") color you can use the right mouse button. There's a work-around, but it's very awkward to have to press RMB, press Shift, drag, release RMB, and then release shift, in that exact order.
  2. A first-person shooter game where you can hold Shift to sprint, and right click for a secondary attack such as melee. A context menu popping up would get you killed for sure. (Maybe the pointer lock API gets around this, I don't know.)

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

No branches or pull requests

2 participants