dsh-web-fetch-playwright 0.2.20 → 0.2.23
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 +19 -17
- package/README.zh-CN.md +19 -17
- package/cordis.patch.yml +0 -4
- package/lib/client.js +18 -68
- package/lib/index.js +24049 -22754
- package/lib/types/autoscroll.d.ts +46 -10
- package/lib/types/candidates.d.ts +55 -0
- package/lib/types/challenge.d.ts +2 -2
- package/lib/types/client/controller.d.ts +0 -14
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/config.d.ts +80 -30
- package/lib/types/index.d.ts +1 -1
- package/lib/types/provider.d.ts +101 -9
- package/lib/types/types.d.ts +26 -6
- package/package.json +1 -1
- package/src/autoscroll.ts +459 -17
- package/src/block-model.ts +1 -1
- package/src/candidates.ts +184 -35
- package/src/challenge.ts +2 -2
- package/src/client/card.tsx +0 -26
- package/src/client/controller.ts +0 -18
- package/src/client/locales.ts +0 -14
- package/src/config.ts +97 -37
- package/src/index.ts +4 -1
- package/src/markdown.ts +13 -2
- package/src/provider.ts +482 -56
- package/src/selector-model.ts +1 -1
- package/src/selector.ts +18 -7
- package/src/types.ts +27 -7
package/lib/types/types.d.ts
CHANGED
|
@@ -33,17 +33,18 @@ export interface PlaywrightDownload {
|
|
|
33
33
|
cancel(): Promise<void>;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
* The page's `APIRequestContext` surface the download recovery
|
|
37
|
-
* through — plain HTTP from the
|
|
38
|
-
* and none of Chromium's
|
|
39
|
-
* {@link PlaywrightResponse} because
|
|
40
|
-
* `APIResponse` is for the members this
|
|
41
|
-
* do not exercise the recovery.
|
|
36
|
+
* The page's `APIRequestContext` surface the download recovery and the
|
|
37
|
+
* challenge dead-end fallback refetch through — plain HTTP from the
|
|
38
|
+
* Playwright client, the context's cookie jar, and none of Chromium's
|
|
39
|
+
* render-or-download semantics. Reuses {@link PlaywrightResponse} because
|
|
40
|
+
* that is structurally what an `APIResponse` is for the members this
|
|
41
|
+
* plugin reads. Absent on fakes that do not exercise the recovery.
|
|
42
42
|
*/
|
|
43
43
|
export interface PlaywrightRequestContext {
|
|
44
44
|
get(url: string, options?: {
|
|
45
45
|
timeout?: number;
|
|
46
46
|
signal?: AbortSignal;
|
|
47
|
+
headers?: Record<string, string>;
|
|
47
48
|
}): Promise<PlaywrightResponse>;
|
|
48
49
|
}
|
|
49
50
|
/** The request side of a response, for main-frame filtering. */
|
|
@@ -55,6 +56,14 @@ export interface PlaywrightRequest {
|
|
|
55
56
|
/** The frame that issued the request; compare with `page.mainFrame()`. */
|
|
56
57
|
frame?(): unknown;
|
|
57
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* A network request notification, as `page.on('request')` and its settled
|
|
61
|
+
* siblings deliver it. Identity only — the settle's network-quiet tracker
|
|
62
|
+
* keys its open-request map on the object itself.
|
|
63
|
+
*/
|
|
64
|
+
export interface PlaywrightWebRequest {
|
|
65
|
+
url?(): string;
|
|
66
|
+
}
|
|
58
67
|
/** A page inside a context. */
|
|
59
68
|
export interface PlaywrightPage {
|
|
60
69
|
goto(url: string, options?: {
|
|
@@ -80,6 +89,17 @@ export interface PlaywrightPage {
|
|
|
80
89
|
* document). Absent on minimal fakes (content polling covers them).
|
|
81
90
|
*/
|
|
82
91
|
on?(event: 'response', listener: (response: PlaywrightResponse) => void): unknown;
|
|
92
|
+
/**
|
|
93
|
+
* Request-start notification — the settle's network-quiet tracker. Absent
|
|
94
|
+
* on minimal fakes (the settle falls back to the legacy bounded
|
|
95
|
+
* networkidle wait).
|
|
96
|
+
*/
|
|
97
|
+
on?(event: 'request', listener: (request: PlaywrightWebRequest) => void): unknown;
|
|
98
|
+
/**
|
|
99
|
+
* Request-settled notification (finished or failed) — closes the tracker's
|
|
100
|
+
* open-request bookkeeping. Absent on minimal fakes.
|
|
101
|
+
*/
|
|
102
|
+
on?(event: 'requestfinished' | 'requestfailed', listener: (request: PlaywrightWebRequest) => void): unknown;
|
|
83
103
|
/**
|
|
84
104
|
* Download notification — a navigation the browser handed to its download
|
|
85
105
|
* manager instead of committing a document (`Content-Disposition:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-web-fetch-playwright",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.23",
|
|
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
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|