Closed
Bug 1289527
Opened 8 years ago
Closed 8 years ago
Don't expose the PageAction namespace when the page_action manifest property is missing.
Categories
(WebExtensions :: Untriaged, defect, P3)
Tracking
(firefox51 fixed)
RESOLVED
FIXED
mozilla51
Tracking | Status | |
---|---|---|
firefox51 | --- | fixed |
People
(Reporter: mattw, Assigned: kmag)
Details
(Whiteboard: triaged)
Attachments
(2 files)
Steps to reproduce:
Load the attached extension and navigate to a new tab.
Actual results:
The PageAction does not show up.
Expected results:
The PageAction should show up.
Comment 1•8 years ago
|
||
(In reply to Matthew Wein [:mattw] from comment #0)
> Created attachment 8774818 [details]
> bookmark_it_-1.0.xpi
When the attached xpi is loaded, there is an error in the Browser Console that complains about the "pageAction" property in the manifest.json (which should be "page_action", https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/page_action)
Changing the property to "page_action" seems to be enought to make the attached xpi to work as expected.
Assignee | ||
Comment 2•8 years ago
|
||
Yeah, we really need to not expose the API when there's no page_action manifest property. I've been meaning to fix that.
Reporter | ||
Comment 3•8 years ago
|
||
Thanks Luca! I'm glad it was an issue with the manifest file and not with the API itself.
Summary: PageAction.for(...) is undefined when calling PageAction.show → Don't expose the PageAction namespace when the page_action manifest property is missing.
Reporter | ||
Comment 4•8 years ago
|
||
I think we can do better than hiding the namespace, although we should do this first.
Ideally, whenever browser.pageAction is used without page_action existing in the manifest, we should add a console warning with something like "Did you forget to include 'page_action' in the manifest?" with a link to the documentation.
Assignee | ||
Comment 5•8 years ago
|
||
I think that hiding the API is the right solution. That's what we do for other APIs that the extension doesn't have access to.
Comment 6•8 years ago
|
||
is chrome incompatibility we should fix - but not major blocker
Priority: -- → P3
Whiteboard: investigate → triaged
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → kmaglione+bmo
Assignee | ||
Comment 7•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/69852/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/69852/
Attachment #8778607 -
Flags: review?(aswan)
Comment 8•8 years ago
|
||
mozreview-review |
Comment on attachment 8778607 [details]
Bug 1289527: Hide browserAction and pageAction namespaces when relevant manifest entries are missing.
https://reviewboard.mozilla.org/r/69852/#review67392
::: toolkit/components/extensions/test/xpcshell/xpcshell.ini:35
(Diff revision 1)
> [test_ext_idle.js]
> [test_ext_json_parser.js]
> [test_ext_localStorage.js]
> [test_ext_manifest_content_security_policy.js]
> [test_ext_manifest_incognito.js]
> +[test_ext_manifest_permissions.js]
This looks like perhaps obsolete?
Attachment #8778607 -
Flags: review?(aswan) → review+
Assignee | ||
Comment 9•8 years ago
|
||
mozreview-review-reply |
Comment on attachment 8778607 [details]
Bug 1289527: Hide browserAction and pageAction namespaces when relevant manifest entries are missing.
https://reviewboard.mozilla.org/r/69852/#review67392
> This looks like perhaps obsolete?
How so?
Assignee | ||
Comment 10•8 years ago
|
||
mozreview-review-reply |
Comment on attachment 8778607 [details]
Bug 1289527: Hide browserAction and pageAction namespaces when relevant manifest entries are missing.
https://reviewboard.mozilla.org/r/69852/#review67392
> How so?
Oh. I see. Yeah, good catch.
Assignee | ||
Comment 11•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a0e18de5ad18969306334ed1f094ccb410b265b1
Bug 1289527: Hide browserAction and pageAction namespaces when relevant manifest entries are missing. r=aswan
Comment 12•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Updated•6 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•