appium-remote-debugger 15.2.10 → 15.2.11
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/CHANGELOG.md +6 -0
- package/build/lib/mixins/cookies.d.ts +17 -13
- package/build/lib/mixins/cookies.d.ts.map +1 -1
- package/build/lib/mixins/cookies.js +12 -12
- package/build/lib/mixins/cookies.js.map +1 -1
- package/build/lib/mixins/events.d.ts +32 -31
- package/build/lib/mixins/events.d.ts.map +1 -1
- package/build/lib/mixins/events.js +21 -24
- package/build/lib/mixins/events.js.map +1 -1
- package/build/lib/mixins/execute.d.ts +35 -24
- package/build/lib/mixins/execute.d.ts.map +1 -1
- package/build/lib/mixins/execute.js +34 -26
- package/build/lib/mixins/execute.js.map +1 -1
- package/build/lib/mixins/misc.d.ts +34 -24
- package/build/lib/mixins/misc.d.ts.map +1 -1
- package/build/lib/mixins/misc.js +27 -21
- package/build/lib/mixins/misc.js.map +1 -1
- package/build/lib/mixins/screenshot.d.ts +21 -11
- package/build/lib/mixins/screenshot.d.ts.map +1 -1
- package/build/lib/mixins/screenshot.js +10 -14
- package/build/lib/mixins/screenshot.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/mixins/cookies.ts +61 -0
- package/lib/mixins/events.ts +91 -0
- package/lib/mixins/{execute.js → execute.ts} +59 -33
- package/lib/mixins/misc.ts +136 -0
- package/lib/mixins/screenshot.ts +52 -0
- package/package.json +1 -1
- package/lib/mixins/cookies.js +0 -53
- package/lib/mixins/events.js +0 -81
- package/lib/mixins/misc.js +0 -121
- package/lib/mixins/screenshot.js +0 -43
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [15.2.11](https://github.com/appium/appium-remote-debugger/compare/v15.2.10...v15.2.11) (2026-01-21)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* Migrate the rest of mixins to typescript ([#465](https://github.com/appium/appium-remote-debugger/issues/465)) ([1588bf9](https://github.com/appium/appium-remote-debugger/commit/1588bf90c85ac165f563353cacd03e6b85efd66b))
|
|
6
|
+
|
|
1
7
|
## [15.2.10](https://github.com/appium/appium-remote-debugger/compare/v15.2.9...v15.2.10) (2026-01-20)
|
|
2
8
|
|
|
3
9
|
### Miscellaneous Chores
|
|
@@ -1,23 +1,27 @@
|
|
|
1
|
+
import type { RemoteDebugger } from '../remote-debugger';
|
|
2
|
+
import type { StringRecord } from '@appium/types';
|
|
1
3
|
/**
|
|
4
|
+
* Retrieves all cookies for the current page by sending a Page.getCookies
|
|
5
|
+
* command to the remote debugger.
|
|
2
6
|
*
|
|
3
|
-
* @
|
|
4
|
-
* @returns {Promise<import('@appium/types').StringRecord>}
|
|
7
|
+
* @returns A promise that resolves to a dictionary containing the cookies.
|
|
5
8
|
*/
|
|
6
|
-
export function getCookies(this:
|
|
9
|
+
export declare function getCookies(this: RemoteDebugger): Promise<StringRecord>;
|
|
7
10
|
/**
|
|
11
|
+
* Sets a cookie on the current page by sending a Page.setCookie command
|
|
12
|
+
* to the remote debugger.
|
|
8
13
|
*
|
|
9
|
-
* @
|
|
10
|
-
* @
|
|
11
|
-
* @returns {Promise<any>}
|
|
14
|
+
* @param cookie - Dictionary containing the cookie properties to set.
|
|
15
|
+
* @returns A promise that resolves when the cookie has been set.
|
|
12
16
|
*/
|
|
13
|
-
export function setCookie(this:
|
|
17
|
+
export declare function setCookie(this: RemoteDebugger, cookie: StringRecord): Promise<any>;
|
|
14
18
|
/**
|
|
19
|
+
* Deletes a cookie from the current page by sending a Page.deleteCookie
|
|
20
|
+
* command to the remote debugger.
|
|
15
21
|
*
|
|
16
|
-
* @
|
|
17
|
-
* @param
|
|
18
|
-
* @
|
|
19
|
-
* @returns {Promise<any>}
|
|
22
|
+
* @param cookieName - The name of the cookie to delete.
|
|
23
|
+
* @param url - The URL associated with the cookie to delete.
|
|
24
|
+
* @returns A promise that resolves when the cookie has been deleted.
|
|
20
25
|
*/
|
|
21
|
-
export function deleteCookie(this:
|
|
22
|
-
export type RemoteDebugger = import("../remote-debugger").RemoteDebugger;
|
|
26
|
+
export declare function deleteCookie(this: RemoteDebugger, cookieName: string, url: string): Promise<any>;
|
|
23
27
|
//# sourceMappingURL=cookies.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../lib/mixins/cookies.
|
|
1
|
+
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../lib/mixins/cookies.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAM5E;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,GAAG,CAAC,CAOd;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,EACpB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,GAAG,CAAC,CAQd"}
|
|
@@ -5,9 +5,10 @@ exports.setCookie = setCookie;
|
|
|
5
5
|
exports.deleteCookie = deleteCookie;
|
|
6
6
|
const property_accessors_1 = require("./property-accessors");
|
|
7
7
|
/**
|
|
8
|
+
* Retrieves all cookies for the current page by sending a Page.getCookies
|
|
9
|
+
* command to the remote debugger.
|
|
8
10
|
*
|
|
9
|
-
* @
|
|
10
|
-
* @returns {Promise<import('@appium/types').StringRecord>}
|
|
11
|
+
* @returns A promise that resolves to a dictionary containing the cookies.
|
|
11
12
|
*/
|
|
12
13
|
async function getCookies() {
|
|
13
14
|
this.log.debug('Getting cookies');
|
|
@@ -17,10 +18,11 @@ async function getCookies() {
|
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
21
|
+
* Sets a cookie on the current page by sending a Page.setCookie command
|
|
22
|
+
* to the remote debugger.
|
|
20
23
|
*
|
|
21
|
-
* @
|
|
22
|
-
* @
|
|
23
|
-
* @returns {Promise<any>}
|
|
24
|
+
* @param cookie - Dictionary containing the cookie properties to set.
|
|
25
|
+
* @returns A promise that resolves when the cookie has been set.
|
|
24
26
|
*/
|
|
25
27
|
async function setCookie(cookie) {
|
|
26
28
|
this.log.debug('Setting cookie');
|
|
@@ -31,11 +33,12 @@ async function setCookie(cookie) {
|
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
36
|
+
* Deletes a cookie from the current page by sending a Page.deleteCookie
|
|
37
|
+
* command to the remote debugger.
|
|
34
38
|
*
|
|
35
|
-
* @
|
|
36
|
-
* @param
|
|
37
|
-
* @
|
|
38
|
-
* @returns {Promise<any>}
|
|
39
|
+
* @param cookieName - The name of the cookie to delete.
|
|
40
|
+
* @param url - The URL associated with the cookie to delete.
|
|
41
|
+
* @returns A promise that resolves when the cookie has been deleted.
|
|
39
42
|
*/
|
|
40
43
|
async function deleteCookie(cookieName, url) {
|
|
41
44
|
this.log.debug(`Deleting cookie '${cookieName}' on '${url}'`);
|
|
@@ -46,7 +49,4 @@ async function deleteCookie(cookieName, url) {
|
|
|
46
49
|
url,
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
|
-
/**
|
|
50
|
-
* @typedef {import('../remote-debugger').RemoteDebugger} RemoteDebugger
|
|
51
|
-
*/
|
|
52
52
|
//# sourceMappingURL=cookies.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../../lib/mixins/cookies.
|
|
1
|
+
{"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../../lib/mixins/cookies.ts"],"names":[],"mappings":";;AAaA,gCAMC;AASD,8BAUC;AAUD,oCAYC;AA5DD,6DAG8B;AAI9B;;;;;GAKG;AACI,KAAK,UAAU,UAAU;IAC9B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAClC,OAAO,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE;QAC3D,QAAQ,EAAE,IAAA,gCAAW,EAAC,IAAI,CAAC;QAC3B,SAAS,EAAE,IAAA,iCAAY,EAAC,IAAI,CAAC;KAC9B,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,SAAS,CAE7B,MAAoB;IAEpB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACjC,OAAO,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE;QAC1D,QAAQ,EAAE,IAAA,gCAAW,EAAC,IAAI,CAAC;QAC3B,SAAS,EAAE,IAAA,iCAAY,EAAC,IAAI,CAAC;QAC7B,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,YAAY,CAEhC,UAAkB,EAClB,GAAW;IAEX,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,oBAAoB,UAAU,SAAS,GAAG,GAAG,CAAC,CAAC;IAC9D,OAAO,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE;QAC7D,QAAQ,EAAE,IAAA,gCAAW,EAAC,IAAI,CAAC;QAC3B,SAAS,EAAE,IAAA,iCAAY,EAAC,IAAI,CAAC;QAC7B,UAAU;QACV,GAAG;KACJ,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,45 +1,46 @@
|
|
|
1
|
+
import type { RemoteDebugger } from '../remote-debugger';
|
|
2
|
+
import type { EventListener } from '../types';
|
|
3
|
+
export declare const events: {
|
|
4
|
+
readonly EVENT_PAGE_CHANGE: "remote_debugger_page_change";
|
|
5
|
+
readonly EVENT_FRAMES_DETACHED: "remote_debugger_frames_detached";
|
|
6
|
+
readonly EVENT_DISCONNECT: "remote_debugger_disconnect";
|
|
7
|
+
};
|
|
1
8
|
/**
|
|
2
|
-
*
|
|
9
|
+
* Adds a client event listener to the RPC client and tracks it for later removal.
|
|
10
|
+
* The listener will be called when the specified event is emitted by the remote debugger.
|
|
3
11
|
*
|
|
4
|
-
* @
|
|
5
|
-
* @param
|
|
6
|
-
* @param {import('../types').EventListener} listener
|
|
7
|
-
* @returns {void}
|
|
12
|
+
* @param eventName - The name of the event to listen for.
|
|
13
|
+
* @param listener - The event listener function to call when the event is emitted.
|
|
8
14
|
*/
|
|
9
|
-
export function addClientEventListener(this:
|
|
15
|
+
export declare function addClientEventListener(this: RemoteDebugger, eventName: string, listener: EventListener): void;
|
|
10
16
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
17
|
+
* Removes all client event listeners for the specified event name from the RPC client.
|
|
18
|
+
* This will stop listening for the event and clean up the tracked listeners.
|
|
19
|
+
*
|
|
20
|
+
* @param eventName - The name of the event to stop listening for.
|
|
14
21
|
*/
|
|
15
|
-
export function removeClientEventListener(this:
|
|
22
|
+
export declare function removeClientEventListener(this: RemoteDebugger, eventName: string): void;
|
|
16
23
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
24
|
+
* Starts listening for JavaScript console messages by registering listeners
|
|
25
|
+
* for Console.messageAdded and Console.messageRepeatCountUpdated events.
|
|
26
|
+
*
|
|
27
|
+
* @param listener - The event listener function to call when console messages are received.
|
|
20
28
|
*/
|
|
21
|
-
export function startConsole(this:
|
|
29
|
+
export declare function startConsole(this: RemoteDebugger, listener: EventListener): void;
|
|
22
30
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
31
|
+
* Stops listening for JavaScript console messages by removing listeners
|
|
32
|
+
* for Console.messageAdded and Console.messageRepeatCountUpdated events.
|
|
25
33
|
*/
|
|
26
|
-
export function stopConsole(this:
|
|
34
|
+
export declare function stopConsole(this: RemoteDebugger): void;
|
|
27
35
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
36
|
+
* Starts listening for network events by registering a listener for NetworkEvent.
|
|
37
|
+
* This aggregates all Network.* events into a single NetworkEvent.
|
|
38
|
+
*
|
|
39
|
+
* @param listener - The event listener function to call when network events are received.
|
|
31
40
|
*/
|
|
32
|
-
export function startNetwork(this:
|
|
41
|
+
export declare function startNetwork(this: RemoteDebugger, listener: EventListener): void;
|
|
33
42
|
/**
|
|
34
|
-
*
|
|
35
|
-
* @returns {void}
|
|
43
|
+
* Stops listening for network events by removing the listener for NetworkEvent.
|
|
36
44
|
*/
|
|
37
|
-
export function stopNetwork(this:
|
|
38
|
-
export namespace events {
|
|
39
|
-
let EVENT_PAGE_CHANGE: "remote_debugger_page_change";
|
|
40
|
-
let EVENT_FRAMES_DETACHED: "remote_debugger_frames_detached";
|
|
41
|
-
let EVENT_DISCONNECT: "remote_debugger_disconnect";
|
|
42
|
-
}
|
|
43
|
-
export default events;
|
|
44
|
-
export type RemoteDebugger = import("../remote-debugger").RemoteDebugger;
|
|
45
|
+
export declare function stopNetwork(this: RemoteDebugger): void;
|
|
45
46
|
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../lib/mixins/events.
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../lib/mixins/events.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,eAAO,MAAM,MAAM;;;;CAIT,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,cAAc,EACpB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,aAAa,GACtB,IAAI,CAIN;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,cAAc,EACpB,SAAS,EAAE,MAAM,GAChB,IAAI,CAIN;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,aAAa,GACtB,IAAI,CAIN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAItD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,aAAa,GACtB,IAAI,CAGN;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAGtD"}
|
|
@@ -9,18 +9,17 @@ exports.startNetwork = startNetwork;
|
|
|
9
9
|
exports.stopNetwork = stopNetwork;
|
|
10
10
|
const property_accessors_1 = require("./property-accessors");
|
|
11
11
|
// event emitted publically
|
|
12
|
-
exports.events =
|
|
12
|
+
exports.events = {
|
|
13
13
|
EVENT_PAGE_CHANGE: 'remote_debugger_page_change',
|
|
14
14
|
EVENT_FRAMES_DETACHED: 'remote_debugger_frames_detached',
|
|
15
15
|
EVENT_DISCONNECT: 'remote_debugger_disconnect',
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Adds a client event listener to the RPC client and tracks it for later removal.
|
|
19
|
+
* The listener will be called when the specified event is emitted by the remote debugger.
|
|
19
20
|
*
|
|
20
|
-
* @
|
|
21
|
-
* @param
|
|
22
|
-
* @param {import('../types').EventListener} listener
|
|
23
|
-
* @returns {void}
|
|
21
|
+
* @param eventName - The name of the event to listen for.
|
|
22
|
+
* @param listener - The event listener function to call when the event is emitted.
|
|
24
23
|
*/
|
|
25
24
|
function addClientEventListener(eventName, listener) {
|
|
26
25
|
(0, property_accessors_1.getClientEventListeners)(this)[eventName] ??= [];
|
|
@@ -28,9 +27,10 @@ function addClientEventListener(eventName, listener) {
|
|
|
28
27
|
this.requireRpcClient().on(eventName, listener);
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
30
|
+
* Removes all client event listeners for the specified event name from the RPC client.
|
|
31
|
+
* This will stop listening for the event and clean up the tracked listeners.
|
|
32
|
+
*
|
|
33
|
+
* @param eventName - The name of the event to stop listening for.
|
|
34
34
|
*/
|
|
35
35
|
function removeClientEventListener(eventName) {
|
|
36
36
|
for (const listener of ((0, property_accessors_1.getClientEventListeners)(this)[eventName] || [])) {
|
|
@@ -38,9 +38,10 @@ function removeClientEventListener(eventName) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
41
|
+
* Starts listening for JavaScript console messages by registering listeners
|
|
42
|
+
* for Console.messageAdded and Console.messageRepeatCountUpdated events.
|
|
43
|
+
*
|
|
44
|
+
* @param listener - The event listener function to call when console messages are received.
|
|
44
45
|
*/
|
|
45
46
|
function startConsole(listener) {
|
|
46
47
|
this.log.debug('Starting to listen for JavaScript console');
|
|
@@ -48,8 +49,8 @@ function startConsole(listener) {
|
|
|
48
49
|
this.addClientEventListener('Console.messageRepeatCountUpdated', listener);
|
|
49
50
|
}
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
52
|
+
* Stops listening for JavaScript console messages by removing listeners
|
|
53
|
+
* for Console.messageAdded and Console.messageRepeatCountUpdated events.
|
|
53
54
|
*/
|
|
54
55
|
function stopConsole() {
|
|
55
56
|
this.log.debug('Stopping to listen for JavaScript console');
|
|
@@ -57,24 +58,20 @@ function stopConsole() {
|
|
|
57
58
|
this.removeClientEventListener('Console.messageRepeatCountUpdated');
|
|
58
59
|
}
|
|
59
60
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
61
|
+
* Starts listening for network events by registering a listener for NetworkEvent.
|
|
62
|
+
* This aggregates all Network.* events into a single NetworkEvent.
|
|
63
|
+
*
|
|
64
|
+
* @param listener - The event listener function to call when network events are received.
|
|
63
65
|
*/
|
|
64
66
|
function startNetwork(listener) {
|
|
65
67
|
this.log.debug('Starting to listen for network events');
|
|
66
68
|
this.addClientEventListener('NetworkEvent', listener);
|
|
67
69
|
}
|
|
68
70
|
/**
|
|
69
|
-
*
|
|
70
|
-
* @returns {void}
|
|
71
|
+
* Stops listening for network events by removing the listener for NetworkEvent.
|
|
71
72
|
*/
|
|
72
73
|
function stopNetwork() {
|
|
73
74
|
this.log.debug('Stopping to listen for network events');
|
|
74
75
|
this.removeClientEventListener('NetworkEvent');
|
|
75
76
|
}
|
|
76
|
-
exports.default = exports.events;
|
|
77
|
-
/**
|
|
78
|
-
* @typedef {import('../remote-debugger').RemoteDebugger} RemoteDebugger
|
|
79
|
-
*/
|
|
80
77
|
//# sourceMappingURL=events.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../lib/mixins/events.
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../lib/mixins/events.ts"],"names":[],"mappings":";;;AAoBA,wDAQC;AAQD,8DAOC;AAQD,oCAOC;AAMD,kCAIC;AAQD,oCAMC;AAKD,kCAGC;AA1FD,6DAE8B;AAI9B,2BAA2B;AACd,QAAA,MAAM,GAAG;IACpB,iBAAiB,EAAE,6BAA6B;IAChD,qBAAqB,EAAE,iCAAiC;IACxD,gBAAgB,EAAE,4BAA4B;CACtC,CAAC;AAEX;;;;;;GAMG;AACH,SAAgB,sBAAsB,CAEpC,SAAiB,EACjB,QAAuB;IAEvB,IAAA,4CAAuB,EAAC,IAAI,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IAChD,IAAA,4CAAuB,EAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxD,I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from '../remote-debugger';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
+
* Executes a Selenium atom in Safari by generating the atom script and
|
|
4
|
+
* executing it in the page context.
|
|
3
5
|
*
|
|
4
|
-
* @
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
* @
|
|
8
|
-
* @returns {Promise<any>} The result received from the atom
|
|
6
|
+
* @param atom - Name of the Selenium atom to execute (see atoms/ directory).
|
|
7
|
+
* @param args - Arguments to pass to the atom function. Defaults to empty array.
|
|
8
|
+
* @param frames - Frame context array for frame-specific execution. Defaults to empty array.
|
|
9
|
+
* @returns A promise that resolves to the result received from the atom execution.
|
|
9
10
|
*/
|
|
10
|
-
export function executeAtom(this:
|
|
11
|
+
export declare function executeAtom(this: RemoteDebugger, atom: string, args?: any[], frames?: string[]): Promise<any>;
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @
|
|
13
|
+
* Executes a Selenium atom asynchronously by creating a Promise in the page context
|
|
14
|
+
* and waiting for the atom to resolve it. Falls back to polling if Runtime.awaitPromise
|
|
15
|
+
* is not available.
|
|
16
|
+
*
|
|
17
|
+
* @param atom - Name of the Selenium atom to execute (see atoms/ directory).
|
|
18
|
+
* @param args - Arguments to pass to the atom function. Defaults to empty array.
|
|
19
|
+
* If args[2] is provided, it will be used as the timeout in milliseconds.
|
|
20
|
+
* @param frames - Frame context array for frame-specific execution. Defaults to empty array.
|
|
21
|
+
* @returns A promise that resolves to the result received from the atom execution.
|
|
17
22
|
*/
|
|
18
|
-
export function executeAtomAsync(this:
|
|
23
|
+
export declare function executeAtomAsync(this: RemoteDebugger, atom: string, args?: any[], frames?: string[]): Promise<any>;
|
|
19
24
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* @
|
|
25
|
+
* Executes a JavaScript command in the page context and returns the result.
|
|
26
|
+
* Optionally performs garbage collection before execution if configured.
|
|
27
|
+
*
|
|
28
|
+
* @param command - The JavaScript command string to execute.
|
|
29
|
+
* @param override - Deprecated and unused parameter.
|
|
30
|
+
* @returns A promise that resolves to the result of the JavaScript evaluation,
|
|
31
|
+
* converted to a usable format.
|
|
24
32
|
*/
|
|
25
|
-
export function execute(this:
|
|
33
|
+
export declare function execute(this: RemoteDebugger, command: string, override?: boolean): Promise<any>;
|
|
26
34
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* @param
|
|
35
|
+
* Calls a JavaScript function on a remote object identified by objectId.
|
|
36
|
+
* Optionally performs garbage collection before execution if configured.
|
|
37
|
+
*
|
|
38
|
+
* @param objectId - The object identifier of the remote object to call the function on.
|
|
39
|
+
* @param fn - The function declaration string to execute on the object.
|
|
40
|
+
* @param args - Optional array of arguments to pass to the function.
|
|
41
|
+
* @returns A promise that resolves to the result of the function call,
|
|
42
|
+
* converted to a usable format.
|
|
31
43
|
*/
|
|
32
|
-
export function callFunction(this:
|
|
33
|
-
export type RemoteDebugger = import("../remote-debugger").RemoteDebugger;
|
|
44
|
+
export declare function callFunction(this: RemoteDebugger, objectId: string, fn: string, args?: any[]): Promise<any>;
|
|
34
45
|
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../lib/mixins/execute.
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../lib/mixins/execute.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMzD;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,GAAG,EAAO,EAChB,MAAM,GAAE,MAAM,EAAO,GACpB,OAAO,CAAC,GAAG,CAAC,CAQd;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,GAAG,EAAO,EAChB,MAAM,GAAE,MAAM,EAAO,GACpB,OAAO,CAAC,GAAG,CAAC,CAkFd;AAED;;;;;;;;GAQG;AAEH,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAuBrG;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,GAAG,EAAE,GACX,OAAO,CAAC,GAAG,CAAC,CAqBd"}
|
|
@@ -17,27 +17,33 @@ const property_accessors_1 = require("./property-accessors");
|
|
|
17
17
|
/* How many milliseconds to wait for webkit to return a response before timing out */
|
|
18
18
|
const RPC_RESPONSE_TIMEOUT_MS = 5000;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Executes a Selenium atom in Safari by generating the atom script and
|
|
21
|
+
* executing it in the page context.
|
|
21
22
|
*
|
|
22
|
-
* @
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
25
|
-
* @
|
|
26
|
-
* @returns {Promise<any>} The result received from the atom
|
|
23
|
+
* @param atom - Name of the Selenium atom to execute (see atoms/ directory).
|
|
24
|
+
* @param args - Arguments to pass to the atom function. Defaults to empty array.
|
|
25
|
+
* @param frames - Frame context array for frame-specific execution. Defaults to empty array.
|
|
26
|
+
* @returns A promise that resolves to the result received from the atom execution.
|
|
27
27
|
*/
|
|
28
28
|
async function executeAtom(atom, args = [], frames = []) {
|
|
29
29
|
this.log.debug(`Executing atom '${atom}' with 'args=${JSON.stringify(args)}; frames=${frames}'`);
|
|
30
30
|
const script = await (0, atoms_1.getScriptForAtom)(atom, args, frames);
|
|
31
31
|
const value = await this.execute(script);
|
|
32
|
-
this.log.debug(`Received result for atom '${atom}' execution: ${lodash_1.default.truncate((0, utils_1.simpleStringify)(value), {
|
|
32
|
+
this.log.debug(`Received result for atom '${atom}' execution: ${lodash_1.default.truncate((0, utils_1.simpleStringify)(value), {
|
|
33
|
+
length: utils_1.RESPONSE_LOG_LENGTH
|
|
34
|
+
})}`);
|
|
33
35
|
return value;
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @
|
|
38
|
+
* Executes a Selenium atom asynchronously by creating a Promise in the page context
|
|
39
|
+
* and waiting for the atom to resolve it. Falls back to polling if Runtime.awaitPromise
|
|
40
|
+
* is not available.
|
|
41
|
+
*
|
|
42
|
+
* @param atom - Name of the Selenium atom to execute (see atoms/ directory).
|
|
43
|
+
* @param args - Arguments to pass to the atom function. Defaults to empty array.
|
|
44
|
+
* If args[2] is provided, it will be used as the timeout in milliseconds.
|
|
45
|
+
* @param frames - Frame context array for frame-specific execution. Defaults to empty array.
|
|
46
|
+
* @returns A promise that resolves to the result received from the atom execution.
|
|
41
47
|
*/
|
|
42
48
|
async function executeAtomAsync(atom, args = [], frames = []) {
|
|
43
49
|
// helper to send directly to the web inspector
|
|
@@ -119,10 +125,13 @@ async function executeAtomAsync(atom, args = [], frames = []) {
|
|
|
119
125
|
return (0, utils_1.convertJavascriptEvaluationResult)(res);
|
|
120
126
|
}
|
|
121
127
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* @
|
|
128
|
+
* Executes a JavaScript command in the page context and returns the result.
|
|
129
|
+
* Optionally performs garbage collection before execution if configured.
|
|
130
|
+
*
|
|
131
|
+
* @param command - The JavaScript command string to execute.
|
|
132
|
+
* @param override - Deprecated and unused parameter.
|
|
133
|
+
* @returns A promise that resolves to the result of the JavaScript evaluation,
|
|
134
|
+
* converted to a usable format.
|
|
126
135
|
*/
|
|
127
136
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
128
137
|
async function execute(command, override) {
|
|
@@ -134,9 +143,7 @@ async function execute(command, override) {
|
|
|
134
143
|
await this.garbageCollect();
|
|
135
144
|
}
|
|
136
145
|
const rpcClient = this.requireRpcClient(true);
|
|
137
|
-
await rpcClient.waitForPage(
|
|
138
|
-
/** @type {import('../types').AppIdKey} */ (appIdKey),
|
|
139
|
-
/** @type {import('../types').PageIdKey} */ (pageIdKey));
|
|
146
|
+
await rpcClient.waitForPage(appIdKey, pageIdKey);
|
|
140
147
|
this.log.debug(`Sending javascript command: '${lodash_1.default.truncate(command, { length: 50 })}'`);
|
|
141
148
|
const res = await rpcClient.send('Runtime.evaluate', {
|
|
142
149
|
expression: command,
|
|
@@ -147,10 +154,14 @@ async function execute(command, override) {
|
|
|
147
154
|
return (0, utils_1.convertJavascriptEvaluationResult)(res);
|
|
148
155
|
}
|
|
149
156
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
* @param
|
|
157
|
+
* Calls a JavaScript function on a remote object identified by objectId.
|
|
158
|
+
* Optionally performs garbage collection before execution if configured.
|
|
159
|
+
*
|
|
160
|
+
* @param objectId - The object identifier of the remote object to call the function on.
|
|
161
|
+
* @param fn - The function declaration string to execute on the object.
|
|
162
|
+
* @param args - Optional array of arguments to pass to the function.
|
|
163
|
+
* @returns A promise that resolves to the result of the function call,
|
|
164
|
+
* converted to a usable format.
|
|
154
165
|
*/
|
|
155
166
|
async function callFunction(objectId, fn, args) {
|
|
156
167
|
const { appIdKey, pageIdKey } = (0, utils_1.checkParams)({
|
|
@@ -171,7 +182,4 @@ async function callFunction(objectId, fn, args) {
|
|
|
171
182
|
});
|
|
172
183
|
return (0, utils_1.convertJavascriptEvaluationResult)(res);
|
|
173
184
|
}
|
|
174
|
-
/**
|
|
175
|
-
* @typedef {import('../remote-debugger').RemoteDebugger} RemoteDebugger
|
|
176
|
-
*/
|
|
177
185
|
//# sourceMappingURL=execute.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../lib/mixins/execute.
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../lib/mixins/execute.ts"],"names":[],"mappings":";;;;;AA+BA,kCAaC;AAaD,4CAuFC;AAYD,0BAuBC;AAYD,oCA0BC;AAzND,qDAA6C;AAC7C,oCAKkB;AAClB,oCAA4C;AAC5C,6CAA+C;AAC/C,uCAAyC;AACzC,oDAAuB;AACvB,6DAI8B;AAI9B,qFAAqF;AACrF,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAErC;;;;;;;;GAQG;AACI,KAAK,UAAU,WAAW,CAE/B,IAAY,EACZ,OAAc,EAAE,EAChB,SAAmB,EAAE;IAErB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,IAAI,gBAAgB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,MAAM,GAAG,CAAC,CAAC;IACjG,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAgB,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1D,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,6BAA6B,IAAI,gBAAgB,gBAAC,CAAC,QAAQ,CAAC,IAAA,uBAAe,EAAC,KAAK,CAAC,EAAE;QACjG,MAAM,EAAE,2BAAmB;KAC5B,CAAC,EAAE,CAAC,CAAC;IACN,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;GAUG;AACI,KAAK,UAAU,gBAAgB,CAEpC,IAAY,EACZ,OAAc,EAAE,EAChB,SAAmB,EAAE;IAErB,+CAA+C;IAC/C,MAAM,QAAQ,GAAG,KAAK,EAAE,MAAc,EAAE,IAAS,EAAE,EAAE,CAAC,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,C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ACxC,QAAQ,EAAE,IAAA,gCAAW,EAAC,IAAI,CAAC;QAC3B,SAAS,EAAE,IAAA,iCAAY,EAAC,IAAI,CAAC;KAC9B,CAAC,CAAC;IAEH,IAAI,IAAA,+CAA0B,EAAC,IAAI,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAC9B,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAC9C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,wBAAwB,EAAE;QAC3E,QAAQ;QACR,mBAAmB,EAAE,EAAE;QACvB,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,IAAI;QACnB,QAAQ;QACR,SAAS;KACV,CAAC,CAAC;IAEH,OAAO,IAAA,yCAAiC,EAAC,GAAG,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1,37 +1,47 @@
|
|
|
1
|
+
import type { RemoteDebugger } from '../remote-debugger';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
3
|
+
* Launches Safari application on the device by sending a launch command
|
|
4
|
+
* to the remote debugger.
|
|
4
5
|
*/
|
|
5
|
-
export function launchSafari(this:
|
|
6
|
+
export declare function launchSafari(this: RemoteDebugger): Promise<void>;
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Starts recording the timeline by registering an event listener and
|
|
9
|
+
* sending the Timeline.start command to the remote debugger.
|
|
10
|
+
*
|
|
11
|
+
* @param fn - Event listener function that will be called when timeline events are recorded.
|
|
12
|
+
* @returns A promise that resolves when the timeline recording has started.
|
|
10
13
|
*/
|
|
11
|
-
export function startTimeline(this:
|
|
14
|
+
export declare function startTimeline(this: RemoteDebugger, fn: import('../types').EventListener): Promise<any>;
|
|
12
15
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
16
|
+
* Stops recording the timeline by sending the Timeline.stop command
|
|
17
|
+
* to the remote debugger.
|
|
15
18
|
*/
|
|
16
|
-
export function stopTimeline(this:
|
|
19
|
+
export declare function stopTimeline(this: RemoteDebugger): Promise<any>;
|
|
17
20
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
+
* Overrides the user agent string for the current page.
|
|
22
|
+
* Note: This may not work for mobile Safari.
|
|
23
|
+
*
|
|
24
|
+
* @param value - The user agent string to set.
|
|
25
|
+
* @returns A promise that resolves when the user agent has been overridden.
|
|
21
26
|
*/
|
|
22
|
-
export function overrideUserAgent(this:
|
|
27
|
+
export declare function overrideUserAgent(this: RemoteDebugger, value: string): Promise<any>;
|
|
23
28
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @
|
|
29
|
+
* Checks whether JavaScript execution is currently blocked on the page
|
|
30
|
+
* by attempting to execute a simple JavaScript command with a timeout.
|
|
31
|
+
*
|
|
32
|
+
* @param timeoutMs - The maximum amount of milliseconds to wait for a JavaScript
|
|
33
|
+
* command response. Defaults to 1000ms.
|
|
34
|
+
* @returns A promise that resolves to true if JavaScript execution is blocked,
|
|
35
|
+
* false if it is not blocked.
|
|
28
36
|
*/
|
|
29
|
-
export function isJavascriptExecutionBlocked(this:
|
|
37
|
+
export declare function isJavascriptExecutionBlocked(this: RemoteDebugger, timeoutMs?: number): Promise<boolean>;
|
|
30
38
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
39
|
+
* Triggers garbage collection on the page's JavaScript heap.
|
|
40
|
+
* This method will gracefully handle cases where garbage collection cannot
|
|
41
|
+
* be performed (e.g., when not connected to a page).
|
|
42
|
+
*
|
|
43
|
+
* @param timeoutMs - Maximum time in milliseconds to wait for garbage collection
|
|
44
|
+
* to complete. Defaults to GARBAGE_COLLECT_TIMEOUT_MS (5000ms).
|
|
34
45
|
*/
|
|
35
|
-
export function garbageCollect(this:
|
|
36
|
-
export type RemoteDebugger = import("../remote-debugger").RemoteDebugger;
|
|
46
|
+
export declare function garbageCollect(this: RemoteDebugger, timeoutMs?: number): Promise<void>;
|
|
37
47
|
//# sourceMappingURL=misc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../lib/mixins/misc.
|
|
1
|
+
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../lib/mixins/misc.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKzD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAItE;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,OAAO,UAAU,EAAE,aAAa,GACnC,OAAO,CAAC,GAAG,CAAC,CAOd;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CAMrE;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAOzF;AAED;;;;;;;;GAQG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,cAAc,EACpB,SAAS,GAAE,MAAa,GACvB,OAAO,CAAC,OAAO,CAAC,CAclB;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,cAAc,EACpB,SAAS,GAAE,MAAmC,GAC7C,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
|