@skrillex1224/playwright-toolkit 2.0.86 → 2.0.88
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/dist/index.cjs +140 -17
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +140 -17
- package/dist/index.js.map +4 -4
- package/index.d.ts +50 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -98,10 +98,58 @@ export interface HumanizeModule {
|
|
|
98
98
|
export interface StealthModule {
|
|
99
99
|
syncViewportWithScreen(page: Page): Promise<void>;
|
|
100
100
|
hideWebdriver(page: Page): Promise<void>;
|
|
101
|
-
|
|
101
|
+
getStealthLaunchArgs(): string[];
|
|
102
|
+
getAdvancedStealthArgs(): string[];
|
|
102
103
|
setChinaTimezone(context: BrowserContext): Promise<void>;
|
|
103
104
|
}
|
|
104
105
|
|
|
106
|
+
// =============================================================================
|
|
107
|
+
// Blocking
|
|
108
|
+
// =============================================================================
|
|
109
|
+
|
|
110
|
+
export interface BlockingConfig {
|
|
111
|
+
/** 屏蔽压缩包 */
|
|
112
|
+
blockArchive?: boolean;
|
|
113
|
+
/** 屏蔽可执行文件 */
|
|
114
|
+
blockExecutable?: boolean;
|
|
115
|
+
/** 屏蔽办公文档 */
|
|
116
|
+
blockDocument?: boolean;
|
|
117
|
+
/** 屏蔽图片 */
|
|
118
|
+
blockImage?: boolean;
|
|
119
|
+
/** 屏蔽音视频 */
|
|
120
|
+
blockMedia?: boolean;
|
|
121
|
+
/** 屏蔽字体 */
|
|
122
|
+
blockFont?: boolean;
|
|
123
|
+
/** 屏蔽 CSS (注意:可能影响页面视觉效果) */
|
|
124
|
+
blockCss?: boolean;
|
|
125
|
+
/** 屏蔽其他资源 */
|
|
126
|
+
blockOther?: boolean;
|
|
127
|
+
/** 额外自定义扩展名列表 */
|
|
128
|
+
customExtensions?: string[];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface ExtensionCategory {
|
|
132
|
+
name: string;
|
|
133
|
+
extensions: string[];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface ExtensionCategories {
|
|
137
|
+
archive: ExtensionCategory;
|
|
138
|
+
executable: ExtensionCategory;
|
|
139
|
+
document: ExtensionCategory;
|
|
140
|
+
image: ExtensionCategory;
|
|
141
|
+
media: ExtensionCategory;
|
|
142
|
+
font: ExtensionCategory;
|
|
143
|
+
css: ExtensionCategory;
|
|
144
|
+
other: ExtensionCategory;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface BlockingModule {
|
|
148
|
+
getBlockedExtensions(config?: BlockingConfig): string[];
|
|
149
|
+
setupBlockingResources(page: Page, config?: BlockingConfig): Promise<void>;
|
|
150
|
+
getExtensionCategories(): ExtensionCategories;
|
|
151
|
+
}
|
|
152
|
+
|
|
105
153
|
// =============================================================================
|
|
106
154
|
// Launch
|
|
107
155
|
// =============================================================================
|
|
@@ -205,6 +253,7 @@ export interface PlaywrightToolKit {
|
|
|
205
253
|
Captcha: CaptchaModule;
|
|
206
254
|
Sse: SseModule;
|
|
207
255
|
Errors: ErrorsModule;
|
|
256
|
+
Blocking: BlockingModule;
|
|
208
257
|
}
|
|
209
258
|
|
|
210
259
|
export declare function usePlaywrightToolKit(): PlaywrightToolKit;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skrillex1224/playwright-toolkit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.88",
|
|
4
4
|
"description": "一个在 Apify/Crawlee Actor 中启用实时截图视图的实用工具库。",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "node build.js",
|
|
18
|
-
"release": "npm run build && npm version patch && npm publish",
|
|
18
|
+
"release": "npm run build && npm version patch && npm publish --registry https://registry.npmjs.org",
|
|
19
19
|
"prepublishOnly": "npm run build",
|
|
20
20
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
21
21
|
},
|