-
Notifications
You must be signed in to change notification settings - Fork 56
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
Proposal: Add support for setting the main context menu icon #592
Comments
Safari supports menu item icons, as of Safari Technology Preview 192 with the same API as Firefox. |
But Firefox doesn't implement setting the main icon i.e. for the top folder of the extension menu. |
Oh! I misunderstood this issue then. Safari does allow setting icons for menu items, but the top-level auto generated menu item does not have an icon in Safari, unlike Firefox. (In general we don't use icons in context menus on Apple platforms, so we likely won't add an icon for this generated menu item.) |
Using the extension icon for the top level item in context menus was a purposeful design decision on our part, because the title is also controllable by the extension, and without the icon, there would be no clues for the user to know where the menu item is coming from, opening potential for abuse. This is different from the browser action icon, which mostly stays in the same place, and has other clues like tooltips and context menus, so is much easier for user to discern the originating extension. |
To combat abuse, for the top level menu item we can use the following behaviour: If the
If the
This allows us to combat abuse while also not requiring any new API methods to be introduced for the feature request in this issue. @Juraj-Masiar would this cover your use case? In general it seems like an oversight title will simply be kept empty if not provided. This case would not be present in Chrome as |
@carlosjeurissen sadly no, that workaround would not cover the use cases I'm going for. I agree with @zombie , that's some nice attack vector, since extension menus indeed changes a lot depending also on what user have clicked. |
@Juraj-Masiar Alternatively you can simply just change the 16px and 32px icons in the main |
We had a discussion on the Chrome team about this. We are opposed to supporting this for top-level menu items, given the abuse risk. We are open to supporting this for sub-level menu items although it isn't something we are likely to prioritize. |
Similarly as you can change the main toolbar icon using action.setIcon, you should be able to change your main context menu icon.
The contextMenu.create already supports "icons" parameter, but only in Firefox and only for sub-menus.
Motivation
I was implementing icon change in my extension and while I was able to change the icon in the app UI, favicon and toolbar, there is still this one place that shows the default icon, which makes it look confusing and inconsistent:
See also:
Proposal: API for setting sidebar title and icon
The text was updated successfully, but these errors were encountered: