dsh-web-fetch-playwright 0.2.3 → 0.2.5
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/README.md +18 -2
- package/README.zh-CN.md +18 -2
- package/dsh.plugin.json +1 -1
- package/lib/client.js +52 -27
- package/lib/index.js +451 -15
- package/lib/types/challenge.d.ts +83 -0
- package/lib/types/client/controller.d.ts +7 -0
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/config.d.ts +42 -0
- package/lib/types/index.d.ts +4 -2
- package/lib/types/markdown.d.ts +2 -0
- package/lib/types/provider.d.ts +44 -1
- package/lib/types/types.d.ts +29 -0
- package/package.json +9 -7
- package/src/challenge.ts +216 -0
- package/src/client/card.tsx +13 -0
- package/src/client/controller.ts +9 -0
- package/src/client/locales.ts +7 -0
- package/src/config.ts +57 -0
- package/src/index.ts +4 -2
- package/src/markdown.ts +55 -0
- package/src/provider.ts +223 -10
- package/src/types.ts +30 -0
package/README.md
CHANGED
|
@@ -9,12 +9,13 @@ A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) plug
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
11
|
- **Real browser rendering** — loads the page the way a user sees it, so client-side rendered (SPA) content is captured, not just the raw HTML.
|
|
12
|
-
- **Denoise pipeline** — Mozilla Readability extracts the article, DOMPurify removes layout/noise tags (nav, sidebar, footer, ads, forms), and Turndown with the GFM plugin converts to Markdown with the same style options as the shipped `tool-web` renderer.
|
|
12
|
+
- **Denoise pipeline** — Mozilla Readability extracts the article, DOMPurify removes layout/noise tags (nav, sidebar, footer, ads, forms), and Turndown with the GFM plugin converts to Markdown with the same style options as the shipped `tool-web` renderer. Inline `data:` images (build tools like Docusaurus embed screenshots as base64) are elided to size placeholders such as `` so they cannot flood the body.
|
|
13
13
|
- **Two backends** — launch a local Playwright browser, or drive an already-running browser over its DevTools Protocol (CDP) endpoint.
|
|
14
14
|
- **Browser resolution** — a configured path, a `playwright` CLI on `$PATH`, or the bundled `playwright-core`; CDP needs no local browser at all.
|
|
15
15
|
- **Isolated or profile sessions (CDP)** — every fetch is scoped to exactly one tab. Local launches close their browser per fetch; the CDP backend keeps **one shared connection** to the remote browser and each fetch opens a tab inside it, closed when done. By default that tab lives in the remote browser's **real profile** (its cookies, localStorage, and persistent logins apply — like `playwright-cli open`); unchecking *Share the browser context* switches to a throwaway isolated context per fetch.
|
|
16
16
|
- **Live configuration** — a settings card (设置 → 插件 → 插件配置) edits the backend, context mode, denoise toggle, and concurrency; changes apply to the next fetch without a restart.
|
|
17
17
|
- **Budget-aware** — per-fetch deadline (45s); concurrency is backend-priced (`maxConcurrency`, default 4 local browsers / **50 CDP tabs**; queued fetches fail fast with a retry hint after 20s instead of hanging); image/font/media subrequests aborted; body capped at 100k chars.
|
|
18
|
+
- **Bounded Cloudflare-challenge wait** — when a navigation lands on a challenge interstitial ("Just a moment…" and its localized siblings, recognized via the documented `cf-mitigated: challenge` response header plus structural page markers), the fetch keeps the **same tab and context** and waits for the browser's own verification to clear it — tracking the *last* main-frame response (the real page reloads in) and watching the live DOM so SPA-style clears are caught too. Bounded and configurable (`challengeWaitMs`, default 15s; 0 restores the legacy first-response behavior), with a bounded same-tab retry (`challengeRetries`, default 1). When the budget runs out, the fetch fails with the distinct `WEB_FETCH_CHALLENGE` error code instead of returning the interstitial as content. It never clicks, never injects CAPTCHA answers, never fakes browser state, and never exports or copies cookies.
|
|
18
19
|
|
|
19
20
|
## How it works
|
|
20
21
|
|
|
@@ -29,7 +30,7 @@ web_fetch (tool-web)
|
|
|
29
30
|
├─ local: resolve (path → $PATH → bundled playwright-core) → chromium.launch
|
|
30
31
|
├─ cdp: connectOverCDP(endpoint)
|
|
31
32
|
├─ page.goto → settle (networkidle, best-effort) → page.content()
|
|
32
|
-
├─ denoise: jsdom → Readability → DOMPurify → Turndown(GFM)
|
|
33
|
+
├─ denoise: jsdom → elide data-URI images → Readability → DOMPurify → Turndown(GFM)
|
|
33
34
|
└─ Markdown (or raw HTML when denoise is off)
|
|
34
35
|
```
|
|
35
36
|
|
|
@@ -71,6 +72,8 @@ The settings card (设置 → 插件 → 插件配置 → *Playwright 网页爬
|
|
|
71
72
|
| `shareBrowserContext` | `true` | CDP backend only. **Checked (profile mode)**: each fetch is a tab in the remote browser's default context — its real profile — so cookies/localStorage are shared and its persistent logins apply; only the tab closes when the fetch ends. **Unchecked (isolated mode)**: a fresh incognito-like context per fetch, nothing shared. Local backend ignores this field. |
|
|
72
73
|
| `denoise` | `true` | Run the denoise pipeline; off returns the full rendered HTML for the tool layer to convert. |
|
|
73
74
|
| `maxConcurrency` | *(auto)* | How many fetches may render at once (1–200). Blank = backend default: **4** for local (each slot launches a browser) / **50** for CDP (each slot is just a tab in the already-running remote browser). Beyond the limit, fetches wait briefly; if no slot frees within 20s they fail with `WEB_FETCH_TIMEOUT` and a hint to retry or raise this setting, rather than hanging until the tool budget aborts. |
|
|
75
|
+
| `challengeWaitMs` | `15000` | Bounded wait (ms, 0–60000) for a Cloudflare challenge to clear naturally in the same tab. `0` disables the whole challenge path — the first response is returned as-is (the pre-0.2.5 behavior). |
|
|
76
|
+
| `challengeRetries` | `1` | Same-tab re-navigation attempts after a wait window runs out (0–3); any clearance cookies the browser earned stay in the context for the retry. Everything stays inside the 45s per-fetch deadline. |
|
|
74
77
|
|
|
75
78
|
Local backend resolution order:
|
|
76
79
|
|
|
@@ -98,6 +101,19 @@ google-chrome --remote-debugging-port=9222 --user-data-dir="$HOME/.config/chrome
|
|
|
98
101
|
|
|
99
102
|
Headless server (pre-seed logins in a headful environment first): `chromium --headless=new --remote-debugging-port=9222 --user-data-dir=/data/chrome-dsh-profile`. Do **not** add `--incognito` or a throwaway user-data-dir — either defeats profile mode. Design notes and verified playwright-core facts live in [`docs/context-mode-profile.md`](./docs/context-mode-profile.md).
|
|
100
103
|
|
|
104
|
+
### Cloudflare challenge handling (bounded natural wait)
|
|
105
|
+
|
|
106
|
+
Some strict sites serve a Cloudflare interstitial before the real page. A real browser often passes the check on its own within a few seconds — but a fetch that only looks at the first response hands you the interstitial as if it were the page (the pre-0.2.5 behavior; reproduce it any time with `challengeWaitMs: 0`, or — from a repo checkout, after `pnpm build` — run `node scripts/challenge-demo.mjs` for a local simulated before/after, and `node scripts/challenge-online.mjs <url>` against a real site).
|
|
107
|
+
|
|
108
|
+
With the wait on (default):
|
|
109
|
+
|
|
110
|
+
1. **Detection** — a response carrying `cf-mitigated: challenge` (the documented signal for every challenge page type), or a 403/503 HTML document from a `server: cloudflare` edge, or the localized interstitial itself (title family like "Just a moment…", `请稍候…`, "Минутку…", plus structural markers: `/cdn-cgi/challenge-platform/` scripts, `#challenge-*` elements, `cf-chl-widget-` frames, `window._cf_chl_opt`). The content-level markers are the *fallback tier* and only run on challenge-compatible responses — 403/429/503 or a Cloudflare edge (`server: cloudflare` / `cf-ray`) — because interstitials never ship as a plain 200, so an ordinary article that merely quotes challenge text can never be mistaken for one. A hard block ("Sorry, you have been blocked") is classified separately and fails immediately.
|
|
111
|
+
2. **Bounded wait, same tab and context** — the fetch polls the live DOM (500ms interval) for the challenge to disappear while the browser runs its own verification; the *last* main-frame navigation response is tracked so the reloaded real document's status and headers are the ones reported. SPA-style clears (content swapped without any navigation) are caught by the same DOM probe.
|
|
112
|
+
3. **Bounded retry** — when a window runs out, the same tab re-navigates once (default; `challengeRetries`) with whatever clearance cookies the context already holds.
|
|
113
|
+
4. **Clear failure** — `WEB_FETCH_CHALLENGE` (a provider-specific code the web seam's open-string `code` allows) naming the site, the budget spent, and the last challenge status.
|
|
114
|
+
|
|
115
|
+
Security boundary (deliberate): no clicking through Turnstile, no CAPTCHA solving or token injection, no fingerprint/UA spoofing, no proxy rotation, and no cookie export — in isolated mode the clearance a fetch's browser earns dies with that fetch's context; in profile mode it stays in the remote browser's own profile, which this plugin never copies or cleans. The wait is always bounded by `challengeWaitMs` and the 45s per-fetch deadline; nothing blocks forever.
|
|
116
|
+
|
|
101
117
|
## Development
|
|
102
118
|
|
|
103
119
|
```sh
|
package/README.zh-CN.md
CHANGED
|
@@ -9,12 +9,13 @@
|
|
|
9
9
|
## 特性
|
|
10
10
|
|
|
11
11
|
- **真实浏览器渲染** —— 以用户视角加载页面,SPA 客户端渲染内容也能抓到,而非只有原始 HTML。
|
|
12
|
-
- **降噪管线** —— Mozilla Readability 提取正文,DOMPurify 移除布局/噪音标签(导航、侧边栏、页脚、广告、表单),Turndown + GFM 插件按与内置 `tool-web` 渲染器一致的风格转成 Markdown
|
|
12
|
+
- **降噪管线** —— Mozilla Readability 提取正文,DOMPurify 移除布局/噪音标签(导航、侧边栏、页脚、广告、表单),Turndown + GFM 插件按与内置 `tool-web` 渲染器一致的风格转成 Markdown。内联 `data:` 图片(Docusaurus 等构建工具会把截图以 base64 内嵌进 HTML)会被替换为带大小的占位符,如 ``,避免 base64 字符流刷屏。
|
|
13
13
|
- **两种后端** —— 本地启动 Playwright 浏览器,或通过 DevTools 协议(CDP)驱动一个已在运行的浏览器。
|
|
14
14
|
- **浏览器解析** —— 配置路径 → `$PATH` 上的 `playwright` CLI → 插件自带的 `playwright-core`;CDP 模式完全不需要本地浏览器。
|
|
15
15
|
- **共享或隔离会话(CDP)** —— 每次抓取严格限定为一个标签页。本地后端每次抓取启动并关闭自己的浏览器;CDP 后端对远端浏览器保持**一条共享连接**,每次抓取只在其里开一个标签页、用完即关。默认该标签页位于远端浏览器的**真实 profile**(沿用其 cookie、localStorage 与已登录会话,效果类似 `playwright-cli open`);取消勾选「共享浏览器上下文」则切换为每次抓取全新隔离 context。
|
|
16
16
|
- **热配置** —— 「设置 → 插件 → 插件配置」卡片可随时切换后端、上下文模式、降噪开关与并发数,改动对下一次抓取即时生效,无需重启。
|
|
17
17
|
- **预算控制** —— 单次抓取 45s 超时;并发按后端定价(`maxConcurrency`,默认本地 4 个浏览器 / **CDP 50 个标签页**;排队的抓取等不到空位会在 20s 内尽快报错并提示重试,而不是一直挂到被工具层中止);拦截图片/字体/媒体子请求;返回体 10 万字符封顶。
|
|
18
|
+
- **Cloudflare 挑战有界等待** —— 导航落到验证中间页("Just a moment…" 及其多语言同族,通过官方 `cf-mitigated: challenge` 响应头 + 结构性页面标记识别)时,抓取保持**同一标签页与上下文**,等待浏览器自行通过验证:跟踪*最后一次*主 frame 响应(真实页面随后重载进来),并轮询活 DOM 以捕获 SPA 式清除。有界且可配置(`challengeWaitMs`,默认 15s;`0` 恢复旧版首响应行为),附带同标签页有界重试(`challengeRetries`,默认 1)。预算耗尽时以独立的 `WEB_FETCH_CHALLENGE` 错误码明确失败,而不是把中间页当正文返回。全程不点击、不注入验证码答案、不伪造浏览器状态、不导出或复制 cookie。
|
|
18
19
|
|
|
19
20
|
## 工作原理
|
|
20
21
|
|
|
@@ -29,7 +30,7 @@ web_fetch (tool-web)
|
|
|
29
30
|
├─ local: 解析(路径 → $PATH → 内置 playwright-core)→ chromium.launch
|
|
30
31
|
├─ cdp: connectOverCDP(endpoint)
|
|
31
32
|
├─ page.goto → 等待稳定(networkidle,尽力而为)→ page.content()
|
|
32
|
-
├─ 降噪:jsdom → Readability → DOMPurify → Turndown(GFM)
|
|
33
|
+
├─ 降噪:jsdom → 内联 data: 图片改占位符 → Readability → DOMPurify → Turndown(GFM)
|
|
33
34
|
└─ Markdown(关闭降噪时返回原始 HTML)
|
|
34
35
|
```
|
|
35
36
|
|
|
@@ -71,6 +72,8 @@ bundle 插件加入 profile 层栈后需**重启 `dsh web`** 生效;卸载用
|
|
|
71
72
|
| `shareBrowserContext` | `true` | 仅 CDP 后端。**勾选(profile 模式)**:每次抓取是远端浏览器默认 context(真实 profile)里的一个标签页,cookie/localStorage 与之互通、已登录会话直接生效,抓取结束只关标签页;**取消勾选(隔离模式)**:每次抓取使用全新隐身式 context,互不共享。本地后端忽略此字段。 |
|
|
72
73
|
| `denoise` | `true` | 是否启用降噪;关闭时返回整页渲染 HTML,交由工具层转换。 |
|
|
73
74
|
| `maxConcurrency` | *(自动)* | 同时渲染的页面上限(1–200)。留空按后端取默认:本地 **4**(每个槽位启动一个浏览器)/ CDP **50**(远端浏览器已就位,每个槽位只是一个标签页)。超出的请求短暂排队;20s 内等不到空位则以 `WEB_FETCH_TIMEOUT` 尽快失败并提示重试或调大该值,而不是一直挂起直到工具层预算中止。 |
|
|
75
|
+
| `challengeWaitMs` | `15000` | Cloudflare 挑战的**有界**自然等待上限(毫秒,0–60000),在同一标签页内等待浏览器自行通过验证。`0` 关闭整条挑战处理链路——直接返回首次响应(0.2.5 之前的旧行为)。 |
|
|
76
|
+
| `challengeRetries` | `1` | 一个等待窗口耗尽后的**同标签页**重新导航次数(0–3);浏览器已拿到的通关 cookie 留在上下文里供重试使用。总耗时始终受 45s 单次抓取预算约束。 |
|
|
74
77
|
|
|
75
78
|
本地后端解析顺序:
|
|
76
79
|
|
|
@@ -98,6 +101,19 @@ google-chrome --remote-debugging-port=9222 --user-data-dir="$HOME/.config/chrome
|
|
|
98
101
|
|
|
99
102
|
无头服务器(先在有头环境预置登录态):`chromium --headless=new --remote-debugging-port=9222 --user-data-dir=/data/chrome-dsh-profile`。**不要**叠加 `--incognito` 或一次性 user-data-dir——都会让 profile 模式失效。设计依据与已核实的 playwright-core 源码事实见 [`docs/context-mode-profile.md`](./docs/context-mode-profile.md)。
|
|
100
103
|
|
|
104
|
+
### Cloudflare 挑战处理(有界自然等待)
|
|
105
|
+
|
|
106
|
+
部分严格站点会在返回真实页面前先给一个 Cloudflare 验证中间页。真实浏览器通常几秒内就能**自行**通过验证;但只看第一次响应的抓取会把中间页当成正文返回(0.2.5 之前的旧行为;把 `challengeWaitMs` 设为 `0` 可随时复现,或在仓库检出、执行 `pnpm build` 后运行 `node scripts/challenge-demo.mjs` 看本地模拟站点的前后对比、`node scripts/challenge-online.mjs <url>` 对真实站点做在线对比)。
|
|
107
|
+
|
|
108
|
+
开启等待(默认)后的流程:
|
|
109
|
+
|
|
110
|
+
1. **识别** —— 响应带 `cf-mitigated: challenge`(Cloudflare 官方文档注明所有挑战页类型都带此头),或 403/503 且 `server: cloudflare` 的 HTML 文档,或本地化的中间页本身("Just a moment…" / "请稍候…" / "Минутку…" 等 title 家族,以及结构性标记:`/cdn-cgi/challenge-platform/` 脚本、`#challenge-*` 元素、`cf-chl-widget-` 框架、`window._cf_chl_opt`)。内容级标记只是**兜底层**,且仅对"挑战兼容"的响应(403/429/503 或来自 Cloudflare 边缘——`server: cloudflare` / `cf-ray`)运行——因为中间页从不会以普通 200 返回,所以正文里引用了挑战文案的普通文章绝不可能被误判。硬封锁页("Sorry, you have been blocked")单独分类并立即失败——等待无法解除。
|
|
111
|
+
2. **同标签页、同上下文的有界等待** —— 每 500ms 轮询活 DOM,等浏览器跑完自己的验证;同时跟踪**最后一次主 frame 导航响应**,所以重载进来的真实文档的状态码和响应头才是最终上报的。SPA 式清除(无导航、纯内容替换)由同一个 DOM 探测捕获。
|
|
112
|
+
3. **有界重试** —— 窗口耗尽后,同一标签页默认再导航一次(`challengeRetries`),上下文里已有的通关 cookie 继续生效。
|
|
113
|
+
4. **明确失败** —— 返回独立的 `WEB_FETCH_CHALLENGE` 错误码(web seam 的 `code` 是开放字符串,允许 provider 专属码),消息中写明站点、等待预算与最后一次挑战响应的状态。
|
|
114
|
+
|
|
115
|
+
安全边界(刻意为之):不点击 Turnstile、不解验证码、不注入 token、不伪装指纹/UA、不轮换代理、不导出 cookie——隔离模式下本次抓取挣到的通关态随其 context 一起销毁;profile 模式下它留在远端浏览器自己的 profile 里,插件从不复制或清理。等待始终受 `challengeWaitMs` 与 45s 单次抓取预算双重约束,永不无限阻塞。
|
|
116
|
+
|
|
101
117
|
## 开发
|
|
102
118
|
|
|
103
119
|
```sh
|
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-web-fetch-playwright",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Playwright/CDP web-fetch provider for DeepSeek Harness: renders pages in a real browser, denoises them (Readability + DOMPurify), and returns markdown.",
|
|
5
5
|
"entry": {
|
|
6
6
|
"name": "dsh-web-fetch-playwright",
|
package/lib/client.js
CHANGED
|
@@ -350,7 +350,8 @@ window.__ModuleLoader__.load({
|
|
|
350
350
|
textField("cdpEndpoint"),
|
|
351
351
|
checkboxField("shareBrowserContext"),
|
|
352
352
|
checkboxField("denoise"),
|
|
353
|
-
numberField("maxConcurrency", 1, 200)
|
|
353
|
+
numberField("maxConcurrency", 1, 200),
|
|
354
|
+
numberField("challengeWaitMs", 0, 6e4)
|
|
354
355
|
]);
|
|
355
356
|
this.store = this.form.bind(() => this.projection());
|
|
356
357
|
}
|
|
@@ -362,7 +363,8 @@ window.__ModuleLoader__.load({
|
|
|
362
363
|
cdpEndpoint: this.form.field("cdpEndpoint"),
|
|
363
364
|
shareBrowserContext: this.form.field("shareBrowserContext"),
|
|
364
365
|
denoise: this.form.field("denoise"),
|
|
365
|
-
maxConcurrency: this.form.field("maxConcurrency")
|
|
366
|
+
maxConcurrency: this.form.field("maxConcurrency"),
|
|
367
|
+
challengeWaitMs: this.form.field("challengeWaitMs")
|
|
366
368
|
};
|
|
367
369
|
}
|
|
368
370
|
/**
|
|
@@ -388,21 +390,21 @@ window.__ModuleLoader__.load({
|
|
|
388
390
|
document.head.appendChild(tag);
|
|
389
391
|
}
|
|
390
392
|
var PluginCard_module_css_default = {
|
|
391
|
-
"
|
|
392
|
-
"
|
|
393
|
-
"readOnly": "UM8-Rq_readOnly",
|
|
393
|
+
"footer": "UM8-Rq_footer",
|
|
394
|
+
"pending": "UM8-Rq_pending",
|
|
394
395
|
"discard": "UM8-Rq_discard",
|
|
396
|
+
"cardOpen": "UM8-Rq_cardOpen",
|
|
395
397
|
"headText": "UM8-Rq_headText",
|
|
396
|
-
"
|
|
398
|
+
"card": "UM8-Rq_card",
|
|
399
|
+
"chevronOpen": "UM8-Rq_chevronOpen",
|
|
400
|
+
"body": "UM8-Rq_body",
|
|
397
401
|
"description": "UM8-Rq_description",
|
|
398
|
-
"footer": "UM8-Rq_footer",
|
|
399
|
-
"chevron": "UM8-Rq_chevron",
|
|
400
402
|
"failed": "UM8-Rq_failed",
|
|
401
|
-
"
|
|
403
|
+
"header": "UM8-Rq_header",
|
|
402
404
|
"name": "UM8-Rq_name",
|
|
403
|
-
"
|
|
404
|
-
"
|
|
405
|
-
"
|
|
405
|
+
"save": "UM8-Rq_save",
|
|
406
|
+
"chevron": "UM8-Rq_chevron",
|
|
407
|
+
"readOnly": "UM8-Rq_readOnly"
|
|
406
408
|
};
|
|
407
409
|
//#endregion
|
|
408
410
|
//#region src/client/PluginCard.tsx
|
|
@@ -520,25 +522,25 @@ window.__ModuleLoader__.load({
|
|
|
520
522
|
}
|
|
521
523
|
var fields_module_css_default = {
|
|
522
524
|
"radioContent": "CFSaVG_radioContent",
|
|
523
|
-
"field": "CFSaVG_field",
|
|
524
|
-
"invalid": "CFSaVG_invalid",
|
|
525
|
-
"hint": "CFSaVG_hint",
|
|
526
|
-
"head": "CFSaVG_head",
|
|
527
525
|
"hintIndented": "CFSaVG_hintIndented",
|
|
528
|
-
"
|
|
529
|
-
"
|
|
530
|
-
"radioHint": "CFSaVG_radioHint",
|
|
531
|
-
"checkboxRow": "CFSaVG_checkboxRow",
|
|
526
|
+
"radioGroup": "CFSaVG_radioGroup",
|
|
527
|
+
"input": "CFSaVG_input",
|
|
532
528
|
"radioLabel": "CFSaVG_radioLabel",
|
|
533
|
-
"
|
|
534
|
-
"
|
|
535
|
-
"radioOption": "CFSaVG_radioOption",
|
|
529
|
+
"radioPick": "CFSaVG_radioPick",
|
|
530
|
+
"badges": "CFSaVG_badges",
|
|
536
531
|
"badge": "CFSaVG_badge",
|
|
532
|
+
"fieldEmbedded": "CFSaVG_fieldEmbedded",
|
|
533
|
+
"hint": "CFSaVG_hint",
|
|
534
|
+
"reset": "CFSaVG_reset",
|
|
535
|
+
"field": "CFSaVG_field",
|
|
536
|
+
"head": "CFSaVG_head",
|
|
537
|
+
"checkboxRow": "CFSaVG_checkboxRow",
|
|
537
538
|
"label": "CFSaVG_label",
|
|
538
|
-
"
|
|
539
|
-
"
|
|
540
|
-
"
|
|
541
|
-
"
|
|
539
|
+
"radioOption": "CFSaVG_radioOption",
|
|
540
|
+
"invalid": "CFSaVG_invalid",
|
|
541
|
+
"radioHint": "CFSaVG_radioHint",
|
|
542
|
+
"inputInvalid": "CFSaVG_inputInvalid",
|
|
543
|
+
"radioText": "CFSaVG_radioText"
|
|
542
544
|
};
|
|
543
545
|
//#endregion
|
|
544
546
|
//#region src/client/fields.tsx
|
|
@@ -825,6 +827,23 @@ window.__ModuleLoader__.load({
|
|
|
825
827
|
onReset: () => {
|
|
826
828
|
props.resetField("maxConcurrency");
|
|
827
829
|
}
|
|
830
|
+
}),
|
|
831
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
|
|
832
|
+
id: "plugin-config-playwright-challenge-wait",
|
|
833
|
+
label: t("challengeWaitMs"),
|
|
834
|
+
hint: t("challengeWaitMsHint"),
|
|
835
|
+
placeholder: t("challengeWaitMsPlaceholder"),
|
|
836
|
+
overriddenLabel: t("overridden"),
|
|
837
|
+
resetLabel: t("reset"),
|
|
838
|
+
invalidLabel: t("invalidText"),
|
|
839
|
+
disabled,
|
|
840
|
+
...state.challengeWaitMs,
|
|
841
|
+
onEdit: (text) => {
|
|
842
|
+
props.edit("challengeWaitMs", text);
|
|
843
|
+
},
|
|
844
|
+
onReset: () => {
|
|
845
|
+
props.resetField("challengeWaitMs");
|
|
846
|
+
}
|
|
828
847
|
})
|
|
829
848
|
]
|
|
830
849
|
});
|
|
@@ -852,6 +871,9 @@ window.__ModuleLoader__.load({
|
|
|
852
871
|
maxConcurrency: "Max concurrent fetches",
|
|
853
872
|
maxConcurrencyHint: "How many pages may render at once (1–200). Blank = auto: 4 local browsers, 50 CDP tabs in the remote browser.",
|
|
854
873
|
maxConcurrencyPlaceholder: "(auto: local 4 / CDP 50)",
|
|
874
|
+
challengeWaitMs: "Cloudflare challenge wait (ms)",
|
|
875
|
+
challengeWaitMsHint: "Bounded wait for a Cloudflare challenge to clear naturally in the same tab (0–60000; 0 = off). 0 disables: the first response is returned as-is.",
|
|
876
|
+
challengeWaitMsPlaceholder: "(default: 15000)",
|
|
855
877
|
overridden: "Overridden",
|
|
856
878
|
reset: "Reset to default",
|
|
857
879
|
readOnly: "This deployment stores settings read-only.",
|
|
@@ -885,6 +907,9 @@ window.__ModuleLoader__.load({
|
|
|
885
907
|
maxConcurrency: "最大并发抓取数",
|
|
886
908
|
maxConcurrencyHint: "同时渲染的页面上限(1–200);留空自动:本地 4 个浏览器,CDP 在远端浏览器里 50 个标签页。",
|
|
887
909
|
maxConcurrencyPlaceholder: "(自动:本地 4 / CDP 50)",
|
|
910
|
+
challengeWaitMs: "Cloudflare 挑战等待上限(毫秒)",
|
|
911
|
+
challengeWaitMsHint: "在同一标签页内有界等待 Cloudflare 验证自然通过(0–60000;0 = 关闭)。关闭时直接返回首次响应——旧版行为。",
|
|
912
|
+
challengeWaitMsPlaceholder: "(默认:15000)",
|
|
888
913
|
overridden: "已覆盖",
|
|
889
914
|
reset: "恢复默认",
|
|
890
915
|
readOnly: "本部署的设置为只读。",
|