firefox-webextensions

Detect and handle a button click in the active HTML page

≡放荡痞女 提交于 2019-12-23 04:42:58
问题 Currently, I am creating a WebExtension for Firefox which displays a small div in the active HTML page on the active tab after 6 seconds (not the popup.html in browser_action !). I made a small example that shows a button in the div. My problem is that I don't know how to detect a click event of this button so I can kick off a function? In the moment I handle the event listener in content.js manifest.json: { "manifest_version": 2, "name": "Study06", "version": "1.0", "description": "My web

Firebase Auth with Firefox Web Extension Add On

和自甴很熟 提交于 2019-12-22 17:16:10
问题 I am creating a web extension both for chrome and firefox. I have integrated firebase UI and firebase auth. Google authentication works well on chrome extension. But on firefox extension/add-on it gives me the following error. This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled. I tried couple of things, but none worked. Tried adding moz-extension:/

change the button of a firefox-webextension into a textString

非 Y 不嫁゛ 提交于 2019-12-20 07:23:39
问题 Currently I am building a webextension on firefox 47. When you click a webextension button, a drop-down menu appears, from there I can navigate to other websites. The button that is appearing is the icon I specified in manifest.json . I wonder if there is any way to change the icon of the extension to a text-string containing the URL I am currently visiting, and changes every time I visit a new URL. 回答1: No, you can not directly change a browser action or page action icon into some long

Migrating chrome extension to web extension

☆樱花仙子☆ 提交于 2019-12-20 06:36:21
问题 I have been migrating my extension from chrome to web extension. Link of chrome extension is here Everything worked except I need tab information inside my angular application, there I am getting an error as TypeError: "browser.tabs is undefined" I can access the tab info inside background script and I can send that to the content script but not in the main application. My application opens in iframe, iframe points to the angular application. browser.tabs.getCurrent(function (tabs) { //these

BrowserExtension webRequest.onBeforeRequest return promise

心已入冬 提交于 2019-12-20 05:19:09
问题 I have the following in a Chrome and FireFox extension: function webListener(requestDetails) { var asyncCancel = new Promise((resolve, reject) => { resolve({ cancel : true }); }); return asyncCancel; } chrome.webRequest.onBeforeRequest.addListener( webListener, { urls: ["<all_urls>"], types: ["script"] }, ["blocking", "requestBody"] ); The problem is that it doesn't cancel the request. I read Chrome docs and Firefox docs and for Firefox it says it's based on Chrome's API and can return a

Firefox Add-On ID Conventions

别说谁变了你拦得住时间么 提交于 2019-12-20 03:53:08
问题 I'm writing a Firefox Add-On using the WebExtension API. Some of the APIs (such as browser.storage.sync) require an Add-On ID to be explicitly declared in the add-on's manifest.json file. The documentation for IDs states: The ID of the extension, which must be one of the following: GUID (Firefox 1.0) A string formatted like so: extensionname@example.org The latter format is significantly easier to generate and manipulate. Firefox 1.5 has checking to ensure that your id falls into one format

Firefox WebExtension: Check if MY extension exists

大城市里の小女人 提交于 2019-12-20 01:40:57
问题 Porting extension from Chrome into FF Followed this tutorial (which works fine in Chrome): http://www.codingscripts.com/check-whether-user-has-a-chrome-extension-installed/ Sending message from webpage to extension: In (web)pagescript.js this has: function IsExist(extensionId,callback){ chrome.runtime.sendMessage(extensionId, { message: "installed" }, function (reply) { if (reply) { callback(true); }else{ callback(false); } }); } IsExist("Your extension id",function(installed){ if(!installed)

What and where exactly are privileged code, chrome code, Gecko?

浪尽此生 提交于 2019-12-18 09:38:59
问题 In reading about the File API and wanting to write data directly from an indexedDB database to the client disk instead of first building and holding a large blob in RAM to download to disk, there are a few basic items I'm not understanding. In the MDN documents these two statements are found: In Gecko, privileged code can create File objects representing any local file without user interaction. If you want to use the DOM File API in chrome code, you can do so without restriction. In fact, you

How to execute a command line program in Firefox Webextensions?

大兔子大兔子 提交于 2019-12-18 06:25:09
问题 I'd like to run a command (exe somewhere on disk) with arguments in a simple WebExtensions addon, and possibly get its stdout. Is there a way to do so in WebExtensions, since the older APIs are being deprecated? 回答1: This blog post mentions how - https://blog.mozilla.org/addons/2016/06/09/webextensions-for-firefox-49/ Read the section runtime.connectNative . They say: runtime.connectNative This API allows you to communicate with other processes on the host’s operating system. It’s a commonly

How to execute a command line program in Firefox Webextensions?

我是研究僧i 提交于 2019-12-18 06:25:08
问题 I'd like to run a command (exe somewhere on disk) with arguments in a simple WebExtensions addon, and possibly get its stdout. Is there a way to do so in WebExtensions, since the older APIs are being deprecated? 回答1: This blog post mentions how - https://blog.mozilla.org/addons/2016/06/09/webextensions-for-firefox-49/ Read the section runtime.connectNative . They say: runtime.connectNative This API allows you to communicate with other processes on the host’s operating system. It’s a commonly