Repository navigation
Expand file tree
/
Copy pathwxt.config.ts
More file actions
117 lines (112 loc) · 3.31 KB
/
Copy pathwxt.config.ts
File metadata and controls
117 lines (112 loc) · 3.31 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import { defineConfig } from "wxt";
import pkg from "./package.json";
import {
FRAME_EMBEDDING_DNR_RULE_ID,
FRAME_EMBEDDING_DNR_RULE_PATH,
} from "./utils/frame-embedding/constants";
export default defineConfig({
// Don't auto-open a fresh browser on `wxt dev`; load .output/chrome-mv3
// manually into your existing Chrome profile instead (HMR still works).
webExt: {
disabled: true,
},
manifest: ({ browser }) => {
// <all_urls>: Required for Firefox webRequest (header-removal, auth-redirect)
// and Chrome declarativeNetRequest rule scope
const hostPermissions = [
"https://gemini.google.com/*",
"https://claude.ai/*",
"https://x.com/*",
"https://grok.com/*",
"https://kimi.com/*",
"https://www.kimi.com/*",
"https://accounts.x.ai/*",
"<all_urls>",
];
const base = {
name: "__MSG_extName__",
description: "__MSG_extDescription__",
default_locale: "en",
version: pkg.version,
host_permissions: hostPermissions,
};
// Add main world script to web_accessible_resources
const webAccessibleResources = [
{
resources: ["intercept-main-world.js"],
matches: [
"https://gemini.google.com/*",
"https://claude.ai/*",
"https://x.com/*",
"https://grok.com/*",
"https://kimi.com/*",
"https://www.kimi.com/*",
],
},
];
if (browser === "firefox") {
// Firefox MV2: host URLs in permissions; no host_permissions key
const { host_permissions: _hp, ...baseWithoutHost } = base;
return {
...baseWithoutHost,
permissions: [
"activeTab",
"tabs",
"storage",
"identity",
"webRequest",
"webRequestBlocking",
...hostPermissions,
],
commands: {
"open-command-palette": {
suggested_key: { default: "Ctrl+Shift+Period", mac: "Command+Shift+Period" },
description: "__MSG_openCommandPalette__",
},
},
web_accessible_resources: webAccessibleResources,
// AMO zorunluluğu: veri toplama/iletim beyanı (Kasım 2025+)
browser_specific_settings: {
gecko: {
data_collection_permissions: {
// Sayfa içeriği kullanıcı "attach" ettiğinde seçilen AI chatbot'a gönderilir (PRIVACY.md ile uyumlu)
required: ["websiteContent"],
optional: [],
},
},
},
};
}
// Chrome MV3: declarativeNetRequest + Cmd+. command palette
return {
...base,
permissions: [
"activeTab",
"scripting",
"tabs",
"storage",
"identity",
"declarativeNetRequest",
],
action: {
default_title: "SideMagic",
},
commands: {
"open-command-palette": {
suggested_key: { default: "Ctrl+Shift+Period", mac: "Command+Shift+Period" },
description: "__MSG_openCommandPalette__",
},
},
declarative_net_request: {
rule_resources: [
{
id: FRAME_EMBEDDING_DNR_RULE_ID,
enabled: true,
path: FRAME_EMBEDDING_DNR_RULE_PATH,
},
],
},
web_accessible_resources: webAccessibleResources,
};
},
});