@skrillex1224/playwright-toolkit 2.1.22 → 2.1.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 +11 -17
- package/dist/index.cjs +246 -162
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +246 -162
- package/dist/index.js.map +3 -3
- package/index.d.ts +28 -10
- package/package.json +2 -4
package/index.d.ts
CHANGED
|
@@ -93,15 +93,35 @@ export interface HumanizeModule {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
// =============================================================================
|
|
96
|
-
//
|
|
96
|
+
// AntiDetect
|
|
97
97
|
// =============================================================================
|
|
98
|
-
export interface
|
|
98
|
+
export interface AntiDetectConfig {
|
|
99
|
+
locale: string;
|
|
100
|
+
acceptLanguage: string;
|
|
101
|
+
timezoneId: string;
|
|
102
|
+
timezoneOffset: number;
|
|
103
|
+
geolocation: { latitude: number; longitude: number; accuracy?: number } | null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface AntiDetectApplyOptions {
|
|
107
|
+
locale?: string;
|
|
108
|
+
acceptLanguage?: string;
|
|
109
|
+
timezoneId?: string;
|
|
110
|
+
timezoneOffset?: number;
|
|
111
|
+
geolocation?: { latitude: number; longitude: number; accuracy?: number } | null;
|
|
112
|
+
permissions?: string[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface AntiDetectModule {
|
|
116
|
+
getBaseConfig(): AntiDetectConfig;
|
|
117
|
+
getFingerprintGeneratorOptions(): Record<string, any>;
|
|
118
|
+
getLaunchArgs(): string[];
|
|
119
|
+
getAdvancedLaunchArgs(): string[];
|
|
120
|
+
applyContext(context: BrowserContext, options?: AntiDetectApplyOptions): Promise<void>;
|
|
121
|
+
applyPage(page: Page, options?: AntiDetectApplyOptions): Promise<void>;
|
|
99
122
|
syncViewportWithScreen(page: Page): Promise<void>;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
getAdvancedStealthArgs(): string[];
|
|
103
|
-
setChinaTimezone(context: BrowserContext): Promise<void>;
|
|
104
|
-
getTlsFingerprintOptions(userAgent?: string): Record<string, any>;
|
|
123
|
+
getTlsFingerprintOptions(userAgent?: string, acceptLanguage?: string): Record<string, any>;
|
|
124
|
+
applyLocaleHeaders(headers: Record<string, string>, acceptLanguage?: string): Record<string, string>;
|
|
105
125
|
}
|
|
106
126
|
|
|
107
127
|
// =============================================================================
|
|
@@ -171,7 +191,6 @@ export interface LaunchOptions {
|
|
|
171
191
|
}
|
|
172
192
|
|
|
173
193
|
export interface LaunchModule {
|
|
174
|
-
createStealthChromium(chromium: any, stealthPlugin: any): any;
|
|
175
194
|
getAdvancedLaunchOptions(): LaunchOptions;
|
|
176
195
|
getLaunchOptions(): LaunchOptions;
|
|
177
196
|
getFingerprintGeneratorOptions(): Record<string, any>;
|
|
@@ -254,7 +273,7 @@ export interface UtilsModule {
|
|
|
254
273
|
// =============================================================================
|
|
255
274
|
export interface PlaywrightToolKit {
|
|
256
275
|
ApifyKit: ApifyKitModule;
|
|
257
|
-
|
|
276
|
+
AntiDetect: AntiDetectModule;
|
|
258
277
|
Humanize: HumanizeModule;
|
|
259
278
|
Launch: LaunchModule;
|
|
260
279
|
LiveView: LiveViewModule;
|
|
@@ -267,4 +286,3 @@ export interface PlaywrightToolKit {
|
|
|
267
286
|
}
|
|
268
287
|
|
|
269
288
|
export declare function usePlaywrightToolKit(): PlaywrightToolKit;
|
|
270
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skrillex1224/playwright-toolkit",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.23",
|
|
4
4
|
"description": "一个在 Apify/Crawlee Actor 中启用实时截图视图的实用工具库。",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -44,9 +44,7 @@
|
|
|
44
44
|
"crawlee": "*",
|
|
45
45
|
"delay": "*",
|
|
46
46
|
"ghost-cursor-playwright": "*",
|
|
47
|
-
"playwright": "*"
|
|
48
|
-
"playwright-extra": "*",
|
|
49
|
-
"puppeteer-extra-plugin-stealth": "*"
|
|
47
|
+
"playwright": "*"
|
|
50
48
|
},
|
|
51
49
|
"devDependencies": {
|
|
52
50
|
"esbuild": "^0.24.2"
|