Closed Bug 1523230 Opened 6 years ago Closed 6 years ago

menus.create() for Extensions' own moz-extension pages

Categories

(WebExtensions :: Frontend, enhancement)

66 Branch
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: erosman, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0

Steps to reproduce:

It is useful to be able to add context-menu to extension's own privileged pages such as browserAction pop-up, PageAction pop-up, options page etc

At the moment, the only options are a catch-all menus.ContextType which affects all pages (including other extensions' pop-ups), or using the 'contextmenu' Web API.

Above can be achieved via 3 methods:

1- ContextType: a context that only applies to extension's own privileged pages
2- documentUrlPatterns: to match moz-extension://{extension-id}
3- targetUrlPatterns: Expand the matchable attributes (href/src) to include other possibilities

I'm assigning a component to get a start on this, if considered wrong, please feel free to change it to a more appropriate one.

Severity: normal → enhancement
Component: Untriaged → Frontend
Product: Firefox → WebExtensions

Firefox 64 added several enhancements to the menus API that allows you to restrict menus to specific views (viewTypes). viewTypes / documentUrlPatterns should be sufficient to meet your needs.

For the announcement, see https://blog.mozilla.org/addons/2018/11/08/extensions-in-firefox-64/#cm

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.