-
Notifications
You must be signed in to change notification settings - Fork 72
/
manifest.config.ts
65 lines (64 loc) · 1.7 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
55
56
57
58
59
60
61
62
63
64
65
import pkg from './package.json'
export const getManifest = ({ dev }: { dev?: boolean }) =>
({
name: `${pkg.extension.name}${dev ? ' (dev)' : ''}`,
description: pkg.extension.description,
version: pkg.version,
manifest_version: 3,
action: {
default_icon: {
'16': `icons/icon${dev ? '-dev' : ''}@16w.png`,
'32': `icons/icon${dev ? '-dev' : ''}@32w.png`,
'48': `icons/icon${dev ? '-dev' : ''}@48w.png`,
'128': `icons/icon${dev ? '-dev' : ''}@128w.png`,
},
},
background: {
service_worker: 'src/entries/background/index.ts',
},
content_scripts: [
{
matches: ['*://*/*'],
js: ['src/entries/content/index.ts'],
run_at: 'document_start',
all_frames: true,
},
],
side_panel: {
default_path: 'src/entries/iframe/index.html',
},
icons: {
'16': `icons/icon${dev ? '-dev' : ''}@16w.png`,
'32': `icons/icon${dev ? '-dev' : ''}@32w.png`,
'48': `icons/icon${dev ? '-dev' : ''}@48w.png`,
'128': `icons/icon${dev ? '-dev' : ''}@128w.png`,
},
permissions: [
'activeTab',
'contextMenus',
'declarativeNetRequest',
'scripting',
'sidePanel',
'storage',
'tabs',
'unlimitedStorage',
'webRequest',
],
host_permissions: ['*://*/*'],
web_accessible_resources: [
{
resources: ['*.woff2'],
matches: ['<all_urls>'],
},
{
resources: ['inpage.js'],
matches: ['*://*/*'],
},
],
commands: {
'toggle-theme': {
suggested_key: 'Ctrl+Shift+Y' as any,
description: 'Toggle Theme',
},
},
}) satisfies chrome.runtime.Manifest