Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1125971 of Chrome incompatibilities

  • Revision slug: Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities
  • Revision title: Chrome incompatibilities
  • Revision id: 1125971
  • Created:
  • Creator: Makyen
  • Is current revision? No
  • Comment Add links to partially supported manifest.json keys and JavaScript APIs

Revision Content

{{AddonSidebar}}

WebExtensions are designed to be compatible with Chrome and Opera extensions: as far as possible, extensions written for those browsers should run on Firefox with minimal changes.

However, Firefox currently has support for only a limited set of the features and APIs supported by Chrome and Opera. We're working on adding more support, but many features are not yet supported, and we may never support some.

This article lists all features and APIs that are fully or partially supported in Firefox Developer Edition (currently Firefox 47). Where a feature is partially supported, we've indicated what the gaps are.

You should assume that features and APIs not listed here at all are not yet supported.

manifest.json features

Fully supported keys

Partially supported keys

background

Firefox does not support the "persistent" property. Background scripts stay loaded all the time.

commands

Firefox does not support:

  • Media keys as shortcuts
  • global
  • the special command _execute_browser_action

content_scripts

Firefox does not support:

  • match_about_blank

content_security_policy

Firefox does not support:

  • "https://127.0.0.1" or "https://localhost" as script sources: they must be served over HTTPS.

options_ui

Firefox does not support:

  • chrome_style

Using options_ui requires a valid value for the applications.gecko.id property.

permissions

Firefox does not support the following permissions:

  • background
  • clipboardRead
  • clipboardWrite
  • geolocation
  • unlimitedStorage

Obviously, it doesn't support permissions for APIs that are themselves not supported.

incognito

Firefox does not support the following incognito (private browsing) modes:

  • split

JavaScript APIs

Fully supported APIs

Partially supported APIs

bookmarks

  • Firefox does not support:
    • import()
    • export()
    • onCreated
    • onRemoved
    • onChanged
    • onMoved
    • onChildrenReordered
    • onImportBegan
    • onImportEnded
    • BookmarkTreeNodeUnmodifiable
  • Firefox has special bookmarks like "Recently Bookmarked" or "Recently Visited"

contextMenus

  • Firefox does not support:
    • the "browser_action" or "page_action" context types

downloads

  • Firefox does not support:
    • drag()
    • acceptDanger()
    • setShelfEnabled()
    • onDeterminingFilename
  • The saveAs option and values other than "GET" for the method option are not supported by download()

extension

  • Firefox does not support:
    • setUpdateUrlData()
  • Additionally, the following deprecated properties will not be supported:
    • onRequest
    • onRequestExternal
    • getExtensionTabs()
    • sendRequest()

idle

  • Firefox does not support:
    • onStateChanged
    • setDetectionInterval()

Additoinally, queryState() always returns "active" in Firefox, regardless of the current system idle state.

management

  • Firefox does not support:
    • LaunchType
    • get()
    • getAll()
    • getPermissionWarningsById()
    • getPermissionWarningsByManifest()
    • setEnabled()
    • uninstall()
    • launchApp()
    • createAppShortcut()
    • setLaunchType()
    • generateAppForLink()
    • onInstalled
    • onUninstalled
    • onEnabled
    • onDisabled

notifications

  • Firefox does not support:
    • update()
    • onButtonClicked
  • Firefox doesn't provide byUser data.
  • Firefox only supports the "basic" type.
  • For chrome.notifications.create(), with the "basic" type, iconUrl is optional in Firefox. It is required in Chrome.
  • Notifications are cleared immediately when the user clicks on them. This is not the case in Chrome.
  • If you call chrome.notifications.create() more than once in rapid succession, Firefox may end up not displaying any notification at all. Waiting to make subsequent calls until within the chrome.notifications.create() callback function is not a sufficiently long delay to prevent this from happening.
  • If the iconUrl property is present, but invalid when chrome.notifications.create() is called, the notification will be displayed with space for the icon, but without the icon. In Chrome, the notification will not be displayed, an error will be shown in the extension's background page console and runtime.lastError will be set in the callback function.

runtime

  • Firefox does not support:
    • getPackageDirectoryEntry()
    • reload()
    • requestUpdateCheck()
    • restart()
    • sendNativeMessage()
    • onBrowserUpdateAvailable
    • onConnectExternal
    • onInstalled
    • onMessageExternal
    • onRestartRequired
    • onStartup
    • onSuspend
    • onSuspendCanceled
    • onUpdateAvailable
  • runtime.lastError is a string in Firefox. In Chrome, it is an Object with the error text as the string value of the message property.

storage

  • Firefox does not support:
    • managed storage area
    • sync storage area
    • getBytesInUse().

tabs

  • Firefox treats highlighted and active as the same, since Firefox has no concept of selecting multiple tabs.
  • In Firefox, you need the tabs permission if you want to include url in the queryInfo parameter to tabs.query().
  • In Firefox, relative URLs passed into tabs.executeScript() or tabs.insertCSS() are resolved relative to the current page URL. In Chrome, these URLs are resolved relative to the add-on's base URL. To work cross-browser, you can specify the path as an absolute URL, starting at the add-on's root, like this:

    /path/to/script.js
  • In Firefox, you can't open (using {{WebExtAPIRef("tabs.create")}}), or navigate to (using {{WebExtAPIRef("tabs.update")}}) privileged URLs:
    • chrome: URLs
    • javascript: URLs
    • data: URLs
    • privileged about: URLs (for example, about:config, about:addons, about:debugging)
  • Additionally, the following deprecated properties will not be supported:
    • sendRequest()
    • getSelected()
    • onActiveChanged
    • onHighlightChanged
    • onSelectionChanged

webNavigation

  • Firefox does not support:
    • onCreatedNavigationTarget
    • onTabReplaced

webRequest

  • Firefox does not support:
    • onAuthRequired
    • filtering by windowId and tabId
    • the "requestBody" instruction in opt_extraInfoSpec
  • In Firefox requests can be redirected only if their original URL uses the http or https scheme

windows

  • Firefox does not support:
    • the focused option in create()
  • In Firefox onFocusChanged will trigger multiple times for a given focus change.

Planned APIs

We don't support the following APIs, but plan to, soon:

This doesn't mean that these are the only additional APIs we will support, but that they are our current priorities.

Miscellaneous incompatibilities

Optional arguments

URLs in CSS

Firefox resolves URLs in injected CSS files relative to the CSS file itself, rather than to the page it's injected into.

Additional incompatibilities

Firefox does not support using alert() from background pages. Using alert(message) from a background page will cause the Browser Console to be opened and both a line stating "alert() is not supported in background windows; please use console.log instead." and the message will be output to the console.

Firefox does not support confirm() from background pages. Using confirm(message) will result in a error being thrown.

Firefox does not support prompt() from background pages. Using prompt(message) will result in a error being thrown.

Revision Source

<div>{{AddonSidebar}}</div>

<p>WebExtensions are designed to be compatible with Chrome and Opera extensions: as far as possible, extensions written for those browsers should run on Firefox with minimal changes.</p>

<p>However, Firefox currently has support for only a limited set of the features and APIs supported by Chrome and Opera. We're working on adding more support, but many features are not yet supported, and we may never support some.</p>

<p>This article lists all features and APIs that are fully or partially supported in Firefox Developer Edition (currently Firefox 47). Where a feature is partially supported, we've indicated what the gaps are.</p>

<div class="note">
<p>You should assume that features and APIs not listed here at all are not yet supported.</p>
</div>

<h2 id="manifest.json_features"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json">manifest.json</a> features</h2>

<h3 id="Fully_supported_keys">Fully supported keys</h3>

<ul>
 <li><code><a href="/en-US/Add-ons/WebExtensions/manifest.json/applications">applications</a></code></li>
 <li><code><a href="/en-US/Add-ons/WebExtensions/manifest.json/browser_action">browser_action</a></code></li>
 <li><code><a href="/en-US/Add-ons/WebExtensions/manifest.json/default_locale">default_locale</a></code></li>
 <li><code><a href="/en-US/Add-ons/WebExtensions/manifest.json/description">description</a></code></li>
 <li><code><a href="/en-US/Add-ons/WebExtensions/manifest.json/icons">icons</a></code></li>
 <li><code><a href="/en-US/Add-ons/WebExtensions/manifest.json/manifest_version">manifest_version</a></code></li>
 <li><code><a href="/en-US/Add-ons/WebExtensions/manifest.json/name">name</a></code></li>
 <li><code><a href="/en-US/Add-ons/WebExtensions/manifest.json/page_action">page_action</a></code></li>
 <li><code><a href="/en-US/Add-ons/WebExtensions/manifest.json/version">version</a></code></li>
 <li><code><a href="/en-US/Add-ons/WebExtensions/manifest.json/web_accessible_resources">web_accessible_resources</a></code></li>
</ul>

<h3 id="Partially_supported_keys">Partially supported keys</h3>

<h4 id="background"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background">background</a></h4>

<p>Firefox does not support the <code>"persistent"</code> property. Background scripts stay loaded all the time.</p>

<h4 id="commands"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands">commands</a></h4>

<p>Firefox does not support:</p>

<ul>
 <li>Media keys as shortcuts</li>
 <li><code>global</code></li>
 <li>the special command <code>_execute_browser_action</code></li>
</ul>

<h4 id="content_scripts"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts">content_scripts</a></h4>

<p>Firefox does not support:</p>

<ul>
 <li><code>match_about_blank</code></li>
</ul>

<h4 id="content_security_policy"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_security_policy">content_security_policy</a></h4>

<p>Firefox does not support:</p>

<ul>
 <li>"https://127.0.0.1" or "https://localhost" as script sources: they must be served over HTTPS.</li>
</ul>

<h4 id="options_ui"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/options_ui">options_ui</a></h4>

<p>Firefox does not support:</p>

<ul>
 <li><code>chrome_style</code></li>
</ul>

<p>Using <code>options_ui</code> requires a valid value for the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/applications">applications.gecko.id</a> property.</p>

<h4 id="permissions"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permissions</a></h4>

<p>Firefox does not support the following permissions:</p>

<ul>
 <li><code>background</code></li>
 <li><code>clipboardRead</code></li>
 <li><code>clipboardWrite</code></li>
 <li><code>geolocation</code></li>
 <li><code>unlimitedStorage</code></li>
</ul>

<p>Obviously, it doesn't support permissions for APIs that are themselves not supported.</p>

<h4 id="incognito">incognito</h4>

<p>Firefox does not support the following incognito (private browsing) modes:</p>

<ul>
 <li><code>split</code></li>
</ul>

<h2 id="JavaScript_APIs">JavaScript APIs</h2>

<h3 id="Fully_supported_APIs">Fully supported APIs</h3>

<ul>
 <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/alarms">alarms</a></li>
 <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserAction">browserAction</a>
  <ul>
   <li>Relative URLs passed to <code>setPopup()</code> are resolved relative to the caller document, rather than to the extension root</li>
  </ul>
 </li>
 <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/commands">commands</a></li>
 <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/contextMenus">contextMenus</a></li>
 <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies">cookies</a></li>
 <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n">i18n</a></li>
 <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/pageAction">pageAction</a>
  <ul>
   <li>Relative URLs passed to <code>setPopup()</code> are resolved relative to the caller document, rather than to the extension root</li>
  </ul>
 </li>
</ul>

<h3 id="Partially_supported_APIs">Partially supported APIs</h3>

<h4 id="bookmarks"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/bookmarks">bookmarks</a></h4>

<ul>
 <li>Firefox does not support:
  <ul>
   <li><code>import()</code></li>
   <li><code>export()</code></li>
   <li><code>onCreated</code></li>
   <li><code>onRemoved</code></li>
   <li><code>onChanged</code></li>
   <li><code>onMoved</code></li>
   <li><code>onChildrenReordered</code></li>
   <li><code>onImportBegan</code></li>
   <li><code>onImportEnded</code></li>
   <li><code>BookmarkTreeNodeUnmodifiable</code></li>
  </ul>
 </li>
 <li>Firefox has special bookmarks like "Recently Bookmarked" or "Recently Visited"</li>
</ul>

<h4 id="contextMenus"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/contextMenus">contextMenus</a></h4>

<ul>
 <li>Firefox does not support:
  <ul>
   <li>the "browser_action" or "page_action" context types</li>
  </ul>
 </li>
</ul>

<h4 id="downloads"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/downloads">downloads</a></h4>

<ul>
 <li>Firefox does not support:
  <ul>
   <li><code>drag()</code></li>
   <li><code>acceptDanger()</code></li>
   <li><code>setShelfEnabled()</code></li>
   <li><code>onDeterminingFilename</code></li>
  </ul>
 </li>
 <li>The <code>saveAs</code> option and values other than <code>"GET"</code> for the <code>method</code> option are not supported by <code>download()</code></li>
</ul>

<h4 id="extension"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/extension">extension</a></h4>

<ul>
 <li>Firefox does not support:
  <ul>
   <li><code>setUpdateUrlData()</code></li>
  </ul>
 </li>
 <li>Additionally, the following deprecated properties will not be supported:
  <ul>
   <li><code>onRequest</code></li>
   <li><code>onRequestExternal</code></li>
   <li><code>getExtensionTabs()</code></li>
   <li><code>sendRequest()</code></li>
  </ul>
 </li>
</ul>

<h4 id="idle"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/idle">idle</a></h4>

<ul>
 <li>Firefox does not support:
  <ul>
   <li><code>onStateChanged</code></li>
   <li><code>setDetectionInterval()</code></li>
  </ul>
 </li>
</ul>

<p>Additoinally, <code>queryState()</code> always returns <code>"active"</code> in Firefox, regardless of the current system idle state.</p>

<h4 id="management"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/management">management</a></h4>

<ul>
 <li>Firefox does not support:
  <ul>
   <li><code><span class="str">LaunchType</span></code></li>
   <li><code><span class="str">get</span>()</code></li>
   <li><code><span class="str">getAll()</span></code></li>
   <li><code><span class="str">getPermissionWarningsById()</span></code></li>
   <li><code><span class="str">getPermissionWarningsByManifest()</span></code></li>
   <li><code><span class="str">setEnabled</span>()</code></li>
   <li><code><span class="str">uninstall()</span></code></li>
   <li><code><span class="str">launchApp()</span></code></li>
   <li><code><span class="str">createAppShortcut()</span></code></li>
   <li><code><span class="str">setLaunchType()</span></code></li>
   <li><code><span class="str">generateAppForLink()</span></code></li>
   <li><code><span class="str">onInstalled</span></code></li>
   <li><code><span class="str">onUninstalled</span></code></li>
   <li><code><span class="str">onEnabled</span></code></li>
   <li><code><span class="str">onDisabled</span></code></li>
  </ul>
 </li>
</ul>

<h4 id="notifications"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/notifications">notifications</a></h4>

<ul>
 <li>Firefox does not support:
  <ul>
   <li><code>update()</code></li>
   <li><code>onButtonClicked</code></li>
  </ul>
 </li>
 <li>Firefox doesn't provide <code>byUser</code> data.</li>
 <li>Firefox only supports the <code>"basic"</code> <code><a href="/en-US/Add-ons/WebExtensions/API/notifications/TemplateType">type</a>.</code></li>
 <li>For <code>chrome.notifications.create(), with the "basic"</code> <code><a href="/en-US/Add-ons/WebExtensions/API/notifications/TemplateType">type</a></code>, <code>iconUrl</code> is optional in Firefox. It is required in Chrome.</li>
 <li>Notifications are cleared immediately when the user clicks on them. This is not the case in Chrome.</li>
 <li>If you call <code>chrome.notifications.create()</code> more than once in rapid succession, Firefox may end up not displaying any notification at all. Waiting to make subsequent calls until within the <code>chrome.notifications.create() callback</code> function is not a sufficiently long delay to prevent this from happening.</li>
 <li>If the <code>iconUrl</code> property is present, but invalid when <code>chrome.notifications.create() is called</code>, the notification will be displayed with space for the icon, but without the icon. In Chrome, the notification will not be displayed, an error will be shown in the extension's background page console and <code>runtime.lastError</code> will be set in the callback function.</li>
</ul>

<h4 id="runtime"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime">runtime</a></h4>

<ul>
 <li>Firefox does not support:
  <ul>
   <li><code>getPackageDirectoryEntry()</code></li>
   <li><code>reload()</code></li>
   <li><code>requestUpdateCheck()</code></li>
   <li><code>restart()</code></li>
   <li><code>sendNativeMessage()</code></li>
   <li><code>onBrowserUpdateAvailable</code></li>
   <li><code>onConnectExternal</code></li>
   <li><code>onInstalled</code></li>
   <li><code>onMessageExternal</code></li>
   <li><code>onRestartRequired</code></li>
   <li><code>onStartup</code></li>
   <li><code>onSuspend</code></li>
   <li><code>onSuspendCanceled</code></li>
   <li><code>onUpdateAvailable</code></li>
  </ul>
 </li>
 <li><code>runtime.lastError</code> is a string in Firefox. In Chrome, it is an <code>Object</code> with the error text as the <code>string</code> value of the <code>message</code> property.</li>
</ul>

<h4 id="storage"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage">storage</a></h4>

<ul>
 <li>Firefox does not support:
  <ul>
   <li><code>managed</code> storage area</li>
   <li><code>sync</code> storage area</li>
   <li><code>getBytesInUse()</code>.</li>
  </ul>
 </li>
</ul>

<h4 id="tabs"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs">tabs</a></h4>

<ul>
 <li>Firefox treats <code>highlighted</code> and <code>active</code> as the same, since Firefox has no concept of selecting multiple tabs.</li>
 <li>In Firefox, you need the <code>tabs</code> <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permission</a> if you want to include <code>url</code> in the <code>queryInfo</code> parameter to <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/query">tabs.query()</a></code>.</li>
 <li>
  <p>In Firefox, relative URLs passed into <code>tabs.executeScript()</code> or <code>tabs.insertCSS()</code> are resolved relative to the current page URL. In Chrome, these URLs are resolved relative to the add-on's base URL. To work cross-browser, you can specify the path as an absolute URL, starting at the add-on's root, like this:</p>

  <pre class="line-numbers  language-html">
<code class="language-html">/path/to/script.js</code></pre>
 </li>
 <li>In Firefox, you can't open (using {{WebExtAPIRef("tabs.create")}}), or navigate to (using {{WebExtAPIRef("tabs.update")}}) privileged URLs:
  <ul>
   <li>chrome: URLs</li>
   <li>javascript: URLs</li>
   <li>data: URLs</li>
   <li>privileged about: URLs (for example, about:config, about:addons, about:debugging)</li>
  </ul>
 </li>
 <li>Additionally, the following deprecated properties will not be supported:
  <ul>
   <li><code>sendRequest()</code></li>
   <li><code>getSelected()</code></li>
   <li><code>onActiveChanged</code></li>
   <li><code>onHighlightChanged</code></li>
   <li><code>onSelectionChanged</code></li>
  </ul>
 </li>
</ul>

<h4 id="webNavigation"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webNavigation">webNavigation</a></h4>

<ul>
 <li>Firefox does not support:
  <ul>
   <li><code>onCreatedNavigationTarget</code></li>
   <li><code>onTabReplaced</code></li>
  </ul>
 </li>
</ul>

<h4 id="webRequest"><a href="/en-US/docs/User%3Awbamberg/WebExtensions/API/webRequest">webRequest</a></h4>

<ul>
 <li>Firefox does not support:
  <ul>
   <li><code>onAuthRequired</code></li>
   <li>filtering by <code>windowId</code> and <code>tabId</code></li>
   <li>the <code>"requestBody"</code> instruction in <code>opt_extraInfoSpec</code></li>
  </ul>
 </li>
 <li>In Firefox requests can be redirected only if their original URL uses the http or https scheme</li>
</ul>

<h4 id="windows"><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows">windows</a></h4>

<ul>
 <li>Firefox does not support:
  <ul>
   <li>the <code>focused </code>option in <code>create()</code></li>
  </ul>
 </li>
 <li>In Firefox <code>onFocusChanged</code> will trigger multiple times for a given focus change.</li>
</ul>

<h3 id="Planned_APIs">Planned APIs</h3>

<p>We don't support the following APIs, but plan to, soon:</p>

<ul>
 <li><a class="external text" href="https://developer.chrome.com/extensions/devtools" rel="nofollow">Devtools (mostly panels)</a></li>
 <li><a href="https://developer.chrome.com/extensions/debugger">debugger</a></li>
 <li><a class="external text" href="https://developer.chrome.com/extensions/omnibox" rel="nofollow">omnibox</a></li>
 <li><a class="external text" href="https://developer.chrome.com/extensions/permissions" rel="nofollow">permissions</a></li>
</ul>

<p>This doesn't mean that these are the only additional APIs we will support, but that they are our current priorities.</p>

<h3 id="Miscellaneous_incompatibilities">Miscellaneous incompatibilities</h3>

<h4 id="Optional_arguments">Optional arguments</h4>

<h4 id="URLs_in_CSS">URLs in CSS</h4>

<p>Firefox resolves URLs in injected CSS files relative to the CSS file itself, rather than to the page it's injected into.</p>

<h4 id="Additional_incompatibilities">Additional incompatibilities</h4>

<p>Firefox does not support using <code><a href="/en-US/docs/Web/API/Window/alert">alert()</a></code> from background pages. Using <code>alert(message)</code> from a background page will cause the <a href="/en-US/docs/Tools/Browser_Console">Browser Console</a> to be opened and both a line stating "alert() is not supported in background windows; please use console.log instead." and the <code>message</code> will be output to the console.</p>

<p>Firefox does not support <a href="/en-US/docs/Web/API/Window/confirm">confirm()</a> from background pages. Using confirm(message) will result in a error being thrown.</p>

<p>Firefox does not support <a href="/en-US/docs/Web/API/Window/prompt">prompt()</a> from background pages. Using prompt(message) will result in a error being thrown.</p>
Revert to this revision