firefox-addon-restartless

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

XMLHttpRequest POST formData to a new tab [duplicate]

女生的网名这么多〃 提交于 2020-01-14 06:09:52
问题 This question already has an answer here : How to pass formData to postData in loadOneTab? (1 answer) Closed 5 years ago . Since, loadOneTab() is not available for formData , How can formData be posted to a new tab? How can the above new tab foreground/background status be set? Just a smaple example from Using FormData Objects: var formData = new FormData(); formData.append("username", "Groucho"); formData.append("accountnum", 123456); // number 123456 is immediately converted to string

How to set an XUL key dynamically and securely?

北慕城南 提交于 2020-01-03 18:33:36
问题 I am trying to create a key element dynamically for my bootstrapped add-on. Currently, I create a keyset element and append it to document.getElementById('mainKeyset').parentNode with appendChild() and then create the key element ( myKey ) and append it to the keyset . I set the key 's id , modifiers , and key attributes and then do myKey.addEventListener('command', function() {myFunction()}); to add a function to the key . After this, I can successfully call myFunction() by doing myKey

Firefox addon could not convert to bootstrap

狂风中的少年 提交于 2019-12-25 03:39:11
问题 Below I have the code for xul addon which works expectedly. i.e. shows username and password input at the browser startup and whenever the topic is http-on-examine-response it validates and write in specified file. But when I try to convert it to a bootstrapped extension it won't even show the username password input at the browser startup and nothing is showing in the console when I compile and run. I couldn't figure out the wrong thing after I changed the components... to Cu/Cc/etc. I

How to know loaded window is Firefox Electrolysis Window

こ雲淡風輕ζ 提交于 2019-12-25 03:29:28
问题 I want to code a functionality for Firefox Electrolysis window. But how can I know loaded window is Firefox Electrolysis window but not the normal Firefox window? var WindowListener = { setupBrowserUI: function(window) { // }, tearDownBrowserUI: function(window) { }, // nsIWindowMediatorListener functions onOpenWindow: function(xulWindow) { var domWindow = xulWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIDOMWindow); // Wait for it to

How to know loaded window is Firefox Electrolysis Window

别来无恙 提交于 2019-12-25 03:29:04
问题 I want to code a functionality for Firefox Electrolysis window. But how can I know loaded window is Firefox Electrolysis window but not the normal Firefox window? var WindowListener = { setupBrowserUI: function(window) { // }, tearDownBrowserUI: function(window) { }, // nsIWindowMediatorListener functions onOpenWindow: function(xulWindow) { var domWindow = xulWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIDOMWindow); // Wait for it to

Intercept download link click and prevent default download dialog

狂风中的少年 提交于 2019-12-25 02:59:28
问题 We have built a download manager desktop application for windows. Now we want to add a feature that intercepts download links and adds them to the application. We think we should write an addon for each browser starting from Firefox. To intercepts download links for a download manager, is writing addons the best choice? How can we do that? Things we've tried so far: - Using Downloads.jsm to observe new downloads, then cancel them => We don't want the user to interact with Firefox's download

Intercept download link click and prevent default download dialog

这一生的挚爱 提交于 2019-12-25 02:59:24
问题 We have built a download manager desktop application for windows. Now we want to add a feature that intercepts download links and adds them to the application. We think we should write an addon for each browser starting from Firefox. To intercepts download links for a download manager, is writing addons the best choice? How can we do that? Things we've tried so far: - Using Downloads.jsm to observe new downloads, then cancel them => We don't want the user to interact with Firefox's download

Passing 'this' and argument to addEventListener function without using bind

不打扰是莪最后的温柔 提交于 2019-12-18 17:34:10
问题 Subsequent to removeEventListener in bootstrapped addon not working when addon disabled, I am exploring other possibilities. Beside using bind() and caching the bound function, is there a way to use 'this' and pass argument? // works fine but can't pass argeement contextMenu.addEventListener('popupshowing', this.contextPopupShowing, false); // passes the argument but 'this' is no longer available contextMenu.addEventListener('popupshowing', function(){this.contextPopupShowing(window);}, false

firefox restartless bootstrap extension script not reloading

喜夏-厌秋 提交于 2019-12-13 01:27:53
问题 I am unable to get a source code modification reflected in the firefox extension without restarting firefox. I believe this should be possible when using the bootstrap approach. Here is the source code: bootstrap.js var GOOGBAR_MODULES = [ "resource://googbar/loader.js"]; function startup(params, reason) { var res = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler); var modulesURI = Services.io.newURI(__SCRIPT_URI_SPEC__ + "/../content/", null, null); res