magpie-marvis 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -1
- package/package.json +1 -1
- package/src/marvis/browser.mjs +11 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
> 每个版本一节,**一条一行**,说用户能感知的变化。
|
|
4
4
|
> 格式与规矩见 [UPDATING.md](./UPDATING.md)。
|
|
5
5
|
|
|
6
|
-
## 0.2.
|
|
6
|
+
## 0.2.6 — 2026-11-06
|
|
7
|
+
|
|
8
|
+
**修复**
|
|
9
|
+
|
|
10
|
+
- **UA 换回客户端自己的 Electron UA**(`Marvis/1.60.3300.408 ... Electron/44.7.0`)。
|
|
11
|
+
之前为了「伪装成普通浏览器」用的是纯 Chrome UA —— 服务端很可能就是按这个区分调用方
|
|
12
|
+
- **去掉 `--disable-blink-features=AutomationControlled`**:它会在地址栏下面挂一条
|
|
13
|
+
「你使用的是不受支持的命令行标记」黄色警告条。`navigator.webdriver` 改用 CDP 抹掉
|
|
7
14
|
|
|
8
15
|
**修复**
|
|
9
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "magpie-marvis",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "magpie / OpenCode provider plugin for Tencent Marvis: its DeepSeek V4 Pro, Kimi K2.5, Claude Opus/Sonnet 4.6, GPT-5.4 and Hunyuan models through the Marvis model gateway — no API key to paste, sign in with QQ or WeChat.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|
package/src/marvis/browser.mjs
CHANGED
|
@@ -45,10 +45,16 @@ const WIN_EXES = [
|
|
|
45
45
|
"msedge.exe",
|
|
46
46
|
]
|
|
47
47
|
|
|
48
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* 浏览器 UA —— **必须是 Marvis 客户端自己的 Electron UA**。
|
|
50
|
+
*
|
|
51
|
+
* 一开始我用普通 Chrome UA「伪装身份」,结果服务端一律 `-109 RC_PARAMS_INVALID`。
|
|
52
|
+
* 客户端 BrowserWindow 的真实 UA 是带 `Marvis/<version>` 和 `Electron/<ver>` 的 ——
|
|
53
|
+
* 服务端按它识别调用方,缺了就判参数无效。
|
|
54
|
+
*/
|
|
49
55
|
const CHROME_UA =
|
|
50
56
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) " +
|
|
51
|
-
"Chrome/152.0.
|
|
57
|
+
"Marvis/1.60.3300.408 Chrome/152.0.7977.130 Electron/44.7.0 Safari/537.36"
|
|
52
58
|
|
|
53
59
|
/** Windows 注册表 App Paths 查浏览器;查不到返回空串。 */
|
|
54
60
|
export function registryAppPath(exe) {
|
|
@@ -219,8 +225,9 @@ export async function openIsolatedLogin({ browser, url, match, extraHeaders, tim
|
|
|
219
225
|
"--disable-extensions",
|
|
220
226
|
"--disable-background-networking",
|
|
221
227
|
"--disable-sync",
|
|
222
|
-
//
|
|
223
|
-
|
|
228
|
+
// 去掉自动化痕迹。⚠ 不用 `--disable-blink-features=AutomationControlled` ——
|
|
229
|
+
// 它会在地址栏下面挂一条「你使用的是不受支持的命令行标记」警告条,很扎眼。
|
|
230
|
+
// `navigator.webdriver` 改用 CDP 的 `Page.addScriptToEvaluateOnNewDocument` 抹掉。
|
|
224
231
|
"--exclude-switches=enable-automation",
|
|
225
232
|
`--user-agent=${CHROME_UA}`,
|
|
226
233
|
"--lang=zh-CN",
|