-
Notifications
You must be signed in to change notification settings - Fork 314
[v1.3] 提升 MV3 版本在更多浏览器(特别是 Firefox)的兼容性 #1221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/v1.3
Are you sure you want to change the base?
[v1.3] 提升 MV3 版本在更多浏览器(特别是 Firefox)的兼容性 #1221
Conversation
|
Firefox MV3 禁止了 |
|
@CodFrm 我重新提交了代码 这个跟ScriptCat MV2版的时候做法很类似,但我用完全针对 ts.worker.js 的压缩器,实实在在把 5.9 MB 的档案压缩成 3.8 MB Firefox MV3 的规格限制很多,完全不让 blobUrl 的 worker 跑起来,也不让 eval 等东西 压缩方面用 pako 就行了。大概压个 level 6 就很足够 目前 FireMonkey 想加入 Monaco Editor 但因为 5MB 限制不成功 (官方来讲,已经是 4MB -> 5MB ) 压缩方面,AI自己找了 acorn 和 magic-string 。用起来好像不错。 |
7ae0298 to
7bfacbb
Compare

目标
提升 ScriptCat MV3 版本在 Firefox 及其他浏览器的兼容性,解决以下主要问题:
主要变更
将ts.worker.js改名为ts.worker.js.bin(binary 格式不受 5MB 限制)ZipExecutionPlugin+ 原生 JS 解压,将 worker 压缩至约 4MBWorker 载入方式调整:getWorkerUrl→getWorker,回传Promise<Worker>读取 .bin 的 arrayBuffer → 转为 text/javascript Blob URL → 建立 Worker(绕过 Firefox blob: 限制)data_collection_permissions(参考 commit c13b502)测试结果
注
https://addons.mozilla.org/en-US/developers/upload/c62fc11505c5453296187f62637ff0f1
能在 Zen 正常跑
但我的 Firefox Developer Edition 好像不太正常... 慢慢改进吧~