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
6
votes
1 answer

Context menus not working firefox add-on WebExtensions

I'm trying to add a context menu to my firefox add-on using the WebExtensions API. I need the background script to listen to a click on the menu item and send a message to the content script. This is what I have: manifest.json { …
6
votes
1 answer

How to change firefox preferences (about:config) using the new WebExtensions api?

To change the settings (about:config) with the old API you would simply do: require('sdk/preferences/service').set('media.webrtc.debug.multi_log', true); I can't find anything on the subject for the new WebExtensions add-ons of Firefox. Is it not…
6
votes
1 answer

Firefox extension popup won't resize

I'm working on porting an extension from Chrome to Firefox. The popup has several different sized elements which can be shown. The issue that I'm running into is when the elements are changed or the body is resized the 'window' that the popup is…
6
votes
2 answers

How to inspect a Firefox WebExtension popup?

I'm trying to get a Google Chrome Extension to run as a Firefox Webextension. My original Problem is that the popup has no height. Besides that I could not for the life of me figure out how to inspect the DOM of the popup. Btw the popup is just an…
Philip Claren
  • 2,705
  • 3
  • 24
  • 33
5
votes
2 answers

Uncaught TypeError: Cannot read properties of undefined (reading 'onClicked')

I'm trying to migrate my chrome pure JS extension into a vuejs version. All my pureJS version works fine. But with vuejs i have an unintelligible error loading extension. Here is my manifest.json and my vue.config.js : Manifest : { …
5
votes
0 answers

launchWebFlow in firefox extension closes the extension window on oauth2 popup

So I am running into an interesting issue and would like some opinions. So I have a chrome extension that I am porting over to a firefox extension. Everything is working perfect besides this stupid issue I am having. Basically, when I initiate…
CodingIsFun33
  • 433
  • 3
  • 14
5
votes
1 answer

How to toggle the Firefox JSON Viewer dark-mode?

How can I turn it dark-mode? I already set the Firefox theme to dark but it didn't change...
5
votes
0 answers

Prevent Firefox from bypassing the disk caches in a request (how to disable "Race Cache With Network")?

Since version 59, Firefox has a feature called Race Cache With Network (RCWN). If Firefox detects that the disk is slow, it can decide to start a network requests immediately without waiting for the cache. It is a trade-off: if the network requests…
Philipp Claßen
  • 41,306
  • 31
  • 146
  • 239
5
votes
1 answer

Firefox extension: JavaScript file included via script tag is not working

Based on the example from MDN, I've created my own extension that showing just a 'hi' message. I've included a file named "popup.js" via tag. But this file is not getting executed. This is my manifest.json file: { "manifest_version": 2, …
5
votes
4 answers

Force Proxy re-authentication in Chrome Extension

I'm making an extension which allows users to store proxy servers with auth credentials (user/pass) and switch between servers. I am listening for the webRequest.onAuthRequired event and when the server challenges for auth, proving the…
5
votes
0 answers

How to listen for URL changes in a web-extension that are initiated in the web-app itself?

In a web-extension, I'm registering a content-script programmatically: browser.contentScripts.register({ matches: ["https://www.example.com/messages/*"], js: [{file: "my-callback-script"}], runAt: "document_idle" }); The page I register…
paul_h
  • 1,859
  • 3
  • 19
  • 27
5
votes
1 answer

Firefox Web Extension "Can't access dead object" error

I was having trouble finding an up-to-date answer for this issue, and don't often have time to answer questions here so thought I'd post this so I can answer my own question since I figured out a solution. I'm making a Web Extension for Chrome and…
5
votes
1 answer

How to update self-hosted firefox webExtension

How do I configure my self-distrubuted firefox webExtension to auto-update, I have tried following MDN update doc but still unable to update. My web Extension is hosted on a sub-domain name like "https://files.example.com/myfile/extension.xpi" My…
drtob
  • 333
  • 3
  • 10
5
votes
1 answer

How to get the title of the current tab in firefox web extension?

I am trying to code a simple firefox extension that displays the title of the current tab the user is viewing when the extension's button is pressed. Here is my manifest.json file: { "manifest_version": 2, "name": "Perspective", …
Foobar
  • 7,458
  • 16
  • 81
  • 161