Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions scripts/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ firefoxManifest.browser_specific_settings = {
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/userScripts#browser_compatibility
// Firefox 136 (Released 2025-03-04)
strict_min_version: "136.0",
data_collection_permissions: {
required: [
"none", // 没有必须传送至第三方的资料。安装转页没有记录用户何时何地安装了什么。
],
optional: [
"authenticationInfo", // 使用 Cloud Backup / Import 时,有传送用户的资料至第三方作登入验证
"personallyIdentifyingInfo", // 使用 电邮 或 帐密 让第三方识别个人身份进行 Cloud Backup / Import
],
},
Comment on lines +92 to +100
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些不需要吧,至少不强制需要

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Firefox addons上架強制
跟隨mv2

https://extensionworkshop.com/documentation/develop/firefox-builtin-data-consent/

New versions and updates for add-ons created before November 3 don’t need to use this feature, but will have to at a later date.

現在是2026 年了。

Copy link
Copy Markdown
Member

@CodFrm CodFrm May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

似乎是Firefox的管理页面设置?那我带上这个,下次发布新版本的时候我注意一下

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

它是自动读 manifest. firefoxMV2 已经有在做这个。只是 MV3 对齐一下。方便日后 Beta 版
只是自我申报

Screenshot 2026-05-29 at 17 42 58

},
};

Expand All @@ -98,6 +107,12 @@ firefoxManifest.commands = {
_execute_action: {},
};

// 避免将 Chrome 特有权限添加到 Firefox 的 manifest
firefoxManifest.permissions = firefoxManifest.permissions?.filter((permission) => permission !== "background");
firefoxManifest.optional_permissions = firefoxManifest.optional_permissions?.filter(
(permission) => permission !== "background"
);

const chrome = createJSZip();
const firefox = createJSZip();

Expand Down Expand Up @@ -126,10 +141,8 @@ firefox.file("manifest.json", JSON.stringify(firefoxManifest));

await Promise.all([
addDir(chrome, "./dist/ext", "", ["manifest.json"]),
addDir(firefox, "./dist/ext", "", ["manifest.json", "ts.worker.js"]),
addDir(firefox, "./dist/ext", "", ["manifest.json"]),
]);
// 添加ts.worker.js名字为gz
firefox.file("src/ts.worker.js.gz", await fs.readFile("./dist/ext/src/ts.worker.js", { encoding: "utf8" }));

// 导出zip包
chrome
Expand Down
Loading