firefox-webextensions

Modifying a web page from Firefox add-on (Webextension API): how to access the elements properly?

て烟熏妆下的殇ゞ 提交于 2019-12-08 11:48:44
问题 I am migrating my old Firefox extenstion to WebExtenstion API. Here is what my extension does: add a button to the toolbar specify four settings in Options when a user clicks a button, I verify the URL. If the URL matches one of three possible values, I use the values from the option page to fill some input elements on the page and click a form button. So here is my manifest.json: { "manifest_version": 2, "name": "Login", "version": "3.0", "description": "Login to myinterfaces", "homepage_url

Installation Error: “This add-on cannot be installed because it appears to be corrupted” [closed]

有些话、适合烂在心里 提交于 2019-12-08 04:30:46
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I am currently trying to learn how to develop Firefox add-ons, but for my misfortune, I faced a problem before I even start doing so. I downloaded the demo add-on provided by the Firefox developer team which is called "Borderify" and can be seen here: GitHub. After that, I opened WinRar, and converted the folder

webextension: Why does the browser add a trailing slash to the requested URL?

拜拜、爱过 提交于 2019-12-08 03:08:06
问题 When I make a request to http://www.example.com , why does I see http://www.example.com/ in the webRequest.onBeforeRequestListener? For example: chrome.webRequest.onBeforeRequest.addListener( details => console.log('Sending request to', details.url), { urls: ['<all_urls>'] }); fetch('http://www.example.com'); will print Sending request to http://www.example.com/ That is consistent with the request URL shown in the network request monitor. For example, if I take it and convert it to a curl

FireFox Addon WebExtension API - open local file / application

有些话、适合烂在心里 提交于 2019-12-08 01:50:35
问题 I would like to write a mozilla firefox extension by using the WebExtension API. I couldn´t find a source code using the WebExtension API for my purposes. var {Cc, Ci} = require("chrome"); // Low-Level API Imports (For Launcher) var prefs = require("sdk/simple-prefs").prefs; var app = "C:\\abcd\\test.exe"; var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile); file.initWithPath(app); var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); if (file.exists

Installation Error: “This add-on cannot be installed because it appears to be corrupted” [closed]

落爺英雄遲暮 提交于 2019-12-07 09:47:29
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I am currently trying to learn how to develop Firefox add-ons, but for my misfortune, I faced a problem before I even start doing so. I downloaded the demo add-on provided by the Firefox developer team which is called "Borderify" and can be seen here: GitHub . After that, I opened WinRar, and converted the folder to a .XPI file. However, when I try to install it manually on my Firefox browser I got this message

Get add-on id of extensions in Firefox

一世执手 提交于 2019-12-07 05:11:07
问题 I want to open extensions in browser tab as a normal html page so that I can automate it using selenium WebDriver. In firefox this can be done using link like this - moz-extension://f1b30486-cd88-4319-bbb5-d5e387103414/popup.html . But the problem is that I am not finding a way in Firefox by which I can locate the id for all extensions**. The id used above is obtained when the extension is installed and a page with url moz-extension://f1b30486-cd88-4319-bbb5-d5e387103414/congratulations.html

Firefox Extension API - permissions.request may only be called from a user input handler?

霸气de小男生 提交于 2019-12-06 13:51:48
问题 I'm using the Firefox permissions API documented HERE I'm having a problem with the request method, wherein all of my permissions requests result in: Error: permissions.request may only be called from a user input handler You can produce this in firefox by debugging any addon or extension and entering browser.permissions.request({origins: ["https://google.com/*"]}) into the console. I find it hard to swallow that a permissions request must always have a user input event callback in the parent

FireFox Addon WebExtension API - open local file / application

落爺英雄遲暮 提交于 2019-12-06 11:33:54
I would like to write a mozilla firefox extension by using the WebExtension API. I couldn´t find a source code using the WebExtension API for my purposes. var {Cc, Ci} = require("chrome"); // Low-Level API Imports (For Launcher) var prefs = require("sdk/simple-prefs").prefs; var app = "C:\\abcd\\test.exe"; var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile); file.initWithPath(app); var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); if (file.exists()) { process.init(file); var params = prefs["param"]; var args = ["" + params + ""]; process.run(false

Firebase Auth with Firefox Web Extension Add On

和自甴很熟 提交于 2019-12-06 10:34:18
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://dhhjsbhjbajnsabjajbasjbhjasjh in authoirsed domain in firebase auth console. Validation error. Tried both pop up and redirect

OnBeforeRequest URL redirect in Firefox Addon (Conversion from Chrome Extension)

自闭症网瘾萝莉.ら 提交于 2019-12-06 08:23:59
问题 I want to convert a Chrome extension of mine to Firefox. So far so good, except I had an url redirect in webRequest.onBeforeRequest in the Chrome extension, which is not allowed in Firefox WebExtensions. Now I am unsure how to implement this in Firefox. In the Chrome background.js it looked something like this: chrome.webRequest.onBeforeRequest.addListener( function(details) { console.log('onBeforeRequest'); var returnuri; returnuri = details.url; if ((details.url.indexOf("/malicious/") > -1)