-
Notifications
You must be signed in to change notification settings - Fork 308
[MV2] 翻译更新,package 更新 #916
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
Conversation
|
感谢🙏,我这两天更新到firefox去 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
这个PR主要进行了以下改进:
- 修复了API类型定义中的拼写错误(minetype → mimetype)
- 添加了文件名清理功能以处理非法字符
- 增强了脚本验证逻辑,包括@grant冲突检测和元数据重复检测
- 将错误消息国际化(i18n)
- 更新了UI文本和翻译
- 升级了多个依赖包版本
Reviewed Changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/scriptcat.d.ts | 修复GM_setClipboard API中的拼写错误 |
| src/runtime/content/gm_api.ts | 同步修复API实现中的拼写错误 |
| src/runtime/background/gm_api.ts | 添加文件名清理功能到下载API |
| src/pkg/utils/utils.ts | 新增cleanFileName函数 |
| src/pkg/utils/script.ts | 添加脚本验证、i18n错误消息、编辑器选项 |
| src/template/normal.tpl | 添加默认元数据标签 |
| src/pages/options/routes/script/ScriptEditor.tsx | 传递编辑器标志 |
| src/pages/options/routes/ScriptList.tsx | UI改进和拖拽限制 |
| src/locales/* | 统一翻译键名并添加新错误消息 |
| package.json | 升级依赖包版本 |
| const hasGrantConflict = (metadata: SCMetadata | undefined | null) => | ||
| metadata?.grant?.includes("none") && metadata?.grant?.some((s: string) => s.startsWith("GM")); |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grant检测逻辑不准确。应检查"none"字符串,但some条件会匹配任何GM开头的grant(包括合法的GMC_等)。建议改为检查标准的GM_ API或明确的API列表,避免误报。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没问题 检测同时存在 none和GM*
| for (const list of Object.values(metadata)) { | ||
| if (list && new Set(list).size !== list.length) return true; | ||
| } | ||
| } |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
函数缺少显式返回false。虽然JavaScript会隐式返回undefined(等同于false),但最佳实践应在末尾显式返回false以提高代码可读性和意图明确性。
| } | |
| } | |
| return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mv3合并了没写 return false; 的。不是好习惯但暂时先这样
|
build没通过,我觉得还是不要更新package了,免得又出些其它岔子 |
|
只是lint问题,我处理了,不过确实感觉不更新package的好,不过你处理了,就这样吧 |
有build 跟test过的 MV2 版本号是 跟随MV3的 package 版本号 |
定期手动更新一下吧 |
主要是担心出现其它问题啦 |
毕竟还是有人在用 Firefox,需要更新一下 MV2
先更新一部份
之后再把 UI 的部份 和 GM API 的 GM.setValue/GM.getValue/GM.listValue ... 更新一下
有 npm run test 和 npm run build 过。可以在 Firefox 运行
85b48e2
2518722
fb3d132
5089b2a