[v1.3] 提升 MV3 版本在更多浏览器(特别是 Firefox)的兼容性#1221
Open
cyfung1031 wants to merge 22 commits intoscriptscat:release/v1.3from
Open
[v1.3] 提升 MV3 版本在更多浏览器(特别是 Firefox)的兼容性#1221cyfung1031 wants to merge 22 commits intoscriptscat:release/v1.3from
cyfung1031 wants to merge 22 commits intoscriptscat:release/v1.3from
Conversation
Collaborator
Author
Collaborator
Author
|
Firefox MV3 禁止了 |
Collaborator
Author
Collaborator
Author
|
@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
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.

目标
提升 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)测试结果
Firefox Developer Edition 仍有部分异常(日后再处理)v1.3 修正反注册未正确执行 #1231注
https://addons.mozilla.org/en-US/developers/upload/c62fc11505c5453296187f62637ff0f1
能在 Zen 正常跑
但我的 Firefox Developer Edition 好像不太正常... 慢慢改进吧~#1231