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

Firefox Web extension toDataURL operation is insecure

I'm getting this error when I try to load remote image and call toDataURL in the background js code file. SecurityError: The operation is insecure. I tried playing with CORS but it doesn't helped. Any solution or this? Btw this code works fine in…
Evgeniy
  • 193
  • 3
  • 19
0
votes
1 answer

I am creating a Firefox webextension which captures Mousewheel scroll and does something, but I am unable to do so

Here is the manifest file { "description": "", "manifest_version": 2, "name": "A", "version": "0.2.0.2", "permissions": [ "activeTab", "contextMenus", "tabs" ], "icons": { "48":…
Aakash Gupta
  • 183
  • 1
  • 10
0
votes
1 answer

What's the best way to open an html page from a Firefox Add-On

I'm building a Firefox Add-On, and I need to a button in the settings page that opens a page with a list of words that the Add-On has stored. What's the best way to do this? I've come up with this: function ShowList() { // We get the array from the…
carllacan
  • 310
  • 3
  • 10
0
votes
1 answer

I can't use the browser object from the settings page of my Firefox add-on

I'm making a Firefox Add-On that needs to keep track of a list of words. From the main javascript file I can read and modify a stored Array under the name "list", but when I try to access it from the settings page I get an error: ReferenceError:…
0
votes
1 answer

How to override XMLHttpRequest in Firefox's WebExtension

I am trying to override the XMLHttpRequest.protype.open method in Firefox's WebExtension. I have written a following code in content script var oldOpen = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function (method, url, async,…
sam
  • 481
  • 2
  • 8
  • 21
0
votes
1 answer

Show HTML file contained within the extension

I'm creating a website blocker: after you visit a website you've blocked, the browser displays a new HTML page saying "website blocked". The new HTML page is saved in my Chrome extension as message.html. Is there any way to display message.html in…
0
votes
1 answer

firefox addon tabs.executeScript error on specific pages No window matching {"matchesHost":[""]}

I have a firefox webextension ported from chrome extension. The executeScript call fails on this site. https://addons.mozilla.org/en-US/firefox/ I tested with multiple pages on this site and all are giving the same error The bare-minimum code to…
smk
  • 301
  • 6
  • 13
0
votes
1 answer

Firefox WebExtension : check if extension already exists

I'm porting my Chrome extension to a Firefox WebExtension, so far so good, I manage to communicate smoothly with my content, background scripts and my executable. I would like now to check the existence of my extension. This is actually the way I do…
Thordax
  • 1,673
  • 4
  • 28
  • 54
0
votes
1 answer

Get size of browser.storage.local in Firefox via WebExtensions

I am using WebExtensions to port a Chrome Extension to Firefox. As StorageArea.getBytesInUse(); is not supported in FireFox, is there any workaround to get the total size of the local storage object? I need this to call a clearCache function when…
0
votes
1 answer

Firefox Extension Address Bar Styling

I'm building a Firefox extension and was confused by what I can and cannot do with the WebExtensions API. Basically what I'm trying to do is perform some CSS operation in the address bar of Firefox, for simplicity, say add an underline to the URL…
0
votes
1 answer

Trying to make an extension

I have an extension that i'm trying to add content scrips alongside background scripts but it just says invalid when trying to temp load. { "description": "Creates tasks and calculates application incomplete date", "manifest_version": 2, "name":…
0
votes
1 answer

How to communicate between background script and page (popup) script?

How to control a variable in background script from page (popup) script? To getting resource each 10 seconds, I am using setTimeout loop in the below code. But below codes do not stop loop when I unchecked the checkbox in popup page…
KiYugadgeter
  • 3,796
  • 7
  • 34
  • 74
0
votes
1 answer

How can I stop temporary webextension without shutdown browser?

I was executing webextension on Firefox for testing with about:debugging menu. Then tests are done, I want to stop it. I am looking for a way to stop without shutdown browser, but I can't find a way to stop it out. Is there way for do it without…
KiYugadgeter
  • 3,796
  • 7
  • 34
  • 74
0
votes
1 answer

How to copy to clipboard via chrome.notification.create with chrome.notification.onClicked in a Firefox WebExtension add-on?

Testpage: https://www.google.com It works in Chrome but in Firefox Nightly 52.0a1 it gives me this error when clicked on the notification: document.execCommand(‘cut’/‘copy’) was denied because it was not called from inside a short running…
0
votes
1 answer

Why webextension installation failure?

I am learning how to write webextensions. so I'm copying "beastify" extension from here from scratch. But my copied version's installation failure. I don't know why installation is failure. There are same directory structure, same meaning code, same…
KiYugadgeter
  • 3,796
  • 7
  • 34
  • 74