@push.rocks/smartpuppeteer 2.1.0 → 2.3.0
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_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/smartpuppeteer.classes.livebrowsersession.d.ts +53 -15
- package/dist_ts/smartpuppeteer.classes.livebrowsersession.js +1404 -60
- package/dist_ts/smartpuppeteer.classes.smartpuppeteer.d.ts +1 -0
- package/dist_ts/smartpuppeteer.classes.smartpuppeteer.js +23 -4
- package/dist_ts/smartpuppeteer.helpers.process.d.ts +14 -0
- package/dist_ts/smartpuppeteer.helpers.process.js +132 -0
- package/dist_ts/smartpuppeteer.interfaces.livebrowser.d.ts +47 -0
- package/dist_ts/smartpuppeteer.plugins.d.ts +4 -2
- package/dist_ts/smartpuppeteer.plugins.js +5 -3
- package/package.json +4 -4
- package/readme.md +52 -2
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/smartpuppeteer.classes.livebrowsersession.ts +1768 -90
- package/ts/smartpuppeteer.classes.smartpuppeteer.ts +27 -4
- package/ts/smartpuppeteer.helpers.process.ts +169 -0
- package/ts/smartpuppeteer.interfaces.livebrowser.ts +59 -0
- package/ts/smartpuppeteer.plugins.ts +4 -2
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartpuppeteer',
|
|
6
|
-
version: '2.
|
|
6
|
+
version: '2.3.0',
|
|
7
7
|
description: 'Provides simplified access to Puppeteer for automation and testing purposes.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSw0QkFBNEI7SUFDbEMsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLDhFQUE4RTtDQUM1RixDQUFBIn0=
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ILiveBrowserClickOptions, ILiveBrowserCreateTabOptions, ILiveBrowserFillOptions, ILiveBrowserFrameAcknowledgement, ILiveBrowserFrameAcknowledgementRequest, ILiveBrowserInsertTextInput, ILiveBrowserKeyInput, ILiveBrowserMouseInput, ILiveBrowserNavigateOptions, ILiveBrowserNavigationOptions, ILiveBrowserObservation, ILiveBrowserObserveOptions, ILiveBrowserPressOptions, ILiveBrowserSessionOptions, ILiveBrowserSnapshot, ILiveBrowserSnapshotOptions, ILiveBrowserState, ILiveBrowserTabState, ILiveBrowserViewport, ILiveBrowserWheelInput, TLiveBrowserEventListener } from './smartpuppeteer.interfaces.livebrowser.js';
|
|
1
|
+
import type { ILiveBrowserClickOptions, ILiveBrowserCreateTabOptions, ILiveBrowserEvaluateOptions, ILiveBrowserFillOptions, ILiveBrowserFrameAcknowledgement, ILiveBrowserFrameAcknowledgementRequest, ILiveBrowserInsertTextInput, ILiveBrowserKeyInput, ILiveBrowserMouseInput, ILiveBrowserNavigateOptions, ILiveBrowserNavigationOptions, ILiveBrowserObservation, ILiveBrowserObserveOptions, ILiveBrowserOperationOptions, ILiveBrowserPressOptions, ILiveBrowserProcessState, ILiveBrowserSessionOptions, ILiveBrowserSnapshot, ILiveBrowserSnapshotOptions, ILiveBrowserState, ILiveBrowserTabState, ILiveBrowserTerminationOptions, ILiveBrowserTerminationResult, ILiveBrowserViewport, ILiveBrowserWheelInput, TLiveBrowserEventListener, TLiveBrowserJsonValue } from './smartpuppeteer.interfaces.livebrowser.js';
|
|
2
2
|
export declare class LiveBrowserSession {
|
|
3
3
|
private readonly options;
|
|
4
4
|
private readonly eventListeners;
|
|
@@ -9,6 +9,20 @@ export declare class LiveBrowserSession {
|
|
|
9
9
|
private browserContext?;
|
|
10
10
|
private browserLifetimeController?;
|
|
11
11
|
private browserDisconnectedListener?;
|
|
12
|
+
private browserTargetCreatedListener?;
|
|
13
|
+
private browserSecurityCdpSession?;
|
|
14
|
+
private browserSecurityConnection?;
|
|
15
|
+
private browserSecuritySessionAttachedListener?;
|
|
16
|
+
private browserSecuritySessionDetachedListener?;
|
|
17
|
+
private readonly proxySecuritySessions;
|
|
18
|
+
private readonly proxySecurityOperations;
|
|
19
|
+
private proxySecurityGeneration;
|
|
20
|
+
private proxySecurityStopping;
|
|
21
|
+
private ownedBrowserProcess?;
|
|
22
|
+
private processGeneration;
|
|
23
|
+
private startRequestCount;
|
|
24
|
+
private terminationSettled;
|
|
25
|
+
private terminationPromise?;
|
|
12
26
|
private readonly operationQueue;
|
|
13
27
|
private activeOperation?;
|
|
14
28
|
private operationRunning;
|
|
@@ -21,36 +35,42 @@ export declare class LiveBrowserSession {
|
|
|
21
35
|
private viewportRevision;
|
|
22
36
|
private tabSequence;
|
|
23
37
|
private frameSequence;
|
|
38
|
+
private evaluationSequence;
|
|
24
39
|
private normalStopRequested;
|
|
25
40
|
private lastError?;
|
|
26
41
|
constructor(optionsArg?: ILiveBrowserSessionOptions);
|
|
27
42
|
onEvent(listener: TLiveBrowserEventListener): () => void;
|
|
28
43
|
getState(): ILiveBrowserState;
|
|
29
|
-
|
|
44
|
+
getProcessState(): ILiveBrowserProcessState;
|
|
45
|
+
terminate(optionsArg?: ILiveBrowserTerminationOptions): Promise<ILiveBrowserTerminationResult>;
|
|
46
|
+
start(operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
30
47
|
stop(): Promise<void>;
|
|
31
48
|
acknowledgeFrame(acknowledgement: ILiveBrowserFrameAcknowledgementRequest): Promise<ILiveBrowserFrameAcknowledgement>;
|
|
32
|
-
createTab(optionsArg?: ILiveBrowserCreateTabOptions): Promise<ILiveBrowserTabState>;
|
|
33
|
-
activateTab(tabId: string): Promise<void>;
|
|
34
|
-
closeTab(tabId: string): Promise<void>;
|
|
35
|
-
navigate(optionsArg: ILiveBrowserNavigateOptions): Promise<void>;
|
|
36
|
-
back(optionsArg?: ILiveBrowserNavigationOptions): Promise<void>;
|
|
37
|
-
forward(optionsArg?: ILiveBrowserNavigationOptions): Promise<void>;
|
|
38
|
-
reload(optionsArg?: ILiveBrowserNavigationOptions): Promise<void>;
|
|
39
|
-
setViewport(viewportArg: ILiveBrowserViewport): Promise<void>;
|
|
49
|
+
createTab(optionsArg?: ILiveBrowserCreateTabOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<ILiveBrowserTabState>;
|
|
50
|
+
activateTab(tabId: string, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
51
|
+
closeTab(tabId: string, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
52
|
+
navigate(optionsArg: ILiveBrowserNavigateOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
53
|
+
back(optionsArg?: ILiveBrowserNavigationOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
54
|
+
forward(optionsArg?: ILiveBrowserNavigationOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
55
|
+
reload(optionsArg?: ILiveBrowserNavigationOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
56
|
+
setViewport(viewportArg: ILiveBrowserViewport, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
40
57
|
dispatchMouse(input: ILiveBrowserMouseInput): Promise<void>;
|
|
41
58
|
dispatchWheel(input: ILiveBrowserWheelInput): Promise<void>;
|
|
42
59
|
dispatchKey(input: ILiveBrowserKeyInput): Promise<void>;
|
|
43
60
|
insertText(input: ILiveBrowserInsertTextInput): Promise<void>;
|
|
44
|
-
captureSnapshot(optionsArg?: ILiveBrowserSnapshotOptions): Promise<ILiveBrowserSnapshot>;
|
|
45
|
-
observe(optionsArg?: ILiveBrowserObserveOptions): Promise<ILiveBrowserObservation>;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
61
|
+
captureSnapshot(optionsArg?: ILiveBrowserSnapshotOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<ILiveBrowserSnapshot>;
|
|
62
|
+
observe(optionsArg?: ILiveBrowserObserveOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<ILiveBrowserObservation>;
|
|
63
|
+
evaluate(expressionArg: string, optionsArg?: ILiveBrowserEvaluateOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<TLiveBrowserJsonValue>;
|
|
64
|
+
click(optionsArg: ILiveBrowserClickOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
65
|
+
fill(optionsArg: ILiveBrowserFillOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
66
|
+
press(optionsArg: ILiveBrowserPressOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
49
67
|
private enqueuePublicOperation;
|
|
68
|
+
private assertProxySecurityReady;
|
|
50
69
|
private enqueueInternalOperation;
|
|
51
70
|
private enqueueQueuedOperation;
|
|
52
71
|
private drainOperationQueue;
|
|
53
72
|
private executeQueuedOperation;
|
|
73
|
+
private finalizeQueuedOperation;
|
|
54
74
|
private cancelQueuedOperations;
|
|
55
75
|
private beginShutdown;
|
|
56
76
|
private requestShutdown;
|
|
@@ -59,13 +79,27 @@ export declare class LiveBrowserSession {
|
|
|
59
79
|
private emitState;
|
|
60
80
|
private emitError;
|
|
61
81
|
private createTabState;
|
|
82
|
+
private releaseExitedOwnedProcess;
|
|
83
|
+
private terminateInternal;
|
|
84
|
+
private killOwnedProcessGroupSurvivors;
|
|
85
|
+
private forceOwnedBrowserProcessGroup;
|
|
62
86
|
private stopInternal;
|
|
87
|
+
private configureBrowserSecurity;
|
|
88
|
+
private configureProxySecuritySession;
|
|
89
|
+
private verifyProxySecuritySessionDetached;
|
|
90
|
+
private removeProxySecuritySession;
|
|
91
|
+
private allowOperationalCdpSessionDetach;
|
|
92
|
+
private trackProxySecurityOperation;
|
|
93
|
+
private handleProxySecurityFailure;
|
|
94
|
+
private teardownProxySecurity;
|
|
63
95
|
private requireBrowserContext;
|
|
64
96
|
private requireTab;
|
|
65
97
|
private requireActiveTab;
|
|
66
98
|
private resolveActionTab;
|
|
67
99
|
private resolveNavigationTab;
|
|
68
100
|
private ensureTabViewport;
|
|
101
|
+
private scheduleDiscoveredPageRegistration;
|
|
102
|
+
private handleDiscoveredPageFailure;
|
|
69
103
|
private registerPage;
|
|
70
104
|
private removePageListeners;
|
|
71
105
|
private retireFramesForTabInBackground;
|
|
@@ -91,6 +125,10 @@ export declare class LiveBrowserSession {
|
|
|
91
125
|
private validateCoordinates;
|
|
92
126
|
private createModifierMask;
|
|
93
127
|
private validateUrl;
|
|
128
|
+
private normalizeEvaluationOptions;
|
|
129
|
+
private readCdpExceptionMessage;
|
|
130
|
+
private createEvaluationBootstrapExpression;
|
|
131
|
+
private createEvaluationExpression;
|
|
94
132
|
private validateTimeout;
|
|
95
133
|
private validateWaitUntil;
|
|
96
134
|
private validateScreencastOptions;
|