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

Inconsistency: Permissions "menus" #188

Closed
stefanvd opened this issue Mar 18, 2022 · 8 comments
Closed

Inconsistency: Permissions "menus" #188

stefanvd opened this issue Mar 18, 2022 · 8 comments
Labels
implemented: firefox Implemented in Firefox implemented: safari Implemented in Safari inconsistency Inconsistent behavior across browsers opposed: chrome Opposed by Chrome

Comments

@stefanvd
Copy link

stefanvd commented Mar 18, 2022

Currently, menus is supported in some browsers. And that only in the Firefox and Safari web browser (but not in iOS).
It lacks support in the following web browsers Google Chrome, Opera, Microsoft Edge.

browser.menus.create({
  id: "open-me",
  title: browser.i18n.getMessage("menuItemOpenPanel"),
  contexts: ["all"]
}, onCreated);

Resources:

@stefanvd stefanvd changed the title Inconsistency: Permissions <code>menus</code> Inconsistency: Permissions "menus" Mar 18, 2022
@carlosjeurissen
Copy link
Contributor

carlosjeurissen commented Mar 31, 2022

Naming
There seem to be two names for this API. menus and contextMenus. menus makes it multi-purpose so my proposal is to use menus going forward in Google Chrome as well.

OS-menu bar
The lack of context tools_menu. Which allows menu items to be added to the mac menu bar. Which can be considered adding to other browsers as well. This seems only supported in Firefox at the moment.

@Rob--W
Copy link
Member

Rob--W commented Apr 17, 2022

The two names are menus and contextMenus. There is no menu.

FYI on Firefox issue tracker there is also a mention of the two namespaces and potentially deprecating one: https://bugzilla.mozilla.org/show_bug.cgi?id=1718323

@Rob--W
Copy link
Member

Rob--W commented Apr 28, 2022

During today's meeting we talked about considering replacing contextMenus with "menus", and at the same time making a breaking change to the API to fix an API defect: let menus.create return a Promise instead of a string/integer.

The Firefox issue for that is at https://bugzilla.mozilla.org/show_bug.cgi?id=1527979.
I recall having chatted with Chromium engineers in person about this issue, but I cannot find a crbug right now.

@dotproto Can you comment here when you've heard back from your team about the interest in (1) replacing contextMenus with menus and (2) changing the API signature of menus.create / contextMenus.create?

@carlosjeurissen carlosjeurissen added the inconsistency Inconsistent behavior across browsers label May 31, 2022
@carlosjeurissen carlosjeurissen added the follow-up: chrome Needs a response from a Chrome representative label Jun 9, 2022
@carlosjeurissen carlosjeurissen added the agenda Discuss in future meetings label Oct 17, 2022
@xeenon xeenon added the implemented: safari Implemented in Safari label Nov 10, 2022
@xeenon
Copy link
Collaborator

xeenon commented Nov 10, 2022

Safari already implements menus as an alias.

@Rob--W
Copy link
Member

Rob--W commented Nov 10, 2022

@xeenon To clarify, is this the behavior in Safari?

  • menus permission = menus API only
  • contextMenus permission = contextMenus API only

Firefox has the above behavior. The menus namespace also has more functionality than the contextMenus one, such as menus.getTargetElement, also available in content scripts: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus/getTargetElement

I am asking because a potential interpretation of your comment is that requesting menus or contextMenus unlocks both namespaces.

@xeenon
Copy link
Collaborator

xeenon commented Nov 15, 2022

Yes, that is the behavior in Safari. We don't support the additional Firefox APIs.

@dotproto
Copy link
Member

Chrome's current position is that the "menus" and "contextMenus" APIs and associated permissions provide two different sets of capabilities. Chrome does not currently support the concept of custom menus and does not intend to. We are concerned that merging these namespaces/permissions will lead to confusion regarding the intended scope of what Chrome supports.

@dotproto dotproto added opposed: chrome Opposed by Chrome and removed follow-up: chrome Needs a response from a Chrome representative labels Nov 15, 2022
@dotproto dotproto removed the agenda Discuss in future meetings label Mar 16, 2023
@Rob--W Rob--W added the implemented: firefox Implemented in Firefox label May 8, 2023
@Rob--W
Copy link
Member

Rob--W commented May 8, 2023

Closing this ticket since it is unlikely for there to be any more discussion on this topic. The positions are clear:

  • Firefox has implemented the menus API as a superset of the contextMenus API.
  • Safari has implemented the menus API as an alias of the contextMenus API.
  • Chrome is opposed to supporting the menus API/permission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implemented: firefox Implemented in Firefox implemented: safari Implemented in Safari inconsistency Inconsistent behavior across browsers opposed: chrome Opposed by Chrome
Projects
None yet
Development

No branches or pull requests

5 participants