firefox-addon-sdk

Porting Chrome extension to Firefox : equivalent to chrome.storage

强颜欢笑 提交于 2021-02-19 01:25:52
问题 I'm trying to port Chrome extension to Firefox and I would like to know what's the equivalent to chrome.storage.local.set and chrome.storage.local.get in Firefox add on sdk. I think, it's simple-storage . Here is my code : chrome.storage.local.set({'tokenFU': token}); [...] chrome.storage.local.get('tokenFU',function(result){ token=result.tokenFU; if(token && token != 'undefined'){ hideLog(); } else showLog(); }); Thanks in advance ! 回答1: Yes exactly, it is simple-storage. You can use it like

Porting Chrome extension to Firefox : equivalent to chrome.storage

被刻印的时光 ゝ 提交于 2021-02-19 01:25:47
问题 I'm trying to port Chrome extension to Firefox and I would like to know what's the equivalent to chrome.storage.local.set and chrome.storage.local.get in Firefox add on sdk. I think, it's simple-storage . Here is my code : chrome.storage.local.set({'tokenFU': token}); [...] chrome.storage.local.get('tokenFU',function(result){ token=result.tokenFU; if(token && token != 'undefined'){ hideLog(); } else showLog(); }); Thanks in advance ! 回答1: Yes exactly, it is simple-storage. You can use it like

Download and save file inside my extension folder in Firefox?

不羁的心 提交于 2021-01-28 04:48:00
问题 I would like to do the following from my firefox addon: a). Determine my addons folder location. b). Prompt the user to initiate a download. c). Download and save the download All the code examples available are for older API's and I have no clue on how to get them working for recent E10 (multi-process) code changes. 回答1: A - Get addons folder location var OSPath_addons = Services.dirsvc.get('XREUSysExt', Ci.nsIFile).path B - Trigger download with path with no user notification How to

Event Fired by YouTube When Video Page is Loaded

爱⌒轻易说出口 提交于 2021-01-28 00:08:56
问题 I am building a Firefox add-on that parses the URL when YouTube loads a video page (e.g. https://www.youtube.com/watch?v=6tOQsswD4Tc). Using Firefox's Add-on api for Tabs, I can't catch the event when the video page is finished loading. This might be due to YT's new asynchronous loading. Because if I hit F5, I can capture the event. I am using this code: tabs.on("ready", function(tab) { if(tab.url.search(/youtube\.com\/watch\?v=/)!=-1){ // do stuff } }); I tried changing it to 'ready', 'load'

Firefox addon development, how to change about:config setting

孤人 提交于 2021-01-27 10:34:01
问题 Hi I'm trying to develop a simple addon which opens a web page different from firefox default page in new tab. I want to change two of the default settings values in about:config, but it seems I cannot achieve this through my current configuration. I'm using the Add-On SDK recommended by firefox to develop the add-on.(creating a simple add-on using the SDK By looking into the about:config setting, I found that if I set "browser.newtab.url" to the web page url, and "moa.ntab.openInNewTab" from

How to install my .xpi on firefox android

青春壹個敷衍的年華 提交于 2021-01-21 03:59:44
问题 I work on a firefox addon using JPM. I want to install it on my android phone, i've run "jpm xpi" and copy xpi on my sdcard. When i browse to file://path/to/my/xpi in android firefox nothing happen. Same issue if i upload xpi on my server and browse to url. i've tested with google play firefox up to date version and nighty. where is my mistake? 回答1: Neither ES File Explorer nor X-plore worked for me (as per Trasd's comment). I saw the three Firefox's, but none of them triggered to install the

Firefox: How can I add/modify toolbars using the Add-on SDK (Jetpack)

∥☆過路亽.° 提交于 2020-06-24 05:44:35
问题 So I've looked over the documentation for the Add-on SDK several times now and no where can I see how to create toolbars or modify existing ones. They have a tutorial on creating add-on bar icons but thats not what I want. Does the Add-on SDK support this yet? If it does, can someone link me to an example/tutorial. 回答1: This works for me: var data = require("self").data; var {Cc, Ci} = require("chrome"); var mediator = Cc['@mozilla.org/appshell/window-mediator;1'].getService(Ci