Questions tagged [firefox-addon-restartless]

A restartless or bootstrapped Firefox add-on is an add-on that does not require restarting the browser in order to install, enable, disable or remove it. Restartless add-ons, however, have some limitations, such as no support for XUL overlays.

A restartless or bootstrapped Firefox add-on is an add-on that does not require restarting the browser in order to install, enable, disable or remove it. Restartless add-ons, however, have some limitations, such as no support for XUL overlays.

Some add-on types, such as dictionaries, are always restartless.

81 questions
118
votes
9 answers

Convert URL to File or Blob for FileReader.readAsDataURL

Reference: FileReader.readAsDataURL Considering the following example: function previewFile(file) { var reader = new FileReader(); reader.onloadend = function () { console.log(reader.result); } reader.readAsDataURL(file); } It…
erosman
  • 7,094
  • 7
  • 27
  • 46
4
votes
0 answers

Why does my bootstrapped Firefox extension cause errors?

I'm new to Firefox extension development. So I've been experimenting a bit. I'm currently trying to create a bootstrapped extension with nothing more but the bare minimum requirements: only an install.rdf and the bootstrap.js. For the moment this…
4
votes
4 answers

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

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…
erosman
  • 7,094
  • 7
  • 27
  • 46
4
votes
1 answer

is it okay to use loadOverlay() in a restartless addon?

Firefox addon. I'm porting an existing addon to a restartless one. I have a panel with a lot of UI elements (mostly boxes/description and images) in it, and it is very convenient for me to define the panel elements in an XUL overlay file. I will…
4
votes
1 answer

How to set an XUL key dynamically and securely?

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…
ws_e_c421
  • 1,043
  • 10
  • 20
3
votes
1 answer

Firefox Addon: bootstrap.js mit sdk/page-mod for versions < 38.0

tl;dr: We created a firefox addon using the Addon SDK. Since compiling the addon is one step in a larger build system (we also compile for chrome), our build system packages the xpi manually and does not use jpm. However, we used the contents of a…
3
votes
1 answer

firefox startScroll and sendAsyncMessage

In recent version of Firefox 31+ the startScroll(e) function was changed and should be called with startScroll(scrolldir, screenX, screenY) Diff of the…
3
votes
1 answer

How do you convert a local URI to path?

How do you convert a local (filesystem) URI to path? It can be done with nsIIOService + newURI() + QueryInterface(Components.interfaces.nsIFileURL) + file.path but that seems like a long way. Is there a shorter way? Here is an example code: var…
erosman
  • 7,094
  • 7
  • 27
  • 46
3
votes
1 answer

XMLHttpRequest POST and open target page in new window/tab

How do you emulate Form's 'POST' action with target="_blank" in XMLHttpRequest? (ie post data and open target page in a new tab)
erosman
  • 7,094
  • 7
  • 27
  • 46
3
votes
1 answer

Firefox Bootstrapped Extensions: Namespace

I am looking into bootstrapped extensions. Looking at the code of some of those extensions, I see a lot of variables, constants & functions declarations. Are they all declared in window object? Isn't there an issue with namespace pollution/clash? I…
erosman
  • 7,094
  • 7
  • 27
  • 46
2
votes
3 answers

How to develop legacy Firefox add-ons in the future?

Firefox is moving towards the WebExtensions standard which promises improvements in stability, cross-browser compatibility, and more security. At the same time they're gradually dropping support for legacy add-ons (bootstrapped extensions, add-on…
2
votes
1 answer

Download and save file inside my extension folder in Firefox?

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…
2
votes
2 answers

In a Firefox restartless add-on, how do I run code when a new window opens (listen for window open)?

I am starting to build a restartless Firefox add-on and I am having trouble setting up the bootstrap.js. Everyone seems to agree that the core of a bootstrap.js is pretty much boilerplate code, along these lines: const Cc = Components.classes; const…
2
votes
1 answer

Add an option to the Download File dialog?

I'm trying to write an addon for a certain file type, and I would like to add an "Send to MyAddonName" option to the download file dialog, under the "Open with" and "Save file" options. Not referring to the Download Manager. Is there any way to…
2
votes
3 answers

Is it possible to get the window object from the event in handleEvent?

As in the question... how to get the window object from an event fired in the window scope for example: handleEvent: function(event) { // is window object available here and can we get it from event } I can get the window object from other APIs.…
erosman
  • 7,094
  • 7
  • 27
  • 46
1
2 3 4 5 6