er.contextMenus.create() with contexts:["image"] allows menu creation for chrome urls
Categories
(WebExtensions :: Untriaged, defect)
Tracking
(firefox87 affected, firefox88 affected, firefox89 affected, firefox90 affected)
People
(Reporter: mozilla, Unassigned)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0
Steps to reproduce:
Create extension that adds a menu to the context menu, with contexts of "image", that opens context items in new tab
Right click on chrome url image (for example, the firefox logo on "about:debugging#/runtime/this-firefox")
Click on your extension's menu
Actual results:
Extension tried to open Chrome url with error:
"Uncaught (in promise) Error: Illegal URL: chrome://devtools/skin/images/aboutdebugging-firefox-release.svg"
Expected results:
If the context item under the cursor is not openable, in an extension, due to security gates, then the menu should not be shown.
Comment 1•5 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•5 years ago
|
||
Hello,
I reproduced the issue using the attached extension on the latest Nightly (90.0a1/20210421212740), Beta (89.0b2/20210420191345), Release (88.0/20210415204500) and Release 87.0 (87.0/20210318103112) under Windows 10 x64 and Ubuntu 16.04 LTS.
The mentioned error is logged in the extension console when clicking each of the context menu options provided by the add-on. For further details, please see the attached screenshot.
Comment 3•5 years ago
|
||
Comment 4•5 years ago
|
||
This is working as intended.
If you care about the URL being loadable, pass the targetUrlPatterns: ["*://*/*"], option to the browser.contextMenus.create API call.
The menu item appears everywhere by default, to support extensions that don't care about the URL being loadable (e.g. extensions that want to offer a "Copy image URL" functionality, for example).
Description
•