-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathwxt.config.ts
More file actions
85 lines (83 loc) · 2.15 KB
/
Copy pathwxt.config.ts
File metadata and controls
85 lines (83 loc) · 2.15 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
82
83
84
85
import { defineConfig } from 'wxt';
// const chromeProfile = './tmp/chrome_profile';
export default defineConfig({
modules: ['@wxt-dev/module-react', '@wxt-dev/i18n/module'],
manifestVersion: 3,
// webExt: {
// chromiumProfile: chromeProfile,
// keepProfileChanges: true,
// },
hooks: {
'build:manifestGenerated': (_wxt, manifest) => {
if (manifest.content_scripts?.length === 0) {
delete manifest.content_scripts;
}
},
},
manifest: ({ browser }) => ({
name: '__MSG_extensionName__',
description: '__MSG_extensionDescription__',
default_locale: 'en',
version: '3.3.1',
permissions: [
'storage',
'activeTab',
'contextMenus',
...(['chrome', 'edge', 'firefox'].includes(browser) ? ['unlimitedStorage'] : []),
],
optional_permissions: [
'cookies',
'history',
'bookmarks',
'tabs',
'scripting',
...(['chrome', 'edge'].includes(browser) ? ['pageCapture'] : []),
],
optional_host_permissions: ['<all_urls>'],
web_accessible_resources: [
{
resources: ['icon/*.png'],
matches: ['<all_urls>'],
},
],
content_security_policy: {
extension_pages: "script-src 'self'; object-src 'self'",
},
icons: {
16: '/icon/16.png',
32: '/icon/32.png',
48: '/icon/48.png',
128: '/icon/128.png',
},
action: {
default_title: '__MSG_actionTitle__',
default_popup: '/popup.html',
default_icon: {
16: '/icon/16.png',
32: '/icon/32.png',
48: '/icon/48.png',
128: '/icon/128.png',
},
},
commands: {
'save-to-archivebox-action': {
description: '__MSG_commandSaveToArchiveBox__',
suggested_key: {
default: 'Ctrl+Shift+X',
mac: 'Command+Shift+X',
},
},
},
...(browser === 'firefox' ? {
browser_specific_settings: {
gecko: {
id: 'archivebox@tjhorner.dev',
data_collection_permissions: {
required: ['browsingActivity'],
optional: ['bookmarksInfo', 'websiteContent'],
},
},
},
} : {}),
}),
});