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)

49 Branch
defect

Tracking

(firefox51 fixed)

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: mattw, Assigned: kmag)

Details

(Whiteboard: triaged)

Attachments

(2 files)

Attached file bookmark_it_-1.0.xpi
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.
(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.
Yeah, we really need to not expose the API when there's no page_action manifest property. I've been meaning to fix that.
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.
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.
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.
is chrome incompatibility we should fix - but not major blocker
Priority: -- → P3
Whiteboard: investigate → triaged
Assignee: nobody → kmaglione+bmo
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+
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?
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.
https://hg.mozilla.org/integration/mozilla-inbound/rev/a0e18de5ad18969306334ed1f094ccb410b265b1 Bug 1289527: Hide browserAction and pageAction namespaces when relevant manifest entries are missing. r=aswan
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: