(Firefox) MV3 需要非长注式设计 #857
cyfung1031
started this conversation in
General
Replies: 1 comment 4 replies
-
是有一个选useOpen进行控制的,必须使用window.open,详情可以看:#178 chrome.tabs.create 无法触发某些本地协议
service_worker 中只能使用 fetch,无法使用 XMLHttpRequest
因为service worker是有存活时间的,ws可能会被断开
后台脚本本来就是跑后台任务,肯定是要长期驻守的呀,难道再做一个像MV3一样的,控制存活时间,然后通过事件激活的东西,这不是找堵吗。 例如:前台投递一个任务,后台跑
没太明白这个,是要再打开一个页面? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
不用 offscreen 更节能
document.execCommand,改以navigator.clipboard.writeTextwindow.open,改以chrome.tabs.createservice_worker处理xmlHttpRequestvscode-connect/vscodeConnect-> 为何要在offscreen 用这个runScript/stopScript/updateRunStatus-> 后台脚本不再以"长期驻守"为设计原则,改以chrome.alarm)CAT_trackInterval(5, ()=>....)类似事件或callback触发机制chrome.webNavigation)onBeforeNavigate -> onCommitted -> [onDOMContentLoaded] -> onCompletedCAT_onWebNavigate("beforeNavigate", ()=>....)类似事件或callback触发机制@crontabCAT_trackCron("* * once * *", ()=>....)CAT_onServiceWorkerRestarted("* * once * *", ()=>....)createObjectURLrequestExport,CAT_fileStoragecreateObjectURL.html?uuid=XXXXXX来处理createObjectURL.html接收到 uuid 后,读取 service worker 的字串变数,接收后用 URL.createObjectURL 转换成 blob url, 再self-redirect到这个 blob url. redirect后blob url会立即消失loadFaviconBeta Was this translation helpful? Give feedback.
All reactions