Skip to content

FirefoxMV2 : 修正部份主要项目#1331

Open
cyfung1031 wants to merge 4 commits intoscriptscat:release/mv2from
cyfung1031:fix/mv2/update-20260405
Open

FirefoxMV2 : 修正部份主要项目#1331
cyfung1031 wants to merge 4 commits intoscriptscat:release/mv2from
cyfung1031:fix/mv2/update-20260405

Conversation

@cyfung1031
Copy link
Copy Markdown
Collaborator

@cyfung1031 cyfung1031 commented Apr 5, 2026

Checklist / 检查清单

  • Fixes mentioned issues / 修复已提及的问题
  • Code reviewed by human / 代码通过人工检查
  • Changes tested / 已完成测试

Description / 描述

由于现时的MV3版本在Firefox 无法支持后台脚本,所以只好继续维护MV2版

这个PR的改动是基于现时 1.3 及 1.4 版

npm -> pnpm

  • workflow files, markdown 等也改成 pnpm
  • jest.config.js 修正
  • npm package lock 暂时保留

npm库版本

  • 跟随 1.3 版提升
  • 解决部份 vulnerability

ts.worker.js

  • 跟随 1.4 版使用 ZipExecutionPlugin (webpack版), 不需要做多次网络要求再合并
  • pack.js 退回原本

typescript & tsconfig

  • typescript 升级至常用的 4.9
  • tsconfig 由 es2021 提升至 es2022 以支持 Object.hasOwn

eslint

  • 避免和1.3/1.4 版出现太大差异,lint 不同之处都在 eslintrc.cjs 改了。例如 prefer-destructuring 设为 off
  • 部份禁用理由是为了正常 build,例如 no-unused-vars

tpl (normal, crontab, background) [新脚本范本对齐 chrome 版]

  • 更新至 1.3 版 (包括使用 lazyScriptName )

沙盒 [bug fix]

  • window.parent 修正

cron [syntax 对齐 chrome 版]

  • npm 包升级至 5.0.0-beta.1 (即 1.3 最新版 + child_process 移除): 由于 webpack 无法像 rspack 自行拆除未使用的 child_process,需使用 beta 版
  • cron 的升级是必需,因为旧版本的计时器有bug
  • crontab 业务代码升级至 1.3 版, 支持表达式 once(...)
  • 排程时间显示的 translation.json 跟随修改

Monaco Editor [使用体验对齐 chrome 版]

  • 跟随 1.4 版升级成多国语言
  • 跟随 1.4 版修订了 CodeEditor 等设定

補回 injected.js 的 sourceURL

Screenshots / 截图

@cyfung1031 cyfung1031 linked an issue Apr 5, 2026 that may be closed by this pull request
@cyfung1031 cyfung1031 changed the title FirefoxMV2 简易修正 FirefoxMV2 : 修正部份主要项目 Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 嵌套iframe会接受不到postMessage的消息

1 participant