-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmanifest.config.ts
54 lines (52 loc) · 1.36 KB
/
manifest.config.ts
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { defineManifest } from "@crxjs/vite-plugin";
import packageJson from "./package.json";
const { version } = packageJson;
// Convert from Semver (example: 0.1.0-beta6)
const [major, minor, patch, label = "0"] = version
// can only contain digits, dots, or dash
.replace(/[^\d.-]+/g, "")
// split into version parts
.split(/[.-]/);
export default defineManifest(async (env) => {
return {
manifest_version: 3,
default_locale: "en",
icons: {
"16": "logo.png",
"32": "logo.png",
"48": "logo.png",
"128": "logo.png",
},
name: "webCopilot",
version:
env.mode === "development" ? "999.999.999" : `${major}.${minor}.${patch}`,
action: {
// default_popup: "popup.html",
default_title: "Click to open sidebar",
},
host_permissions: ["https://*.v2ex.com/", "https://weibo.com/*"],
background: {
service_worker: "src/background",
},
side_panel: {
default_path: "sidePanel.html",
},
permissions: ["tabs", "storage", "sidePanel"],
commands: {
"search-focus": {
suggested_key: {
default: "Alt+S",
windows: "Alt+S",
mac: "Alt+S",
},
description: "__MSG_shortCutsSearch__",
},
_execute_action: {
suggested_key: {
default: "Alt+X",
mac: "Alt+X",
},
},
},
};
});