-
Notifications
You must be signed in to change notification settings - Fork 3
/
manifest.config.ts
54 lines (47 loc) · 1.32 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
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import { defineManifest } from "@crxjs/vite-plugin";
import packageJson from "./package.json";
const APP_NAME = "Webgati AI";
const { version } = packageJson;
const [major, minor, patch] = version.replace(/[^\d.-]+/g, "").split(/[.-]/);
const icons = {
"16": "public/icon.png",
"32": "public/icon.png",
"48": "public/icon.png",
"128": "public/icon.png",
};
export default defineManifest(async (env) => ({
manifest_version: 3,
name: env.mode === "development" ? `[DEV] ${APP_NAME}` : APP_NAME,
version: `${major}.${minor}.${patch}`,
version_name: version,
icons,
action: {
default_icon: icons,
default_title: APP_NAME,
},
options_page: "public/settings.html",
content_scripts: [
{
js: ["src/content-script/index.tsx"],
matches: ["http://*/*", "https://*/*"],
},
],
background: {
service_worker: "src/background/sw.ts",
type: "module",
persistent: false,
},
content_security_policy: {
extension_pages: "script-src 'self' 'wasm-unsafe-eval'",
},
host_permissions: ["<all_urls>"],
permissions: ["activeTab", "storage", "tabs", "sidePanel"],
web_accessible_resources: [
{
resources: ["public/settings.html"],
matches: ["http://*/*", "https://*/*"],
},
],
}));