@push.rocks/smartpuppeteer 2.1.0 → 2.2.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 +23 -15
- package/dist_ts/smartpuppeteer.classes.livebrowsersession.js +619 -57
- package/dist_ts/smartpuppeteer.classes.smartpuppeteer.d.ts +1 -0
- package/dist_ts/smartpuppeteer.classes.smartpuppeteer.js +23 -4
- package/dist_ts/smartpuppeteer.interfaces.livebrowser.d.ts +24 -0
- package/package.json +2 -2
- package/readme.md +37 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/smartpuppeteer.classes.livebrowsersession.ts +726 -49
- package/ts/smartpuppeteer.classes.smartpuppeteer.ts +27 -4
- package/ts/smartpuppeteer.interfaces.livebrowser.ts +32 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartpuppeteer',
|
|
6
|
-
version: '2.
|
|
6
|
+
version: '2.2.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, ILiveBrowserSessionOptions, ILiveBrowserSnapshot, ILiveBrowserSnapshotOptions, ILiveBrowserState, ILiveBrowserTabState, 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;
|
|
@@ -21,36 +21,39 @@ export declare class LiveBrowserSession {
|
|
|
21
21
|
private viewportRevision;
|
|
22
22
|
private tabSequence;
|
|
23
23
|
private frameSequence;
|
|
24
|
+
private evaluationSequence;
|
|
24
25
|
private normalStopRequested;
|
|
25
26
|
private lastError?;
|
|
26
27
|
constructor(optionsArg?: ILiveBrowserSessionOptions);
|
|
27
28
|
onEvent(listener: TLiveBrowserEventListener): () => void;
|
|
28
29
|
getState(): ILiveBrowserState;
|
|
29
|
-
start(): Promise<void>;
|
|
30
|
+
start(operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
30
31
|
stop(): Promise<void>;
|
|
31
32
|
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>;
|
|
33
|
+
createTab(optionsArg?: ILiveBrowserCreateTabOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<ILiveBrowserTabState>;
|
|
34
|
+
activateTab(tabId: string, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
35
|
+
closeTab(tabId: string, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
36
|
+
navigate(optionsArg: ILiveBrowserNavigateOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
37
|
+
back(optionsArg?: ILiveBrowserNavigationOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
38
|
+
forward(optionsArg?: ILiveBrowserNavigationOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
39
|
+
reload(optionsArg?: ILiveBrowserNavigationOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
40
|
+
setViewport(viewportArg: ILiveBrowserViewport, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
40
41
|
dispatchMouse(input: ILiveBrowserMouseInput): Promise<void>;
|
|
41
42
|
dispatchWheel(input: ILiveBrowserWheelInput): Promise<void>;
|
|
42
43
|
dispatchKey(input: ILiveBrowserKeyInput): Promise<void>;
|
|
43
44
|
insertText(input: ILiveBrowserInsertTextInput): Promise<void>;
|
|
44
|
-
captureSnapshot(optionsArg?: ILiveBrowserSnapshotOptions): Promise<ILiveBrowserSnapshot>;
|
|
45
|
-
observe(optionsArg?: ILiveBrowserObserveOptions): Promise<ILiveBrowserObservation>;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
captureSnapshot(optionsArg?: ILiveBrowserSnapshotOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<ILiveBrowserSnapshot>;
|
|
46
|
+
observe(optionsArg?: ILiveBrowserObserveOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<ILiveBrowserObservation>;
|
|
47
|
+
evaluate(expressionArg: string, optionsArg?: ILiveBrowserEvaluateOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<TLiveBrowserJsonValue>;
|
|
48
|
+
click(optionsArg: ILiveBrowserClickOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
49
|
+
fill(optionsArg: ILiveBrowserFillOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
50
|
+
press(optionsArg: ILiveBrowserPressOptions, operationOptions?: ILiveBrowserOperationOptions): Promise<void>;
|
|
49
51
|
private enqueuePublicOperation;
|
|
50
52
|
private enqueueInternalOperation;
|
|
51
53
|
private enqueueQueuedOperation;
|
|
52
54
|
private drainOperationQueue;
|
|
53
55
|
private executeQueuedOperation;
|
|
56
|
+
private finalizeQueuedOperation;
|
|
54
57
|
private cancelQueuedOperations;
|
|
55
58
|
private beginShutdown;
|
|
56
59
|
private requestShutdown;
|
|
@@ -60,6 +63,7 @@ export declare class LiveBrowserSession {
|
|
|
60
63
|
private emitError;
|
|
61
64
|
private createTabState;
|
|
62
65
|
private stopInternal;
|
|
66
|
+
private configureBrowserSecurity;
|
|
63
67
|
private requireBrowserContext;
|
|
64
68
|
private requireTab;
|
|
65
69
|
private requireActiveTab;
|
|
@@ -91,6 +95,10 @@ export declare class LiveBrowserSession {
|
|
|
91
95
|
private validateCoordinates;
|
|
92
96
|
private createModifierMask;
|
|
93
97
|
private validateUrl;
|
|
98
|
+
private normalizeEvaluationOptions;
|
|
99
|
+
private readCdpExceptionMessage;
|
|
100
|
+
private createEvaluationBootstrapExpression;
|
|
101
|
+
private createEvaluationExpression;
|
|
94
102
|
private validateTimeout;
|
|
95
103
|
private validateWaitUntil;
|
|
96
104
|
private validateScreencastOptions;
|