Sort addon by execution order?

Talk about add-ons and extension development.
Post Reply
hien4990
Posts: 4
Joined: February 11th, 2016, 9:15 am

Sort addon by execution order?

Post by hien4990 »

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?
Noitidart
Posts: 1168
Joined: September 16th, 2007, 8:01 am

Re: Sort addon by execution order?

Post by Noitidart »

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:

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.
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
Post Reply