禁用Firefox自动更新

https://support.mozilla.org/en-US/kb/customizing-firefox-using-policiesjson

Taking macOS as an example, create a distribution folder in the Firefox.app/Contents/Resources directory. Then, create a file named policies.json in the distribution folder with the following content:

1
2
3
4
5
6
{
  "policies": {
    "DisableAppUpdate": true,
    "ManualAppUpdateOnly": true
  }
}

Restart the browser and you will no longer have annoying update reminders.

node 补丁

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function applyPolicies() {
  const fs = require("fs");
  const path = require("path");

  const distDir = path.join(
    FIREFOX_APP,
    "Contents/Resources/distribution"
  );

  const policyFile = path.join(distDir, "policies.json");

  // 创建目录
  if (!fs.existsSync(distDir)) {
    fs.mkdirSync(distDir, { recursive: true });
    console.log("✔ 已创建 distribution 目录");
  }

  const policy = {
    policies: {
      DisableAppUpdate: true,
      ManualAppUpdateOnly: true,
    },
  };

  fs.writeFileSync(policyFile, JSON.stringify(policy, null, 2));

  console.log("✔ 已写入 policies.json(禁用自动更新)");
}

applyPolicies()
build with Hugo, theme Stack, visits 0