@skrillex1224/playwright-toolkit 2.1.207 → 2.1.208
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 +33 -2
- package/dist/browser.js +0 -11
- package/dist/browser.js.map +2 -2
- package/dist/index.cjs +913 -16
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +913 -16
- package/dist/index.js.map +4 -4
- package/index.d.ts +54 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Page, BrowserContext, Browser, ElementHandle } from 'playwright';
|
|
1
|
+
import type { Page, BrowserContext, Browser, ElementHandle, Response } from 'playwright';
|
|
2
2
|
|
|
3
3
|
// =============================================================================
|
|
4
4
|
// Constants
|
|
@@ -449,6 +449,57 @@ export interface ShareLinkCaptureResult {
|
|
|
449
449
|
source: 'response' | 'dom' | 'none';
|
|
450
450
|
}
|
|
451
451
|
|
|
452
|
+
export interface ScreenshotWatermarkifyResolverContext {
|
|
453
|
+
page: Page;
|
|
454
|
+
response?: Response | null;
|
|
455
|
+
url: string;
|
|
456
|
+
hostname: string;
|
|
457
|
+
title: string;
|
|
458
|
+
query?: string;
|
|
459
|
+
taskId?: string;
|
|
460
|
+
serverAddr?: { ipAddress: string; port: number } | null;
|
|
461
|
+
signal?: AbortSignal;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
export interface ScreenshotWatermarkifyResolverResult {
|
|
465
|
+
ip?: string;
|
|
466
|
+
location?: string;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export type ScreenshotWatermarkifyResolver = (
|
|
470
|
+
context: ScreenshotWatermarkifyResolverContext
|
|
471
|
+
) => Promise<ScreenshotWatermarkifyResolverResult | null> | ScreenshotWatermarkifyResolverResult | null;
|
|
472
|
+
|
|
473
|
+
export interface ScreenshotWatermarkifyWatermarkOptions {
|
|
474
|
+
enabled?: boolean;
|
|
475
|
+
opacity?: number;
|
|
476
|
+
rotateDeg?: number;
|
|
477
|
+
cellWidth?: number;
|
|
478
|
+
cellHeight?: number;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
export interface ScreenshotWatermarkifyStripOptions {
|
|
482
|
+
enabled?: boolean;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export interface ScreenshotWatermarkifyOptions {
|
|
486
|
+
enabled?: boolean;
|
|
487
|
+
timezoneOffsetHours?: number;
|
|
488
|
+
response?: Response | null;
|
|
489
|
+
ip?: string;
|
|
490
|
+
location?: string;
|
|
491
|
+
query?: string;
|
|
492
|
+
taskId?: string;
|
|
493
|
+
/** 默认会在同一浏览器上下文中访问 http://myip.ipip.net 补充 IP/Loc。 */
|
|
494
|
+
ipLookup?: boolean;
|
|
495
|
+
/** 内置 IP/Loc 查询超时,默认 10000ms。 */
|
|
496
|
+
ipLookupTimeoutMs?: number;
|
|
497
|
+
resolver?: ScreenshotWatermarkifyResolver | null;
|
|
498
|
+
resolverTimeoutMs?: number;
|
|
499
|
+
watermark?: boolean | ScreenshotWatermarkifyWatermarkOptions;
|
|
500
|
+
strip?: boolean | ScreenshotWatermarkifyStripOptions;
|
|
501
|
+
}
|
|
502
|
+
|
|
452
503
|
export interface ShareScreenCaptureOptions {
|
|
453
504
|
/** 额外缓冲高度 (默认: 视口高度的一半) */
|
|
454
505
|
buffer?: number;
|
|
@@ -456,6 +507,8 @@ export interface ShareScreenCaptureOptions {
|
|
|
456
507
|
restore?: boolean;
|
|
457
508
|
/** 最大截图高度 (默认: 8000px) */
|
|
458
509
|
maxHeight?: number;
|
|
510
|
+
/** 截图水印增强流程,默认开启;传 false 可关闭。 */
|
|
511
|
+
watermarkify?: boolean | ScreenshotWatermarkifyOptions;
|
|
459
512
|
}
|
|
460
513
|
|
|
461
514
|
export interface ShareModule {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skrillex1224/playwright-toolkit",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.208",
|
|
4
4
|
"description": "一个在 Apify/Crawlee Actor 中启用实时截图视图的实用工具库。",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
+
"delay": "^4.4.1",
|
|
48
49
|
"express": "^4.18.2",
|
|
49
50
|
"fingerprint-generator": "^2.1.79",
|
|
50
51
|
"fingerprint-injector": "^2.1.79",
|
|
@@ -56,7 +57,6 @@
|
|
|
56
57
|
"peerDependencies": {
|
|
57
58
|
"apify": "*",
|
|
58
59
|
"crawlee": "*",
|
|
59
|
-
"delay": "*",
|
|
60
60
|
"ghost-cursor-playwright": "*",
|
|
61
61
|
"playwright": "*"
|
|
62
62
|
},
|