1 回答

TA貢獻1865條經驗 獲得超7個贊
參考這里:傳送門
原文:
Convert background page to event page
Follow this checklist to convert your extension's (persistent) background page to an event page.
Add "persistent": false to your manifest as shown above.
If your extension uses window.setTimeout() or window.setInterval(), switch to using the alarms API instead. DOM-based timers won't be honored if the event page shuts down.
Similarly, other asynchronous HTML5 APIs like notifications and geolocation will not complete if the event page shuts down. Instead, use equivalent extension APIs, like notifications.
If your extension uses, extension.getBackgroundPage, switch to runtime.getBackgroundPage instead. The newer method is asynchronous so that it can start the event page if necessary before returning it.
英語不是特別好,就不做中間翻譯了。
添加回答
舉報