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

chrome.notification.create with chrome.notification.onClicked in a Firefox WebExtension add-on

I have a problem understanding the documentation for the WebExtensions notification.onClicked event. Ultimately, I'm trying to get the text of the notification copied to the clipboard when you click on it. However, right now I am having a problem…
0
votes
1 answer

Mozilla WebExtension desktop notification display time and/or require user interaction

I have a WebExtension for Mozilla, which notifies me with the desktop notification function. It works exactly how I want, but Firefox will close the notification automatically after X seconds. Is it possible to display the notification until the…
Patrick Mlr
  • 2,955
  • 2
  • 16
  • 25
0
votes
1 answer

Cross-Origin issue with getViews()

I have been working in my free time to create a Firefox WebExtensions based add-on that essentially reads the page, opens a local HTML, submits a form on the HTML page to navigate to a new URL but I am running into issues with…
0
votes
1 answer

Why storage.set / storage.get fails to set/get data in Chrome?

I am starting to learn to debug extension in Chrome. I have this problem in Chrome but in Firefox webextensions there is not problem. The problem is that in Chrome I cannot get the data which has been saved to storage. I have this function in…
John Boe
  • 3,501
  • 10
  • 37
  • 71
0
votes
1 answer

How to bookmark and close all tabs with javascript?

I have code so far that will save a bookmark of the current tab then close it when i push my WebExtension button. I want the code to save and then close all of the tabs. var currentTab; var currentBookmark; // gets active tabe function…
Robinhoets
  • 56
  • 2
  • 11
0
votes
1 answer

Manipulating downloaded files with the WebExtensions API

I want to create a Firefox extension using their WebExtensions API. The extension should look for any files attempting to be downloaded matching a specific pattern in the name. If the extension finds that the name of the attempted download matches…
btald1331
  • 537
  • 3
  • 8
  • 23
0
votes
1 answer

Run multiple scripts in WebExtension background.js

I'm building my first Firefox Web Extension, and I am integrating with an API using OAuth. What happens is when the user clicks the icon in the toolbar, it gives them an authentication number to enter into a web page. They then do this, authorize my…
dpDesignz
  • 1,909
  • 10
  • 34
  • 70
0
votes
1 answer

Socket.IO connection disconnects when pop up is closed

I'm using Firefox 48 which is supposed to be stable for WebExtensions. I've connected my test app with Socket.IO. As soon as I close the pop up, the socket.IO connection breaks. Here is the code: manifest.json { "manifest_version": 2, …
Akash Agarwal
  • 2,326
  • 1
  • 27
  • 57
0
votes
0 answers

Getting storage from background page and returning it to a content-script

I'm trying to send a message to my extension's background page to get data from chrome.storage and return it to the content-script that asked for that data. I have to access chrome.storage through the background page because of compatibilty issues…
0
votes
2 answers

Unchecked lastError value: Error: No matching window - I get this error when trying to execute script with command in Firefox WebExtension

I have this part of code (everything is in background.js), which basically executes javascript in pages based on page's URL. It should work on toolbar button click, and Ctrl + Q command. I assign it to button click like this, and it…
kecman
  • 813
  • 3
  • 14
  • 34
0
votes
1 answer

Firefox WebExtention won't load

So, I tried to load my add-on using the about:debugging page in Firefox. But, it simply wouldn't load. Is there somewhere where an error would be logged that I could find it? Here is my manifest.JSON code: { "description": "Adds a stickfigure", …
Matthew
  • 378
  • 2
  • 7
0
votes
1 answer

Firefox WebExtension: Tab-Specific Storage

I am writing a Firefox WebExtension, using chrome.storage.local to save state, which I do when the extension is first selected. How can I limit the state to a specific tab? I would like each tab to have its own version of the data. Thanks
Manngo
  • 14,066
  • 10
  • 88
  • 110
0
votes
1 answer

How force WebExtension update on start browser?

How force (or request in installation) WebExtension update on start browser? In Firefox I need click in this option: In Opera I need click in this button: What I want to know is if there is any way to check using the API if there is any update or…
0
votes
0 answers

webExtentions - Can't get my html templete using ajax

this code works on chrome but not on firefox $.get(chrome.extension.getURL("about.html"), function(d) { me.aboutTpl = d }) does anyone have any clue? Thank you in advance!
0
votes
1 answer

Reload firefox addon when page is dinamically changed

I am trying to write my first Firefox add-on using WebExtensions (it is quite complex for a first extension). I need to process the results of all Google searches within a session (session = queries using the same Google page). I have the following…
1 2 3
99
100