firefox-addon-sdk

Firefox SDK extension - JPM error [closed]

痞子三分冷 提交于 2020-01-25 21:06:06
问题 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 3 years ago . Since last night, i'm getting this error out of the blue, when trying to communicate with a content script, after the "ready" event is fired in the tab that loads the page to which the script is being attached to. console.error: JPM [error] Message: TypeError: this.sandbox is undefined Stack: receive@resource:/

Using positioning 'Panel' in new Jetpack API

丶灬走出姿态 提交于 2020-01-23 13:28:20
问题 I'm now using the new version of the Jetpack API of which allows you to create addons for Firefox using a JS framework. The 'panel' object is easy to use - but I'm struggling to find a way to position it. The documentation simply states (Jetpack Panel API) panel.show(anchor) DomElement But I'd like to position the panel in the bottom right corner of the window - How do I do this - and where can I find some more documentation about it. 回答1: The only way I'm aware of to be able to position a

My Firefox extension to inject CSS wont work

一世执手 提交于 2020-01-23 12:24:32
问题 I am busy developing a firefox extension. I am using the Add-on Builder What it will do: Get an ID from a PHP page (XMLHttpRequest) Call another function and send that ID with it That function inserts CSS with a link tag created by javascript My Problem: It won't work. If I alert the currenttheme variable, nothing happens. So the XMLHttpRequest doesn't seem to work. My code: main.js: var Widget = require("widget").Widget; var tabs = require('tabs'); exports.main = function() { var pageMod =

firefox addon sdk page-worker blocks main thread

末鹿安然 提交于 2020-01-17 03:59:16
问题 I'm crawling about 20 Web sites in the background, when a page loads, within the addon script, with the page-worker. Unfortunately the browser freezes, unpredictable during that time. I tried to use timers.setTimeout(..., 0-400ms) and also tried the example from the wiki function executeSoon(aFunc) { var tm = Cc["@mozilla.org/thread-manager;1"] .getService(Ci.nsIThreadManager); tm.mainThread.dispatch({ run: function () { aFunc(); } }, Ci.nsIThread.DISPATCH_NORMAL); } but this also freezes the

How do I add an icon to my Firefox Add-On with addon-SDK?

偶尔善良 提交于 2020-01-16 23:48:46
问题 I would like to add another icon to the Firefox addon I develop than the standard Icon: I use the firefox-addon-sdk jetpack to develop it 回答1: You have to add it to your package.json . That file is initially generated in your add-on's root directory the first time you run cfx init . This will add an icon (assuming the add-on's directory is "my-addon"):` { "name": "my-addon", "title": "my-addon", "id": "jid1-1FERGV45e4f4f", "description": "a basic add-on", "icon": "icon.png", "icon64": "icon64

Get value of an input element on a firefox addon

泪湿孤枕 提交于 2020-01-16 17:26:50
问题 How i can fetch the value of this input element in my main.js: <input type="hidden" value="12124054" id="ctl00_cphContent_hdnID" name="ctl00$cphContent$hdnID"> I tried var id = document.getElementById("ctl00_cphContent_hdnPlayerID").value; and contentWindow.document.getElementById("ctl00_cphContent_hdnPlayerID").focus(); but i am getting errors that document and contentWindows are unidentified :( 回答1: You need to get the value from the page using a content script and then send the value to

document.caretPositionFromPoint grabbing too high

你。 提交于 2020-01-15 12:26:14
问题 I'm working on an update to my "jump-to-anchor" add-on which is a Firefox add-on to let you right-click somewhere in a doc to (hopefully) get the closest anchor above the click point. After submitting the add-on, I realized I could improve the algorithm by finding the actual text node where clicked, and look up from there (instead of the first children of the current clicked element). However, in my tests (against a page I happened to be reading, http://tools.ietf.org/html/rfc5323#section-2.3

What are Mozilla Labs' Jetpack IO capabilities?

蹲街弑〆低调 提交于 2020-01-15 06:35:50
问题 Are you able to access your file-system, using Jetpack, and do operations such as creating or reading files or saving images? 回答1: The Add-on SDK 1.0b5 (the most recent version at this moment) has a file module for this purpose. Note that it's not a high-level module, meaning it can change incompatibly in future Add-on SDK versions. [the original answer from 2010/01] No, there's no jetpack-specific APIs for this yet, note the red link on MDC and the lack of a "JEP" about this. You're not

Firefox Add-on SDK: how to make Panel transparent

对着背影说爱祢 提交于 2020-01-14 13:53:09
问题 Developing a Firefox Add-on. Anyone can please help to figure out how to make a Panel transparent. Here is the code to show a panel: var panel = require("sdk/panel").Panel({ width: 570, height: 250, contentURL: require("sdk/self").data.url("test.html") }); panel.show(); 回答1: I found a solution, but it isn't pretty since sdk/panel.js doesn't seem to expose the raw Panel object in order to tweak/extend or compose a another Panel from the existing one. Here goes: (1) Get the source for sdk/panel

Communicating with a content script in a Firefox extension

社会主义新天地 提交于 2020-01-14 06:15:08
问题 I have a Chrome extension which does the following action: chrome.extension.sendRequest({action: "store", working_tab: tab.id, store_text: text}); And Correspondingly, the listener is: chrome.extension.onRequest.addListener(function(request, sender, sendResponse) { if (request.action == "store") { storeObject.process(); sendResponse({}); } } Can you please guide me, what would be the corresponding code for a Firefox Extension? I followed the Firefox Extension tutorial but that didn't help me