Closed Bug 1759303 Opened 2 years ago Closed 1 year ago

Allow disabling Shift+right click

Categories

(Core :: DOM: Events, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
relnote-firefox --- 117+
firefox117 --- fixed

People

(Reporter: 123lichessaccount, Assigned: gregp)

References

Details

Attachments

(1 file)

Steps to reproduce:

Go to a website that uses shift+right click for some functionality and doesn't allow to overwrite this. Try to use the default website's functionality by holding shift and right clicking.

Actual results:

Firefox shows the context menu. Not possible to use the website's functionality.

Expected results:

There should be an option to disable this in the about:config. This would allow to use websites that implement Shift+right click for something and don't allow to overwrite it.

Setting this as a NEW enhancement so the engineering team could have a look and decide if they take it into consideration or not. Also, moving this to Core:: XUL - if this is not the right component please move it to a more appropriate one.
Thanks!

Status: UNCONFIRMED → NEW
Ever confirmed: true

Forgot to set the component, setting it now.

Component: Untriaged → XUL
Product: Firefox → Core
Component: XUL → Menus
Product: Core → Firefox

Actually this bug is really important to fix, I had to ditch Firefox to play an RTS game that cannot function properly on Firefox because of this.
There is the affected game website: https://littlewargame.com/

A config option in about:config would have allowed me to continue using Firefox for this, but it seems there is nothing of that sort.

I really want to switch back to Firefox to play this game, but I just currently cannot do that without ruining my gaming experience.
I'm ready to pay directly with real money to get this issue fixed.

Assignee: nobody → gp3033
Status: NEW → ASSIGNED
Component: Menus → DOM: Events
Product: Firefox → Core
Version: Firefox 98 → unspecified
Pushed by gp3033@protonmail.com:
https://hg.mozilla.org/integration/autoland/rev/2ac0f0381525
Allow disabling Shift+Right Click force-opening the context menu r=emilio
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch

This might be worth calling out in the Fx117 relnotes. Feel free to nominate by setting the relnote-firefox flag to ? if you agree.

Flags: needinfo?(gp3033)

Release Note Request (optional, but appreciated)
[Why is this notable]: New pref which improves compatibility with websites that use shift+right click
[Affects Firefox for Android]: Maybe? I haven't tested it.
[Suggested wording]: Some web pages disable the context menu, which can limit the options available to users. Firefox enables users to bypass this restriction by pressing shift and right-clicking to force the context menu to show. However, this may interfere with some web pages that have legitimate purposes for blocking the context menu on shift+right click. To address this issue, we have added a new preference: dom.event.contextmenu.shift_suppresses_event. Users can toggle this preference to respect the web page’s choice of blocking the context menu on shift+right click, if they prefer.
[Links (documentation, blog post, etc)]:

relnote-firefox: --- → ?
Flags: needinfo?(gp3033)

Added to the Fx117 relnotes, thanks.

See Also: → 1836842
Duplicate of this bug: 1836842

I am curious, why was this issue solved by adding a new about:config pref, and not by allowing the web page to use either event.stopPropagation() or event.preventDefault() on contextmenu/mouse events?

In Chrome it seems to work that way, and playing littlewargame on Chrome works as expected, while on Firefox requires the end user to activate an about:config to get the proper expected site UX. That feels incorrect?

QA Whiteboard: [qa-117b-p2]

(In reply to Jukka Jylänki from comment #11)

I am curious, why was this issue solved by adding a new about:config pref, and not by allowing the web page to use either event.stopPropagation() or event.preventDefault() on contextmenu/mouse events?

Some websites blocks context menu without good reasons. E.g., only for preventing "copy" of selected text, websites may block context menu even though context menu may have more important features for users.

In Chrome it seems to work that way, and playing littlewargame on Chrome works as expected, while on Firefox requires the end user to activate an about:config to get the proper expected site UX. That feels incorrect?

That's a dilemmna between reasonable use cases vs. illegal use cases. If we could find a good way to detect the reasonable cases, we could prevent to block the intention of the website.

Some websites blocks context menu without good reasons. E.g., only for preventing "copy" of selected text

Don't websites already routinely prevent copying selected text? It is odd to draw the line only at shift-right click for preventing copy, when it is already a perfectly valid use case to make text non-selectable to begin with? ( https://stackoverflow.com/questions/2310734/how-to-make-html-text-unselectable )

If we could find a good way to detect the reasonable cases, we could prevent to block the intention of the website.

Could this be started by allowing preventing default action on shift-right click when mouse is on top of a canvas element? That would cover all web games cases.

(In reply to Jukka Jylänki from comment #13)

Some websites blocks context menu without good reasons. E.g., only for preventing "copy" of selected text

Don't websites already routinely prevent copying selected text? It is odd to draw the line only at shift-right click for preventing copy, when it is already a perfectly valid use case to make text non-selectable to begin with? ( https://stackoverflow.com/questions/2310734/how-to-make-html-text-unselectable )

No, it's not the point. The problem is, only for preventing some feature in context menu, disabling context menu is overkill.

If we could find a good way to detect the reasonable cases, we could prevent to block the intention of the website.

Could this be started by allowing preventing default action on shift-right click when mouse is on top of a canvas element? That would cover all web games cases.

May be, may be not. Somebody needs to work on it, implementing it only in the nightly channel first, then, collect feedback, finally, ship it if it works well.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: