Closed Bug 1412128 Opened 2 years ago Closed 2 years ago

WebExtension fails to get the right host permissions for tab even when key is in manifest.json


(WebExtensions :: Untriaged, defect)

58 Branch
Not set


(Not tracked)



(Reporter: u604707, Unassigned)


User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:58.0) Gecko/20100101 Firefox/58.0
Build ID: 20171026100047

Steps to reproduce:

I created an extension that uses `chrome.tabs.executeScript()` in order to inject some JS into a webpage. I believe I have all the right permissions (and more!) in my manifest.json, and the extension works fine, receiving the correct permissions in Chrome. I think this is a Firefox issue with granting permissions to extensions.

Steps to reproduce:

* install the extension (link below), or any extension with correct permissions in manifest.json
* navigate to a *sandboxed page without the 'allow-script' permission set* (see below for valid links)
* attempt to use `chrome.tabs.executeScript()` 

## Useful links

- My extension
- My extension's source
- A web page that works
- A web page that doesn't work (sandboxed, etc.)

Very easy way to see the difference is to install the extensions both in Chrome and Firefox (links on GitHub), and navigate to the above pages - in Chrome both work, in Firefox only one works.

Actual results:

Results in no script being executed and "Error: Missing host permission for the tab" being logged to the console.

Expected results:

Since there are appropriate permissions in the manifest.json, the exension should have had host permissions, and the script should have been executed.

This exact same manifest.json and API calls work as expected in Chrome, granting permissions to the extension.
As an extra note this is the manifest.json in the extension:
looks like probably a duplicate of bug 1411641?
Component: Untriaged → WebExtensions: Untriaged
Product: Firefox → Toolkit
Closed: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1411641
Yep, that issue looks like it's representing the same bug. We can follow it there - thanks!
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.