firefox-webextensions

no scrollbars in options popup ported from Chrome in firefox webextension

走远了吗. 提交于 2019-12-17 21:37:23
问题 I'm porting chrome extension to Firefox and I'm testing on Nightly 51a.. version. When I click the popup options icons it opens and scrollbars appear and after half a second those disappear. How to correct this? At the moment I've given a hyperlink in the top in the optins popup with this code which when clicked opens full view html in a new tab and this works just fine: <a style="font-size:1.5em;" href="options.html" target="_blank">Open Full Window</a> 回答1: The popup that is being shown for

Calling webpage JavaScript methods from browser extension

≯℡__Kan透↙ 提交于 2019-12-17 14:57:15
问题 I am developing an firefox extension using webExtensions that would help me ease my work with the scenario below. I have to click around 50-60 buttons on the site that update the task status. On click of this button, the web page is calling the webpage's updTask(id) JavaScript function that is then making a web-service call to update the task. I am not able to do this from my content script using the code below: manifest.json : "permissions": [ "activeTab", "cross-domain-content": ["http:/

chrome.tabs.executeScript(): How to get result of content script?

天大地大妈咪最大 提交于 2019-12-17 09:57:42
问题 According to the documentation for chrome.tabs.executeScript (MDN), the callback function accepts an "array of any result" result set from the execution of the script(s). How exactly do you use this to get results? All of my attempts end up with undefined being passed to the callback. I have tried returning a value at the end of my content script, which threw a Uncaught SyntaxError: Illegal return statement . I tried using the optional code object argument {code: "return "Hello";} with no

How to create a global hotkey for opening the “browserAction” popup in Firefox (WebExtensions)?

南笙酒味 提交于 2019-12-17 06:51:15
问题 It seems Chrome doesn't have an API to open the popup, but has a dedicated system for doing it with a hotkey: _execute_browser_action key in commands . The special functionality of _execute_browser_action in commands is not supported(1) by Firefox. The type of popup I care about is browserAction , not pageAction . How can I have the browserAction popup open when a keyboard shortcut/hotkey combination is pressed? 回答1: Available natively in Firefox versions >= 52 This functionality will be

TypeError: [API] is undefined in content script or Why can't I do this in a content script?

孤街醉人 提交于 2019-12-17 04:34:22
问题 I was trying to write a simple extension in Firefox wherein I modify the X-Frame-Allow header. I looked at the documentation briefly and I see that they support webRequest.onHeadersReceived.addListener() . However, I'm unable to get my code to run when the headers are received. manifest.json { "manifest_version": 2, "name": "xframeoptions", "version": "1.0", "description": "Set X-Frame-Options to ALLOW", "icons": { "48": "icons/icon.png" }, "permissions": [ "webRequest", "webRequestBlocking",

Communicate between scripts in the background context (background script, browser action, page action, options page, etc.)

元气小坏坏 提交于 2019-12-17 02:26:30
问题 I am running into an issue sending data from my background script to the script for my pageAction . My content script adds an <iframe /> and the JavaScript in the <iframe /> is receiving the data from my background script, but it does not seem to be retrieved in my pageAction . In my background script I have something like: chrome.tabs.sendMessage(senderTab.tab.id, { foo:bar }); where senderTab.tab.id is the "sender" in onMessage Listener in my background script. In the JavaScript loaded by

Firefox 57+ loading of unsigned webextensions [duplicate]

梦想的初衷 提交于 2019-12-14 00:05:37
问题 This question already has answers here : Firefox extension .xpi file structure: description, contents, creation, and installation (2 answers) Closed 2 years ago . My understanding is that Mozilla: will not allow installation of unsigned webextensions into the regular version of Firefox 57+. will allow installation of unsigned webextensions into the Developer channel of Firefox 57+. will allow installation of unsigned webextensions into the Nightly channel of Firefox 57+ for now . Is that

Is there an API for Mozilla for updating signed addons?

梦想的初衷 提交于 2019-12-13 17:18:16
问题 I have a signed addon that I use personally but would like to experiment with making it distributable via AMO. I have already uploaded the initial version through the Developer Hub, and I'm now hoping to be able to include an automated release through a CI pipeline. I've been investigating how to do this for a while now, having found this article and API doc but haven't had much luck. I'm definitely able to connect with my JWT properly, as I get either a 301 (I assume this is because the API

Add context menu in bookmark menu

╄→гoц情女王★ 提交于 2019-12-13 14:25:10
问题 I am trying to add a context menu item in the bookmark menu of Firefox (with a WebExtension). I read the contextMenus.create() article and the example works for me. There are a bunch of context types, but none seems to work in the bookmark menu. Is this not possible? 回答1: What you desire is not currently possible in a WebExtension. In general, if there is capability that you desire in WebExtensions which does not already exist, you can: File a Request For Enhancement (a bug) requesting the

How detect a specific url in browser and get html page associate in Javascript?

我们两清 提交于 2019-12-13 08:45:18
问题 I need to modifiy a html page with javascript (fill a field). I have a specific url but i do not know how to listen when the browser is on the right url and get the html code associate. I do it with a webextension, so the javascript has to check url in the web browser and get html from here. Thank you for helping me 回答1: When I type firefox extension tutorial into Google, the first hit is this tutorial from MDN. Very close to the top of it is has this code example: Now create a new file