Repository navigation
Expand file tree
/
Copy pathwxt.config.ts
More file actions
81 lines (78 loc) · 2.31 KB
/
Copy pathwxt.config.ts
File metadata and controls
81 lines (78 loc) · 2.31 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { defineConfig } from 'wxt';
import svgr from 'vite-plugin-svgr';
import yargsParser from 'yargs-parser';
const args = yargsParser(process.argv.slice(2));
const isFirefox = args.b === 'firefox';
export default defineConfig({
// entrypointLoader: 'jiti',
// extensionApi: 'chrome',
modules: ['@wxt-dev/module-react'],
vite: () => ({
plugins: [svgr({ svgrOptions: { icon: true } })],
}),
manifest: {
name: 'Nice Tab Manager',
permissions: [
'storage',
'tabs',
'contextMenus',
'unlimitedStorage',
'alarms',
...(isFirefox ? [] : ['tabGroups', 'commands', 'favicon']),
],
homepage_url: 'https://github.com/web-dahuyou/NiceTab',
host_permissions: ['<all_urls>'],
default_locale: 'zh_CN',
content_security_policy: isFirefox
? {
extension_pages: "script-src 'self'; object-src 'self';",
}
: {
// extension_pages: "script-src 'self' 'wasm-unsafe-eval' http://localhost:8097/; object-src 'self';",
extension_pages: "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';",
sandbox:
"sandbox allow-scripts; script-src 'self' https://api.github.com https://gitee.com; object-src 'self'",
},
commands: {
'action:openAdminTab': {
suggested_key: {
default: 'Alt+Shift+M',
},
description: '__MSG_action_openAdminTab__',
},
'action:sendAllTabs': {
suggested_key: {
default: 'Alt+Shift+A',
},
description: '__MSG_action_sendAllTabs__',
},
'action:sendCurrentTab': {
suggested_key: {
default: 'Alt+Shift+C',
},
description: '__MSG_action_sendCurrentTab__',
},
'action:globalSearch': {
description: '__MSG_action_globalSearch__',
},
'action:sendOtherTabs': {
description: '__MSG_action_sendOtherTabs__',
},
'action:sendLeftTabs': {
description: '__MSG_action_sendLeftTabs__',
},
'action:sendRightTabs': {
description: '__MSG_action_sendRightTabs__',
},
'action:startSync': {
description: '__MSG_action_startSync__',
},
// 激活option面板
_execute_action: {
suggested_key: {
default: 'Alt+Shift+P',
},
},
},
},
});