Skip to content

Commit a3146b4

Browse files
committed
Add support for Z AI China domain
- z.ai has identical china version under different domain `https://zchat.z.ai/` ├── apps │ └── browser │ └── src │ ├── content-scripts │ │ └── send-prompt-content-script │ │ ├── chatbots │ │ │ └── z-ai.ts │ │ └── send-prompt-content-script.ts │ └── manifest.json └── packages └── shared └── src └── constants └── chatbots.ts
1 parent f9e2f1b commit a3146b4

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

‎apps/browser/src/content-scripts/send-prompt-content-script/send-prompt-content-script.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,11 @@ const is_meta = current_url.startsWith(meta_url)
8787
const together_url = 'https://chat.together.ai/'
8888
const is_together = current_url.startsWith(together_url)
8989

90-
const z_ai_url = 'https://chat.z.ai/'
91-
const is_z_ai = current_url.startsWith(z_ai_url)
90+
const z_ai_global_url = 'https://chat.z.ai/'
91+
const z_ai_china_url = 'https://zchat.z.ai/'
92+
const is_z_ai =
93+
current_url.startsWith(z_ai_global_url) ||
94+
current_url.startsWith(z_ai_china_url)
9295

9396
const is_open_webui = document.title.includes('Open WebUI')
9497

‎apps/browser/src/manifest.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "Autofill for Code Web Chat",
55
"short_name": "CWC",
66
"description": "Autofill prompts in 15+ free chatbots!",
7-
"version": "2026.1014.17",
7+
"version": "2026.1014.18",
88
"homepage_url": "https://github.com/robertpiosik/CodeWebChat",
99
"icons": {
1010
"16": "icons/icon-16.png",
@@ -45,6 +45,7 @@
4545
"https://chat.together.ai/",
4646
"https://yuanbao.tencent.com/*",
4747
"https://chat.z.ai/",
48+
"https://zchat.z.ai/",
4849
"http://localhost/"
4950
],
5051
"js": ["send-prompt-content-script.js"]

‎packages/shared/src/constants/chatbots.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ export const CHATBOTS = {
183183
Yuanbao: {
184184
url: 'https://yuanbao.tencent.com/chat'
185185
} as Chatbot,
186-
Z: {
186+
'Z (Global)': {
187187
url: 'https://chat.z.ai/'
188+
} as Chatbot,
189+
'Z (China)': {
190+
url: 'https://zchat.z.ai/'
188191
} as Chatbot
189192
}

0 commit comments

Comments
 (0)