Questions tagged [firefox-addon-webextensions]

WebExtensions are a way to write Firefox extensions that are compatible with other browsers such as Google Chrome and Opera. Microsoft plans to bring support to their Edge browser soon. Questions requiring a MCVE (i.e. debugging questions) should include your manifest.json file in addition to all other files needed to duplicate the problem.

WebExtensions are a new way to write Firefox extensions. It is available in all current versions of Firefox (version 48.0+).

The WebExtensions API is designed for cross-browser compatibility. To a large extent, the API is compatible with the extension API supported by Google Chrome and Opera, with Microsoft Edge following soon.

The documentation for Firefox WebExtensions can be found at MDN :: Add-ons - WebExtensions.

The WebExtensions API is under active development. What is supported improves in each newer version of Firefox. You should pay attention to the Browser Compatibility section on the API documentation page for any part of the API you are using to verify the portions of the API you are using are supported in the version of Firefox you are using. You may want to strongly consider testing your extension with either Firefox Developer Edition, or Firefox Nightly.

Minimal, Complete, and Verifiable Examples will almost always need a manifest.json file in order to be complete, in addition to any other files needed. The manifest.json file contains key information which is necessary in many situations to determine why an extension is not working.

For more information on Firefox Add-on types see the full documentation on Mozilla Developer Network: Add-ons.

1541 questions
8
votes
2 answers

How to share local storage auth token from my site to my WebExtension?

I have a bookmarking firefox/chrome WebExtension (using the standard popup, content and background scripts). My api servers have a /login route that returns a JSON Web Token and the web app stores that in its local storage. I have full control over…
8
votes
3 answers

enabling right click:

I've a web page(which I don't control) with: I want to enable right click but there's no way I'm able to do it. In the saved html when I removed this oncontextmenu then it started working. I've tried all…
8
votes
1 answer

Web Extension : How do I use "browser_style = true"?

When writing a Firefox web extension it's possible to use a default css for browser or page actions so that they are styled like other browser UI components. It's done by inserting: "browser_style": true in the extension manifest. Styles like…
mins
  • 6,478
  • 12
  • 56
  • 75
7
votes
1 answer

Reading manifest: Error processing options_page: An unexpected property was found in the WebExtension

When trying to load the chrome extension in mozilla firefox. I have error: Reading manifest: Error processing options_page: An unexpected property was found in the WebExtension Reading manifest: Error processing options_page: An unexpected…
7
votes
2 answers

How to audit a chrome extension's open-source code?

I am concerned that a chrome extension is providing users with different code than that in its open-source repo. The extension is MetaMask, a cryptocurrency wallet that was recently found to be injecting unique identifiers into every website a user…
7
votes
3 answers

What differenciates browser.alarms.create from setTimeout/setInterval in WebExtensions?

I am creating a WebExtension for browsers. So I found out about the browser.alarms API. It basically allows you to set a (reoccurring or one-time) alarm and a callback will be fired. Now, we've had such a feature this for a long time in JavaScript…
7
votes
1 answer

Is it possible to write a WebExtension in WebAssembly?

I wonder if it is possible to use WebAssembly to develop an add-on for Firefox. I doubt that it is possible to do completely in WASM, but what about WASM core with minimal JavaScript wrapper?
Vanzef
  • 453
  • 1
  • 5
  • 17
7
votes
1 answer

How do I enable copy to clipboard in Firefox on Linux?

I released a new version of a firefox webextension, Copy All Tabs last night. The code is open source and available on github. The new version fixes many bugs and is overall more stable. It works as expected on Windows and Mac (Firefox…
7
votes
3 answers

returning a promise from the then of another promise

i am a little new at this. Please help I am trying to return a promise from a function. This seems to work well until I try to return the promise in the then of an existing promise. I am trying to do this in a FireFox extension. The code below is…
7
votes
2 answers

How to include a JavaScript source map file in a Firefox WebExtension?

When attempting to use a library with a source map from within a WebExtension, I encounter this error. Source map error: TypeError: NetworkError when attempting to fetch resource. Resource URL:…
user2895783
7
votes
1 answer

Mozilla Add-Ons rejecting jQuery (despite not being modified)

(Note, this is intended as self-answer Q&A for a problem I encountered) After trying to submit a WebExtension to Mozilla Add-Ons for public listing, the submission was rejected by a reviewer with the following message: Your add-on includes a…
Xan
  • 74,770
  • 16
  • 179
  • 206
7
votes
2 answers

Firefox WebExtension toolbar buttons to toggle sidebars

Since the Firefox Australis interface, there are no more toolbar buttons to toggle the Bookmarks and History sidebars with one click. There is the "show sidebars" toolbar button, but it displays an animated popup and requires 2 clicks. So I'm trying…
Gras Double
  • 15,901
  • 8
  • 56
  • 54
7
votes
3 answers

Browser extensions: Send messages (with response) between browser-action-popup and background-script

First of all I'm not looking for Long Lived Connections. I'm specifically looking for a way to send messages and send direct responses to these messages. When you send messages between a content-script and a background-script it's pretty straight…
Forivin
  • 14,780
  • 27
  • 106
  • 199
7
votes
1 answer

Open Firefox with a temporary add-on on startup

Is there a way in which I can open Firefox and force it to load a temporary add-on (webextension) on startup? Normally I have to manually go to about:debugging and select the extension on my hard drive. I'm looking for a flag I can pass when I load…
7
votes
1 answer

Firefox WebExtension: Make XMLHttpRequest

I'm making a Firefox WebExtension add-on. Here's what should happen: User clicks browser icon on ANY page. JavaScript is executed, collecting information from the page. Information is sent to my server using XMLHttpRequest This is what my Chrome…