chrome extension onInstalled event

后端 未结 3 1362
别那么骄傲
别那么骄傲 2021-01-02 03:08

I have a question about chrome extension install/update event. If I add the onInstalled event listener in a top level code in the background script, is there a time frame in

3条回答
  •  独厮守ぢ
    2021-01-02 03:59

    Given that the document says

    “Listeners must be registered synchronously from the start of the page.”

    and

    “Do not register listeners asynchronously, as they will not be properly triggered.”

    , it seems they guarantee every synchronously-attached listener not to miss any, no matter how long it takes to evaluate your code. And this would be done by Chrome firing events after evaluating your entire code.

    My hypothesis is that onInstalled actually works like onInitialized. No test data, though.

提交回复
热议问题