Sort addon by execution order?
-
- Posts: 4
- Joined: February 11th, 2016, 9:15 am
Sort addon by execution order?
I'm using Greasymonkey and it have function "sort by execution order" on the scripts but I dont know there are addon that help sort Firefox addon by execution order like that?
-
- Posts: 1168
- Joined: September 16th, 2007, 8:01 am
Re: Sort addon by execution order?
This is a very tricky thing. You would have to use XPIProvider.jsm and maybe poll to see which bootstrap
scopes come in first. Something like this:
This code is for <Fx47 and does only bootstraped addons. I don't know how you would do it for non-bootstraped.
For fx >= 47 you would do this way:
XPIScope.XPIProvider.activeAddons.get(addonid).bootstrapScope
scopes come in first. Something like this:
Code: Select all
var XPIScope = Cu.import('resource://gre/modules/addons/XPIProvider.jsm');
// var nativeshotScope = XPIScope.XPIProvider.bootstrapScopes['NativeShot@jetpack'];
And then watch as bootstrapScopes get populated, with a timeout of like 1ms.
For fx >= 47 you would do this way:
XPIScope.XPIProvider.activeAddons.get(addonid).bootstrapScope