firefox-addon,firefox-addon-sdk,firefox-addon-restartless
This is how simple storage works. It creates a folder in your ProfD folder which is your profile directory: https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/simple-storage.js#L188 let storeFile = Cc["@mozilla.org/file/directory_service;1"]. getService(Ci.nsIProperties). get("ProfD", Ci.nsIFile); storeFile.append(JETPACK_DIR_BASENAME); storeFile.append(jpSelf.id); storeFile.append("simple-storage"); file.mkpath(storeFile.path); storeFile.append("store.json"); return storeFile.path; The exact location of the file made is in a your...
javascript,firefox-addon,firefox-addon-restartless
Bootstrapped/restartless extensions do NOT automagically run in the context of (a) window(s). bootstrap.js runs in an own context, only once per application instance, not in the browser window. You'll need to: Manually enumerate all existing browser windows. Listen for new browser windows as they are opened. And then manipulate the...
javascript,firefox,firefox-addon,firefox-addon-restartless
The bootstrap.js scope Are they all declared in window object? Isn't there an issue with namespace pollution/clash? ... I have noticed that all bootstrapped.js use the same/standard function names. Does that mean that bootstrapped extensions are sandboxed or their scope enclosed? To expand on the @paa comment: bootstrap.js does indeed...
firefox-addon,firefox-addon-restartless
How an add-on performs mostly depends on the actual implementation (what the add-on does and how) and data it keeps around. As such you cannot really just compare performance of overlay vs. restartless add-ons. I converted add-ons from overlay to restartless ones that performed better afterwards, because I optimized some...
javascript,firefox,firefox-addon,firefox-addon-sdk,firefox-addon-restartless
Not disallowed. Perfectly fine. Do it with a features option of alwaysLowered I think. Full list of features found here: https://developer.mozilla.org/en-US/docs/Web/API/window.open#Position_and_size_features var sa = Cc["@mozilla.org/supports-array;1"].createInstance(Ci.nsISupportsArray); var wuri = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString); wuri.data = 'about:blank'; sa.AppendElement(wuri); let features = "chrome,dialog=no,alwaysLowered"; var wantTabs = false; if (wantTabs) { features += ',all'; } /*var...
javascript,firefox,garbage-collection,firefox-addon-restartless
Please note that restartless addon must do these on 'disable' or 'uninstall'. The addon must remove event listeners & observers. It is not important (and not done) to delete namespace which is a variable and will be done by GC. Furthermore, addon must revert (not reset) any changed preferences outside...
javascript,firefox,firefox-addon,firefox-addon-restartless
If the external (bound via ctypes) API isn't itself asyncrhonous, by definition you're not going to be able to call it asynchronously in JavaScript. The easiest workaround is to use some kind of WebWorker to call the API in a background thread. Seeing as you need to do some privileged...