w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories

including a js file in bootstrap.js firefox for android extension

Actually, content is supported in bootstrapped add-ons since quite some time (first in Gecko 8 and starting with Gecko 10, it will auto load manifests, IIRC). You can load js code modules from chrome://yourpackage/content/... not just from resource-URIs (since Gecko 4, IIRC). So there is nothing holding you back from using mozilla-style code modules. Also, a couple of add-ons manually add resource substitutions.

The stuff that Erik wrote uses a custom include function, implemented in the corresponding bootstrap.js using loadSubScript. That's an option, too. This scheme was invented when it wasn't yet possible to use js code modules from bootstrapped add-ons properly, e.g. because there was no Cu.unload yet.

Using content + Cu.import + Cu.unload is likely the easiest approach.

Real world example in one of my own add-ons (Desktop + Android) (the rest of the add-on is written using a custom commonjs-style require loader, so don't get distracted by that).

Categories : Android

Related to : including a js file in bootstrap.js firefox for android extension
FireFox. How to create a bootstrap extension?
Some chrome.manifest directives, e.g. chrome, skin, locale, are supported in bootstrapped extensions, so nothing special you need to do there. Overlays are not supported, however. You need add some code that will use the DOM APIs to manually insert and/or change elements you normally would have in your overlay. The "Further reading" section of the docs you already linked contains some stuff. Most

Categories : Javascript
Twitter Bootstrap in Firefox Extension
It looks like you're adding the bootstrap CSS via an overlay to browser.xul itself. The bootstrap styles and rules will clash with the browser.xul styles. That is not supported. You're free to use bootstrap in own (add-on) webpages, and maybe even windows, but you cannot use it in overlays.

Categories : CSS
firefox restartless bootstrap extension script not reloading
The AddonManager or more specifically the XPIProvider calls flushStartupCache but only when the add-on is uninstalled (incl. during up- and downgrades). However, the cache is not cleared when disabling or enabling an add-on in-session. Either put an equivalent method in your bootstrap.js that you call when shutdown (you should do this in release versions). Or just continue restating that damn br

Categories : Javascript
Why my firefox for android extension is deactivated on its own?
the error was caused by the tabSelect event listener, it was added in the wrong place, to make it work properly, I did this: //adding the listeners let addListener = function() { window.BrowserApp.deck.addEventListener("TabSelect", function(){ watchTab(window);}, false); window.BrowserApp.deck.addEventListener("pageshow", function(){ watchTab(window);}, false); win

Categories : Android
Detect address bar changes firefox android extension
I don't know why "load" is not working for you. I do know that "load" is sometimes not called, when loading a page from back/forward session history for example. To work around that, you could try using the "pageshow" event. That will be called for any page-change. For more info see: https://developer.mozilla.org/en-US/docs/Code_snippets/Mobile

Categories : Android
© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.