firefox-addon-sdk

Firefox SDK Sample Add On Exported XPI Action Button Doesn't Show Up

岁酱吖の 提交于 2019-12-19 10:09:19
问题 So I am following the documentation/tutorial here: https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Getting_started The add on shows up correctly when I use cfx run but when I export to xpi and install on my own installation of firefox no icon shows up in the top right corner. I have Firefox version 31 installed and have an unrelated add on installed and its icon shows up where it should in the top right corner but my add on does not. My add on shows up as enable / installed under

Inject a CSS file into a webpage via firefox extension

只愿长相守 提交于 2019-12-18 15:53:30
问题 I am writing a Firefox extension and I am using their Add-on SDK; but I can't figure out how to inject a local CSS file from the data folder into the webpage. It would be great if there were a way to do it via page_mod package. 回答1: As of Add-on SDK 1.14 there's experimental (API may change) support for this in the page-mod module: var pageMod = require("sdk/page-mod").PageMod({ include: "*", contentStyleFile: require("sdk/self").data.url("my-style.css") }); See Modifying Web Pages Based on

Firefox SDK simple-storage and Firefox Sync

这一生的挚爱 提交于 2019-12-18 12:01:20
问题 I'm currently converting a Chrome extension into a Firefox add-on and would appreciate to replicate the chrome.storage.sync feature. However, I cannot manage to find whether the data stored by a Firefox add-on using simple-storage will be automatically synced whenever a user of the add-on is signed into Firefox Sync. Given that all the pieces of data stored via the latter method can be found in the user profile, I presume it will... as long as the add-on is available at https://addons.mozilla

How to show 2 sdk/panels at the same time in Firefox Add-on SDK?

余生长醉 提交于 2019-12-18 09:36:41
问题 I know how to show a panel with position:button . But, when I try to show() an additional panel, the previous panel disappears. I don't want to disable auto hide. But I want to show 2 panels at the same time. So how do I show both at the same time? Code: function handleChange(state) { if (state.checked) { panelf.show({ position: { bottom: 20 } }); panel.show({ position: button }); } } 回答1: The Add-on SDK prevents more than one sdk/panel from being open at a time: You can not do exactly what

bring firefox window to the front using firefox addon

霸气de小男生 提交于 2019-12-18 07:19:30
问题 i want to focus firefox when a specific function run on my firefox addon .i created a .vbs file which can focus firefox [bring to the top] and then i execute that exe using nsIProcess .like this file.initWithPath("C:\\Users\\madhawax\\Documents\\focusFirefox.vbs"); var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); process.init(file); process.run(false, args, args.length); it works fine.but now for some reason i want to focus Firefox directly from addon code

Security Error when trying to load content from resource in a Firefox Addon (SDK)

一笑奈何 提交于 2019-12-18 05:20:52
问题 I am creating a firefox addon using the SDK. My goal is simple, to intercept a specific iframe and load my own HTML page (packaged as a resource with my addon) instead of the content that was requested originally. So far I have the following code: var httpRequestObserver = { observe: function(subject, topic, data) { var httpChannel, requestURL; if (topic == "http-on-modify-request") { httpChannel = subject.QueryInterface(Ci.nsIHttpChannel); requestURL = httpChannel.URI.spec; var newRequestURL

Concurrency with Firefox add-on script and content script

我与影子孤独终老i 提交于 2019-12-18 03:49:12
问题 As I was writing a Firefox add-on using the Add-on SDK, I noticed that the add-on code and the content script code block the execution of each other. Furthermore, the add-on code seems even to block the interaction with other Firefox windows (not just tabs). What is the concurrency/process model of Firefox add-ons? Is it possible to run add-on code and content script code concurrently without cooperative multithreading (a la timers)? How many times is the add-on code loaded? Once per window?

Firefox add-on : extension icon not showing

社会主义新天地 提交于 2019-12-17 20:18:40
问题 I'm working on developing a Firefox add-on using the Add-on SDK . My extension is working fine when using SDK, but when I create the .xpi file to add it manually to the browser, it does not show the extension icon. I tried to change the icon path in the package.json file, but still it didn't shows the icon. package.json file: {... "icon" : "Phone-icon48.png", "icon64" : "Phone-icon64.png", ...} Widget panel used to display icon: WidgetPackage.Widget({ label: "Phone Dial", id: "phone_dial",

Firefox add-on SDK: Get http response headers

微笑、不失礼 提交于 2019-12-17 19:29:04
问题 I'm new to add-on development and I've been struggling with this issue for a while now. There are some questions here that are somehow related but they haven't helped me to find a solution yet. So, I'm developing a Firefox add-on that reads one particular header when any web page that is loaded in any tab in the browser. I'm able to observer tab loads but I don't think there is a way to read http headers inside the following (simple) code, only url. Please correct me if I'm wrong. var tabs =

Firefox Addon SDK: Loading addon file into iframe

老子叫甜甜 提交于 2019-12-17 18:43:50
问题 I want to load a resource:// link, respectively a local file from my Firefox addon into an iframe in a web page. The reason is, that the resource should be visually embedded into the web page while not giving the website access to it's DOM for security reasons. The issue has been discussed in various places in the past, e.g. here (without solution): https://bugzilla.mozilla.org/show_bug.cgi?id=792479 As most of the postings are rather old, I want to ask, if in the meantime there are any new