It's known fact that Firefox has no permissions mechanism for extensions. So nobody know (including Firefox) what extension actually doing, it can do everything that it wants (of course within api).
The question is about extensions priority. Imagine that user installs several New tab extensions. He restarts Firefox, what New tab will work? I was trying to figure it out.
Firefox data is stored in C:\Users\UserName\AppData\Roaming\Mozilla\Firefox\Profiles\Whatever.default, also there are extensions directory which contains extensions data actually. Some data about all installed extensions is stored in addons.json and extensions.json.
First of all, installation order doesn't play any role. Extension that was installed earlier can "beat" extension that was installed later. And vice versa.
Also I was trying to enable/disable extensions, look at last changed files and compare them. Nothing usefefull. Just boolean flags, that extension is enabled or disabled and is it enabled or disabled by user.
Also I tried to change extensions order in addons.json and extensions.json, but it seems it may not affect anything.
Most of extensions, that use "low api" use similar code for new tab:
var newtab = {
init: function ()
{
gBrowser.addEventListener("NewTab", newtab.opentab, false);
},
opentab: function (aEvent)
{
// action here
}
}
window.addEventListener( "load", newtab.init, false);
Some references:
Firefox documentation. On page load. "Low" api style.
Firefox documentation. sdk/tabs module. "High" api style.
So, how do you think Firefox's extensions priority works?
Are all extension receiving events (that new tab is opened – gBrowser "NewTab" event in low level api, onLoad/onReady/onActivate in sdk/tabs and others)? And how Firefox decide whose callback to process? Or Firefox processing all callbacks and the result of last one is displaying? If that was true, I think there were races between different extensions and sometime there will be different new tabs. But there are always stably one new tab extension is working.
Would appreciate for any thoughts.