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
0
votes
2 answers

How to use @font-face on a Firefox WebExtension

I'm trying to port a Chrome extension Firefox add-on using the WebExtensions API . In chrome extension I am using src: url('chrome-extension://__MSG_@@extension_id__/css/fonts/webFonts/font-awesome/fontawesome-webfont.eot?v=4.5.0'); to include…
0
votes
2 answers

How to determine path to resources of Firefox WebExtension to get same value in chrome.extension.getUrl() for different users?

Prior to use our extension users have to log in. We use external provider that requires some parameters. Redirection url is among of them. When user log in he will be redirected to the page that have to be in xpi file. So, we have to know exactlly…
Karrsom
  • 1
  • 3
0
votes
1 answer

Hidden iframe Firefox add-on using WebExtensions

I need to create a hidden iframe in a Firefox add-on using WebExtensions. This is what I'm trying to do (as suggested here: Load multiple pages in a hidden iframe from a xul-based firefox extension): var hiddenWindow =…
0
votes
1 answer

Firefox WebExtension notifications API: How to call a function when the notification is clicked

I'm trying to develop a Firefox add on using WebExtensions. What I'm trying to do is open a new Firefox tab or window when the user clicks the notification. But it doesn't work. When I click the notification, nothing happens. I'm creating…
0
votes
1 answer

How to block resources based on their content before they are loaded in Webextensions?

I want to block resources (like JavaScript- or CSS-files), before they are fully loaded. The condition, if resources are blocked, depends on their content. Actually, there is no solution for doing this, or? What i know: Webextensions are similar to…
0
votes
1 answer

Signing and Submitting Firefox WebExtension

I am able to port my chrome extension(https://chrome.google.com/webstore/detail/clipmystuff/ponkmhjofooonokejbbmladaomkbbgcd) to Firefox EebExtension, everything is working fine in Firefox(46), but I am unable to publish the extension to Mozilla…
0
votes
2 answers

Open a tab and make a POST request to it in a firefox webextension

I try to migrate my firefox addon wich use low level SDK API to WebExtension and at some point I want to POST data url-encoded to a new tab. With the low level API it is possible through the following code: const querystring =…
Jérémie Bertrand
  • 3,025
  • 3
  • 44
  • 53
0
votes
1 answer

Selenium FirefoxDriver initialization

When I am trying to load the Selenium FireFoxDriver, process is taking more time to invoke the browser. I have tried for lot of options like disabling the auto updates and etc. But all efforts are in vain. So I have decided to load the FirefoxDriver…
0
votes
1 answer

Security error in Firefox WebExtension when trying getUrl image

Trying to port some Chrome extension and getting this Security Error: Content at "http://example.com" may not load or link to "moz-extension://04d69802-c26f-47ae-86f2-d54650455e5a/blocks/indicators/__icon/indicators__icon-tweet.png" (function () { …
0
votes
1 answer

WebExtension: How can I access the background script in my browser action

I'm totally new to WebExtension (trying to use them under Firefox). I've written a browser action. In order to keep a persistent state I figured that I have to implement a background script. How can I acccess variables defined in the background…
anhoppe
  • 4,287
  • 3
  • 46
  • 58
0
votes
0 answers

Chrome extension sendMessage and asynchronous callback

I built a Chrome extension using sendRequest to send a message from the content page to the popup, and get a callback. content.js : chrome.extension.sendRequest(data, function (result){ // here the result should be a boolean if (result){ …
0
votes
1 answer

Firefox WebExtension - issue with browser.i18n.getMessage

When calling browser.i18n.getMessage('myKey') in a Firefox WebExtension, an exception is shown in the background Console if 'myKey' does not exist: Unknown localization message myKey In Chrome, it fails silently and returns an empty string. At…
Glen Little
  • 6,951
  • 4
  • 46
  • 68
0
votes
1 answer

Using chrome.runtime.sendMessage does not yield a response in Firefox Web Extension

I'm trying to write a cross browser extension that is using a background script and a popup that cross-communicate: In the background script: class Listener{ listen(cb){ chrome.runtime.onMessage.addListener((transmission, sender,…
m90
  • 11,434
  • 13
  • 62
  • 112
-1
votes
0 answers

Google Extension: Background Change Works on Some Sites, Not on Others

I've created a Google Chrome extension that changes the background color of all div elements on certain websites. The extension works perfectly on websites like https://app.slack.com/ and https://www.thehindu****.com/, but it doesn't apply on…
-1
votes
1 answer

CORS header ‘Access-Control-Allow-Origin’ missing on response in addon but not on request

I am creating a Firefox extension which posts some data to a database. I made all parts in a modular fashion and am now combining everything piece by piece. As such I know that my code to POST data to the database works. Now here is the part that…
1 2 3
99
100