[v1.4] 引进 Persistent Frame,防止 MV3 Event Page 休眠#1230
Draft
cyfung1031 wants to merge 41 commits intoscriptscat:release/v1.4from
Draft
[v1.4] 引进 Persistent Frame,防止 MV3 Event Page 休眠#1230cyfung1031 wants to merge 41 commits intoscriptscat:release/v1.4from
cyfung1031 wants to merge 41 commits intoscriptscat:release/v1.4from
Conversation
Collaborator
Author
|
等合并后再研究 unified persistent frame |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
在 MV3 架构下,Event Page(類似Service Worker)会被浏览器自动休眠。本 PR 透过新增
persistent_frame机制,使 Event Page 能持续保持活跃,不被浏览器中断。问题背景
MV3 的 Event Page 在闲置一段时间后会被浏览器强制休眠,导致后台脚本无法持续执行,影响定时任务、长时间运行脚本等功能的稳定性。
解决方案
在 Event Page 中嵌入一个隐藏的
persistent_frameiframe:storage.sessionstorage.session的 change event listener 接收心跳,保持自身活跃附注