Closed Bug 1029343 Opened 10 years ago Closed 10 years ago

Enable pages to override context menu

Categories

(Firefox OS Graveyard :: Gaia::System::Browser Chrome, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: sicking, Assigned: daleharvey)

References

Details

(Whiteboard: [systemsfe])

It would be good to enable pages to replace the builtin context menu rather than just add to it. I could have sworn that we had that ability in desktop firefox, but now I can't find it.

I know I argued for that to be added to the spec, but there was little interest back then. But given that apps can completely disable context menus (by calling preventDefault() on the contextmenu event), it's better that apps use <menu> to replace the context menu rather than build their own menu in using <div>s and CSS.

So I propose that we add a "nodefault", or something similar, attribute to <menu> which makes the menu override, rather than add to, the system context menu.

Likely the way to implement this is to make the mozbrowsercontextmenu event include a flag indicating if "nodefault" was set on the <menu> or not.
Btw, I don't think we should do this only for apps. Given that all pages can disable context menus using the contextmenu event, I don't see a reason to allow it for all webpages.
OS: Mac OS X → Gonk (Firefox OS)
Hardware: x86 → ARM
Assignee: nobody → dale
Depends on: 1031475
Whiteboard: [systemsfe]
Closed as with https://bugzilla.mozilla.org/show_bug.cgi?id=1031475
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.