开发者

Can a firefox extension change in what order it is called at startup?

In what order do Firefox extensions get initiali开发者_StackOverflow社区sed? covers how Firefox extensions are usually called during startup (order of install). I'm wondering if there is an official way for an extension to change that, in particular to say it wants to go near the end (and while we are at it near the start). Similar to a priority flag seen in may other plugin approaches.


In general, the answer is "no" - the order in which extensions apply can be considered "random" (I sincerely doubt that it really is "in order of installation"). But it still depends on what you want to do.

If you want your XPCOM component to become active during startup, there is a number of observer notifications. Typically, extensions listen to the profile-after-change notification. However, you might also choose to listen to profile-do-change and final-ui-startup, depending on what your extension wants to do.

If we are talking about browser window overlays, there isn't much you can influence there. However, you can still choose whether you want your overlay to apply to chrome://browser/content/browser.xul or to an overlay URL that is applied to this window. The latter is in particular useful if you want your overlay to apply after the overlay of another extension that you know must be present.


No, the standard Firefox manifest does not include any support for controlling the load order relative to any other extension. The choice of extension load order is essentially arbitrary and is entirely determined by the Firefox instance in a broadly speaking not-at-all-well-documented fashion.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜