firefox-webextensions

Firefox add-on: (Native app + Content Script + Background script) messaging

我的未来我决定 提交于 2019-12-13 07:38:52
问题 I am working on a simple add-on that can parse the text of a page, example twitter.com, and then send it an external script and receive the response. The current workflow that I have is like this: Connect to background script from content script. Then Connect to native App from background script and receive the response Format and pass the response to the content script which can finally make changes to the DOM. I am receiving the following error when connecting to background script. Error:

firefox webextension alternative to addon clipboard sdk for copying images

笑着哭i 提交于 2019-12-13 00:02:39
问题 I am trying to develop a Firefox extension which involves copying an image to the clipboard. In the past, it appears that this was accomplished using the clipboard addon sdk. However, this is being deprecated so I need to find another way to copy an image to the clipboard. The docs mentioned using document.execCommand('copy') but I cant get that to work for copying images. From searching the web it seems that its normally not possible to copy an image to the clipboard in Javascript but I was

Removing a Firefox web extension does not clear chrome.storage.local

大城市里の小女人 提交于 2019-12-12 18:57:28
问题 Looks like chrome.storage.local is continuing to store any data even if an extension was uninstalled. This behaviour is not observed in Chrome, only in Firefox. Any ideas about how to fix it? 回答1: This was bug 1213990, which is fixed in Firefox 51. 来源: https://stackoverflow.com/questions/39117890/removing-a-firefox-web-extension-does-not-clear-chrome-storage-local

Firefox / Chrome / MS Edge extensions using chrome.* or browser.*

旧城冷巷雨未停 提交于 2019-12-12 16:15:57
问题 So I couldn't find anything that talked about using chrome.* or browser.* specifically. In some of the WebExtension examples it uses browser.* ( browser.runtime.getManifest(); ) https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/runtime/getManifest, and in others it uses chrome.* ( chrome.notifications.create ), https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/notifications. I'm not entirely sure what's the difference. Is it contextual? Both chrome.* and browser.* are

How to check if a Firefox WebExtension is installed or not with page JavaScript?

我只是一个虾纸丫 提交于 2019-12-12 13:34:08
问题 I have developed a WebExtension for Firefox and my website works with the extension as a prerequisite. I need to check programmatically whether the extension is installed or not and if not ask the user to install it. I am not able to find a way how to check this operation of whether my extension is already installed in the user's browser. Editor note: Methods available in Firefox differ from those available in Chrome, so this question is not a duplicate. 回答1: Important note to begin with: A

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

…衆ロ難τιáo~ 提交于 2019-12-12 10:38:21
问题 (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 JavaScript library file that doesn't match any versions known to us. We require all add-ons to use unmodified release versions. We accept JQuery/JQuery-UI libraries downloaded from 'ajax.googleapis.com', 'jquery.com' or 'jqueryui.com'; and used without

What are the possible values for the error property in a webRequest.onErrorOccurred listener?

回眸只為那壹抹淺笑 提交于 2019-12-12 10:23:57
问题 My interest is handling sites only during heavy load times for autofills to work. For example, when a sale opens and the site is swarmed, it sometimes crashes. I need to catch the site errors, so I can reload the page from the background script. As described in Chrome Extensions: Background Script Catch Network and HTTP Errors, we can get the page load errors. Page load error can be due to network issues, site issues, DNS issues, and also due to site overload issues. All I want is to reload

Send data between content-script/background

早过忘川 提交于 2019-12-12 10:16:04
问题 This is my current project: manifest.json : { "name": "Sample Commands Extension", "description": "Press Ctrl+Shift+U to send an event (Command+Shift+U on a Mac).", "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/commands", "manifest_version": 2, "version": "1.0", "background": { "scripts": ["background.js"] }, "commands": { "toggle-feature": { "suggested_key": { "default": "Alt+Shift+U" }, "description": "Send a 'toggle-feature' event to the extension" } } }

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

扶醉桌前 提交于 2019-12-12 06:38:05
问题 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 user-generated event handler copyTextToClipboard() function was taken from Copy to Clipboard in Chrome Extension manifest.js { "description": "Test for JSON Notifiaction + Clipboard Copy", "manifest_version": 2, "name": "Test3", "version": "1.0",

webNavigation.onDOMContentLoaded URL filter does not match DNS error URL

只愿长相守 提交于 2019-12-12 05:28:34
问题 Reference to the answer for my previous question here. Briefly: When an error occurs in a navigation webRequest (e.g. a DNS lookup error), the URL to which the tab navigates is available in the url property of webNavigation.onDOMContentLoaded event for the navigation to the displayed error page, but the actual URL displayed (i.e. the about:neterror URL) is not available through other means. I want to follow the answer's method for getting the error page URL. I wrote this example code where I