-
Notifications
You must be signed in to change notification settings - Fork 22
/
gen-manifest.js
28 lines (28 loc) · 1.08 KB
/
gen-manifest.js
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
if (process.argv.length < 3) {
console.log("Insufficient number of arguments!");
}
const fs = require("fs");
const path = require("path");
const manifest = JSON.parse(fs.readFileSync(path.join(__dirname, "src", "manifest.json"), "utf8").toString())
const Ext = require("./ext-info");
let indent = undefined;
if (process.argv.length === 4 && process.argv[3] === "--pretty") indent = 4;
switch (process.argv[2]) {
case "webext":
case "firefox":
manifest.browser_specific_settings = {
gecko: {
id: "[email protected]",
strict_min_version: "59.0"
}
};
manifest.permissions.push("contextualIdentities");
manifest.host_permissions.push("<all_urls>");
break;
case "chrome":
// Remove suggested keys for last-used-window, since only 4 are allowed.
manifest.commands["last-used-window"]["suggested_key"] = undefined;
break;
}
manifest.version = Ext.EXT_VERSION;
fs.writeFileSync(path.join(__dirname, "dist", "manifest.json"), JSON.stringify(manifest, undefined, indent));