-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwxt.config.ts
More file actions
77 lines (70 loc) · 2.05 KB
/
Copy pathwxt.config.ts
File metadata and controls
77 lines (70 loc) · 2.05 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
import { defineConfig } from 'wxt';
import tailwindcss from '@tailwindcss/vite';
// Phase 0→10: WXT scaffold. Each phase replaces legacy code with typed React.
export default defineConfig({
modules: ['@wxt-dev/module-react'],
// srcDir: 'src' makes WXT auto-set the @/ alias to src/.
// entrypointsDir is resolved relative to srcDir, so '../entrypoints' → project-root/entrypoints/.
srcDir: 'src',
entrypointsDir: '../entrypoints',
outDir: 'dist',
vite: () => ({
plugins: [tailwindcss()],
}),
// Assets in public/ are copied as-is to the extension output root.
publicDir: 'public',
manifest: ({ browser: _browser, manifestVersion }) => {
const icons = {
16: 'assets/icons/icon-16.png',
32: 'assets/icons/icon-32.png',
48: 'assets/icons/icon-48.png',
128: 'assets/icons/icon-128.png',
};
if (manifestVersion === 3) {
return {
name: 'APIlot',
version: '2.3.1',
icons,
permissions: [
'activeTab',
'storage',
'webRequest',
'webNavigation',
'declarativeNetRequest',
'declarativeNetRequestWithHostAccess',
] as any[],
host_permissions: ['<all_urls>'],
content_security_policy: {
extension_pages: "script-src 'self'; object-src 'self'",
},
web_accessible_resources: [
{ resources: ['injected.js'], matches: ['<all_urls>'] },
] as any,
};
}
// Firefox MV2
return {
name: 'APIlot',
version: '2.3.1',
icons,
permissions: [
'activeTab',
'storage',
'<all_urls>',
'devtools',
'tabs',
'webRequest',
'webRequestBlocking',
'webNavigation',
] as any[],
content_security_policy: "script-src 'self'; object-src 'self'",
web_accessible_resources: ['injected.js'] as any,
browser_specific_settings: {
gecko: {
id: 'apilot@mohamed.zumair',
data_collection_permissions: { required: ['none'] },
},
},
};
},
});