The page Browser support for JavaScript APIs includes compatibility tables for all APIs that have any support in Firefox. Where there are caveats around support for a given API item, this is indicated in these tables with an asterisk "*" and in the reference page for the API item, the caveats are explained.
These tables are generated from compatibility data stored as JSON files in GitHub.
The rest of this section describes compatibility issues that are not already captured in the tables.
Notifications API
For notifications.create()
, with type "basic"
:
- In Firefox:
iconUrl
is optional.
- In Chrome:
iconUrl
is required.
When the user clicks on a notification:
- In Firefox: The notification is cleared immediately.
- In Chrome: This is not the case.
If you call notifications.create()
more than once in rapid succession:
- In Firefox: In Firefox, the notifications may not display at all. Waiting to make subsequent calls until within the
chrome.notifications.create()
callback function is not a sufficient delay to prevent this.
Proxy API
Firefox's proxy
API followed a completely different design from Chrome's Proxy API.
- In Firefox: An extension can register a PAC file.
- In Chrome: An extension can register a PAC file, but can also define explicit proxying rules.
Because this API is incompatible with Chrome's proxy
API, the Firefox proxy API is only available through the browser
namespace.
Tabs API
When using tabs.executeScript()
or tabs.insertCSS()
:
- In Firefox: Relative URLs passed are resolved relative to the current page URL.
- In Chrome: These URLs are resolved relative to the extension's base URL.
To work cross-browser, you can specify the path as an absolute URL, starting at the extension's root, like this:
When querying tabs by URL tabs.query()
:
- In Firefox: Extensions must have the
"tabs"
permission.
- In Chrome: Extensions do not need the
"tabs"
permission, but only tabs whose URLs match the extension's host permissions will be included in the results.
When calling tabs.remove()
:
- In Firefox: The
tabs.remove()
promise is fulfilled after the beforeunload
event.
- In Chrome: The callback does not wait for
beforeunload
.
WebRequest API
- In Firefox:
- Requests can be redirected only if their original URL uses the
http:
or https:
scheme.
- The
activeTab
permission does not allow intercepting network requests in the current tab. (See bug 1617479)
- Events are not fired for system requests (for example, extension upgrades or search bar suggestions).
- If an extension wants to redirect a public (e.g., HTTPS) URL to an extension page, the extension's
manifest.json
file must contain a web_accessible_resources
key with the URL of the extension page.
-
Note: Any website may then link or redirect to that URL, and extensions should treat any input (POST data, for example) as if it came from an untrusted source, just as a normal web page should.
- Some of the
browser.webRequest.*
APIs allow returning Promises that resolves webRequest.BlockingResponse
asynchronously.
- In Chrome: Only
webRequest.onAuthRequired
supports asynchronous webRequest.BlockingResponse
via supplying 'asyncBlocking'
.
Windows API
- In Firefox:
onFocusChanged
of the windows
API, will trigger multiple times for a given focus change.