@skrillex1224/playwright-toolkit 2.1.134 → 2.1.136

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/index.d.ts CHANGED
@@ -272,8 +272,29 @@ export interface BlockingConfig {
272
272
  blockCss?: boolean;
273
273
  /** 屏蔽其他资源 */
274
274
  blockOther?: boolean;
275
- /** 额外自定义扩展名列表 */
276
- customExtensions?: string[];
275
+ }
276
+
277
+ export interface DirectExtensionConfig {
278
+ /** 需要直连的域名列表(推荐使用该字段) */
279
+ domains?: string[];
280
+ /** 直连压缩包 */
281
+ directAllArchive?: boolean;
282
+ /** 直连可执行文件 */
283
+ directAllExecutable?: boolean;
284
+ /** 直连办公文档 */
285
+ directAllDocument?: boolean;
286
+ /** 直连图片 */
287
+ directAllImage?: boolean;
288
+ /** 直连音视频 */
289
+ directAllMedia?: boolean;
290
+ /** 直连字体 */
291
+ directAllFont?: boolean;
292
+ /** 直连 CSS */
293
+ directAllCss?: boolean;
294
+ /** 直连 JS */
295
+ directAllJs?: boolean;
296
+ /** 直连其他资源 */
297
+ directAllOther?: boolean;
277
298
  }
278
299
 
279
300
  export interface ExtensionCategory {
@@ -293,8 +314,12 @@ export interface ExtensionCategories {
293
314
  }
294
315
 
295
316
  export interface InterceptionSetupOptions {
296
- /** 需要直连的域名列表 */
317
+ /** @deprecated 请使用 directConfig.domains */
297
318
  directDomains?: string[];
319
+ /** 直连配置(参考 blockingConfig) */
320
+ directConfig?: DirectExtensionConfig;
321
+ /** 是否启用拦截处理(false 时始终 continue) */
322
+ enable?: boolean | (() => boolean);
298
323
  /** 资源屏蔽配置 */
299
324
  blockingConfig?: BlockingConfig;
300
325
  /** 直连失败时是否回退到代理(默认 true) */
@@ -303,6 +328,7 @@ export interface InterceptionSetupOptions {
303
328
 
304
329
  export interface InterceptionModule {
305
330
  getBlockedExtensions(config?: BlockingConfig): string[];
331
+ getDirectExtensions(config?: DirectExtensionConfig): string[];
306
332
  getExtensionCategories(): ExtensionCategories;
307
333
  setup(page: Page, options?: InterceptionSetupOptions): Promise<void>;
308
334
  }
@@ -341,7 +367,6 @@ export interface LiveViewModule {
341
367
  export interface CaptchaMonitorOptions {
342
368
  domSelector?: string;
343
369
  urlPattern?: string;
344
- titlePattern?: string | RegExp;
345
370
  onDetected?: () => Promise<void>;
346
371
  }
347
372
 
@@ -428,7 +453,7 @@ export interface ShareLinkCaptureResult {
428
453
  source: 'response' | 'dom' | 'none';
429
454
  }
430
455
 
431
- export interface ShareScreenCaptureOptions extends FullPageScreenshotOptions {}
456
+ export interface ShareScreenCaptureOptions extends FullPageScreenshotOptions { }
432
457
 
433
458
  export interface ShareModule {
434
459
  captureLink(page: Page, options?: ShareLinkCaptureOptions): Promise<ShareLinkCaptureResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skrillex1224/playwright-toolkit",
3
- "version": "2.1.134",
3
+ "version": "2.1.136",
4
4
  "description": "一个在 Apify/Crawlee Actor 中启用实时截图视图的实用工具库。",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",