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.
英语不是特别好,就不做中间翻译了。
添加回答
举报