-
Notifications
You must be signed in to change notification settings - Fork 2
/
manifest.config.ts
60 lines (56 loc) · 2.03 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
import { defineManifest } from '@crxjs/vite-plugin'
import packageJson from './package.json'
import { UNIVERSITY_LINK_LIST } from './src/constants/univ'
const [major, minor, patch, label = '0'] = packageJson.version.replace(/[^\d.-]+/g, '').split(/[.-]/)
const isDev = process.env.NODE_ENV === 'development'
export default defineManifest(
async () =>
({
manifest_version: 3,
name: isDev
? '[DEV] Gachon Tools - 과제 대시보드 · 사이버캠퍼스 어시스턴트'
: 'Gachon Tools - 과제 대시보드 · 사이버캠퍼스 어시스턴트',
description: packageJson.description,
version: label === '0' ? `${major}.${minor}.${patch}` : `${major}.${minor}.${patch}.${label}`,
version_name: packageJson.version,
action: {
default_title: 'popup',
default_popup: 'src/popup/index.html',
default_icon: {
'16': 'assets/logo16.png',
'48': 'assets/logo48.png',
'128': 'assets/logo128.png',
},
},
icons: {
'16': 'assets/logo16.png',
'48': 'assets/logo48.png',
'128': 'assets/logo128.png',
},
background: {
service_worker: 'src/background/index.ts',
type: 'module',
},
content_scripts: [
{
matches: UNIVERSITY_LINK_LIST.map(univ => `${univ}/*`),
exclude_matches: UNIVERSITY_LINK_LIST.flatMap(univ => [
`${univ}/login.php*`,
`${univ}/mod/ubfile/viewer.php*`,
`${univ}/mod/vod/viewer.php*`,
]),
js: ['src/content/index.tsx'],
run_at: 'document_start',
},
],
options_page: 'src/options/index.html',
web_accessible_resources: [
{
resources: ['assets/js/*.js', 'assets/css/*.css', '*.webp', '*.png', '*.jpg', '*.jpeg', '*.gif'],
matches: ['*://*/*'],
},
],
host_permissions: UNIVERSITY_LINK_LIST.map(univ => `${univ}/*`),
permissions: ['storage', 'unlimitedStorage', 'scripting', 'activeTab'],
}) as const,
)