playwright-core 1.54.0-alpha-2025-06-11 → 1.54.0-alpha-2025-06-13
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/browsers.json +10 -10
- package/lib/client/playwright.js +0 -1
- package/lib/generated/injectedScriptSource.js +1 -1
- package/lib/server/android/backendAdb.js +0 -2
- package/lib/server/bidi/bidiInput.js +19 -16
- package/lib/server/bidi/bidiPage.js +1 -1
- package/lib/server/browserContext.js +12 -7
- package/lib/server/browserType.js +1 -2
- package/lib/server/chromium/chromium.js +0 -1
- package/lib/server/chromium/crBrowser.js +3 -2
- package/lib/server/chromium/crConnection.js +8 -9
- package/lib/server/chromium/crDragDrop.js +7 -2
- package/lib/server/chromium/crInput.js +21 -11
- package/lib/server/chromium/crPage.js +2 -2
- package/lib/server/deviceDescriptorsSource.json +54 -54
- package/lib/server/dispatchers/androidDispatcher.js +22 -1
- package/lib/server/dispatchers/dispatcher.js +12 -14
- package/lib/server/dispatchers/jsonPipeDispatcher.js +2 -2
- package/lib/server/dispatchers/localUtilsDispatcher.js +1 -1
- package/lib/server/dispatchers/pageDispatcher.js +19 -14
- package/lib/server/dispatchers/playwrightDispatcher.js +4 -4
- package/lib/server/dispatchers/streamDispatcher.js +8 -2
- package/lib/server/dispatchers/webSocketRouteDispatcher.js +2 -2
- package/lib/server/dispatchers/writableStreamDispatcher.js +11 -5
- package/lib/server/dom.js +10 -11
- package/lib/server/electron/electron.js +1 -1
- package/lib/server/firefox/ffInput.js +16 -8
- package/lib/server/firefox/ffPage.js +2 -2
- package/lib/server/frames.js +7 -7
- package/lib/server/input.js +91 -52
- package/lib/server/instrumentation.js +8 -0
- package/lib/server/launchApp.js +1 -1
- package/lib/server/page.js +5 -7
- package/lib/server/playwright.js +1 -1
- package/lib/server/progress.js +1 -1
- package/lib/server/recorder/recorderRunner.js +1 -1
- package/lib/server/webkit/wkInput.js +17 -8
- package/lib/server/webkit/wkPage.js +1 -1
- package/lib/vite/traceViewer/assets/{codeMirrorModule-BKr-mZ2D.js → codeMirrorModule-CgepVw_3.js} +1 -1
- package/lib/vite/traceViewer/assets/{defaultSettingsView-CzQxXsO4.js → defaultSettingsView-3fKvgZ5q.js} +77 -77
- package/lib/vite/traceViewer/{index.BT-45kLv.js → index.B3b5SgUS.js} +1 -1
- package/lib/vite/traceViewer/index.html +2 -2
- package/lib/vite/traceViewer/{uiMode.BuGgfvGl.js → uiMode.D35cTLb_.js} +1 -1
- package/lib/vite/traceViewer/uiMode.html +2 -2
- package/package.json +1 -1
- package/types/types.d.ts +1 -0
|
@@ -34,7 +34,7 @@ var import_networkDispatchers = require("./networkDispatchers");
|
|
|
34
34
|
var import_networkDispatchers2 = require("./networkDispatchers");
|
|
35
35
|
var import_networkDispatchers3 = require("./networkDispatchers");
|
|
36
36
|
var import_webSocketRouteDispatcher = require("./webSocketRouteDispatcher");
|
|
37
|
-
var
|
|
37
|
+
var import_instrumentation = require("../instrumentation");
|
|
38
38
|
var import_urlMatch = require("../../utils/isomorphic/urlMatch");
|
|
39
39
|
class PageDispatcher extends import_dispatcher.Dispatcher {
|
|
40
40
|
constructor(parentScope, page) {
|
|
@@ -197,7 +197,7 @@ class PageDispatcher extends import_dispatcher.Dispatcher {
|
|
|
197
197
|
async close(params, metadata) {
|
|
198
198
|
if (!params.runBeforeUnload)
|
|
199
199
|
metadata.potentiallyClosesScope = true;
|
|
200
|
-
await this._page.close(
|
|
200
|
+
await this._page.close(params);
|
|
201
201
|
}
|
|
202
202
|
async updateSubscription(params) {
|
|
203
203
|
if (params.event === "fileChooser")
|
|
@@ -208,37 +208,42 @@ class PageDispatcher extends import_dispatcher.Dispatcher {
|
|
|
208
208
|
this._subscriptions.delete(params.event);
|
|
209
209
|
}
|
|
210
210
|
async keyboardDown(params, metadata) {
|
|
211
|
-
await this._page.keyboard.down(params.key);
|
|
211
|
+
await this._page.keyboard.down(metadata, params.key);
|
|
212
212
|
}
|
|
213
213
|
async keyboardUp(params, metadata) {
|
|
214
|
-
await this._page.keyboard.up(params.key);
|
|
214
|
+
await this._page.keyboard.up(metadata, params.key);
|
|
215
215
|
}
|
|
216
216
|
async keyboardInsertText(params, metadata) {
|
|
217
|
-
await this._page.keyboard.insertText(params.text);
|
|
217
|
+
await this._page.keyboard.insertText(metadata, params.text);
|
|
218
218
|
}
|
|
219
219
|
async keyboardType(params, metadata) {
|
|
220
|
-
await this._page.keyboard.type(params.text, params);
|
|
220
|
+
await this._page.keyboard.type(metadata, params.text, params);
|
|
221
221
|
}
|
|
222
222
|
async keyboardPress(params, metadata) {
|
|
223
|
-
await this._page.keyboard.press(params.key, params);
|
|
223
|
+
await this._page.keyboard.press(metadata, params.key, params);
|
|
224
224
|
}
|
|
225
225
|
async mouseMove(params, metadata) {
|
|
226
|
-
|
|
226
|
+
metadata.point = { x: params.x, y: params.y };
|
|
227
|
+
await this._page.mouse.move(metadata, params.x, params.y, params);
|
|
227
228
|
}
|
|
228
229
|
async mouseDown(params, metadata) {
|
|
229
|
-
|
|
230
|
+
metadata.point = this._page.mouse.currentPoint();
|
|
231
|
+
await this._page.mouse.down(metadata, params);
|
|
230
232
|
}
|
|
231
233
|
async mouseUp(params, metadata) {
|
|
232
|
-
|
|
234
|
+
metadata.point = this._page.mouse.currentPoint();
|
|
235
|
+
await this._page.mouse.up(metadata, params);
|
|
233
236
|
}
|
|
234
237
|
async mouseClick(params, metadata) {
|
|
235
|
-
|
|
238
|
+
metadata.point = { x: params.x, y: params.y };
|
|
239
|
+
await this._page.mouse.click(metadata, params.x, params.y, params);
|
|
236
240
|
}
|
|
237
241
|
async mouseWheel(params, metadata) {
|
|
238
|
-
await this._page.mouse.wheel(params.deltaX, params.deltaY);
|
|
242
|
+
await this._page.mouse.wheel(metadata, params.deltaX, params.deltaY);
|
|
239
243
|
}
|
|
240
244
|
async touchscreenTap(params, metadata) {
|
|
241
|
-
|
|
245
|
+
metadata.point = { x: params.x, y: params.y };
|
|
246
|
+
await this._page.touchscreen.tap(metadata, params.x, params.y);
|
|
242
247
|
}
|
|
243
248
|
async accessibilitySnapshot(params, metadata) {
|
|
244
249
|
const rootAXNode = await this._page.accessibility.snapshot({
|
|
@@ -338,7 +343,7 @@ class WorkerDispatcher extends import_dispatcher.Dispatcher {
|
|
|
338
343
|
class BindingCallDispatcher extends import_dispatcher.Dispatcher {
|
|
339
344
|
constructor(scope, name, needsHandle, source, args) {
|
|
340
345
|
const frameDispatcher = import_frameDispatcher.FrameDispatcher.from(scope.parentScope(), source.frame);
|
|
341
|
-
super(scope,
|
|
346
|
+
super(scope, new import_instrumentation.SdkObject(scope._object, "bindingCall"), "BindingCall", {
|
|
342
347
|
frame: frameDispatcher,
|
|
343
348
|
name,
|
|
344
349
|
args: needsHandle ? void 0 : args.map(import_jsHandleDispatcher.serializeResult),
|
|
@@ -31,7 +31,7 @@ var import_dispatcher = require("./dispatcher");
|
|
|
31
31
|
var import_electronDispatcher = require("./electronDispatcher");
|
|
32
32
|
var import_localUtilsDispatcher = require("./localUtilsDispatcher");
|
|
33
33
|
var import_networkDispatchers = require("./networkDispatchers");
|
|
34
|
-
var
|
|
34
|
+
var import_instrumentation = require("../instrumentation");
|
|
35
35
|
var import_eventsHelper = require("../utils/eventsHelper");
|
|
36
36
|
class PlaywrightDispatcher extends import_dispatcher.Dispatcher {
|
|
37
37
|
constructor(scope, playwright, options = {}) {
|
|
@@ -50,7 +50,7 @@ class PlaywrightDispatcher extends import_dispatcher.Dispatcher {
|
|
|
50
50
|
android,
|
|
51
51
|
electron: new import_electronDispatcher.ElectronDispatcher(scope, playwright.electron),
|
|
52
52
|
utils: playwright.options.isServer ? void 0 : new import_localUtilsDispatcher.LocalUtilsDispatcher(scope, playwright),
|
|
53
|
-
socksSupport: options.socksProxy ? new SocksSupportDispatcher(scope, options.socksProxy) : void 0
|
|
53
|
+
socksSupport: options.socksProxy ? new SocksSupportDispatcher(scope, playwright, options.socksProxy) : void 0
|
|
54
54
|
};
|
|
55
55
|
let browserDispatcher;
|
|
56
56
|
if (options.preLaunchedBrowser) {
|
|
@@ -92,8 +92,8 @@ class PlaywrightDispatcher extends import_dispatcher.Dispatcher {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
class SocksSupportDispatcher extends import_dispatcher.Dispatcher {
|
|
95
|
-
constructor(scope, socksProxy) {
|
|
96
|
-
super(scope,
|
|
95
|
+
constructor(scope, parent, socksProxy) {
|
|
96
|
+
super(scope, new import_instrumentation.SdkObject(parent, "socksSupport"), "SocksSupport", {});
|
|
97
97
|
this._type_SocksSupport = true;
|
|
98
98
|
this._socksProxy = socksProxy;
|
|
99
99
|
this._socksListeners = [
|
|
@@ -23,10 +23,16 @@ __export(streamDispatcher_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(streamDispatcher_exports);
|
|
24
24
|
var import_dispatcher = require("./dispatcher");
|
|
25
25
|
var import_manualPromise = require("../../utils/isomorphic/manualPromise");
|
|
26
|
-
var
|
|
26
|
+
var import_instrumentation = require("../instrumentation");
|
|
27
|
+
class StreamSdkObject extends import_instrumentation.SdkObject {
|
|
28
|
+
constructor(parent, stream) {
|
|
29
|
+
super(parent, "stream");
|
|
30
|
+
this.stream = stream;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
27
33
|
class StreamDispatcher extends import_dispatcher.Dispatcher {
|
|
28
34
|
constructor(scope, stream) {
|
|
29
|
-
super(scope,
|
|
35
|
+
super(scope, new StreamSdkObject(scope._object, stream), "Stream", {});
|
|
30
36
|
this._type_Stream = true;
|
|
31
37
|
this._ended = false;
|
|
32
38
|
stream.once("end", () => this._ended = true);
|
|
@@ -35,12 +35,12 @@ var import_page = require("../page");
|
|
|
35
35
|
var import_dispatcher = require("./dispatcher");
|
|
36
36
|
var import_pageDispatcher = require("./pageDispatcher");
|
|
37
37
|
var rawWebSocketMockSource = __toESM(require("../../generated/webSocketMockSource"));
|
|
38
|
-
var
|
|
38
|
+
var import_instrumentation = require("../instrumentation");
|
|
39
39
|
var import_urlMatch = require("../../utils/isomorphic/urlMatch");
|
|
40
40
|
var import_eventsHelper = require("../utils/eventsHelper");
|
|
41
41
|
class WebSocketRouteDispatcher extends import_dispatcher.Dispatcher {
|
|
42
42
|
constructor(scope, id, url, frame) {
|
|
43
|
-
super(scope,
|
|
43
|
+
super(scope, new import_instrumentation.SdkObject(scope._object, "webSocketRoute"), "WebSocketRoute", { url });
|
|
44
44
|
this._type_WebSocketRoute = true;
|
|
45
45
|
this._id = id;
|
|
46
46
|
this._frame = frame;
|
|
@@ -33,12 +33,18 @@ __export(writableStreamDispatcher_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(writableStreamDispatcher_exports);
|
|
34
34
|
var import_fs = __toESM(require("fs"));
|
|
35
35
|
var import_dispatcher = require("./dispatcher");
|
|
36
|
-
var
|
|
36
|
+
var import_instrumentation = require("../instrumentation");
|
|
37
|
+
class WritableStreamSdkObject extends import_instrumentation.SdkObject {
|
|
38
|
+
constructor(parent, streamOrDirectory, lastModifiedMs) {
|
|
39
|
+
super(parent, "stream");
|
|
40
|
+
this.streamOrDirectory = streamOrDirectory;
|
|
41
|
+
this.lastModifiedMs = lastModifiedMs;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
37
44
|
class WritableStreamDispatcher extends import_dispatcher.Dispatcher {
|
|
38
45
|
constructor(scope, streamOrDirectory, lastModifiedMs) {
|
|
39
|
-
super(scope,
|
|
46
|
+
super(scope, new WritableStreamSdkObject(scope._object, streamOrDirectory, lastModifiedMs), "WritableStream", {});
|
|
40
47
|
this._type_WritableStream = true;
|
|
41
|
-
this._lastModifiedMs = lastModifiedMs;
|
|
42
48
|
}
|
|
43
49
|
async write(params) {
|
|
44
50
|
if (typeof this._object.streamOrDirectory === "string")
|
|
@@ -58,8 +64,8 @@ class WritableStreamDispatcher extends import_dispatcher.Dispatcher {
|
|
|
58
64
|
throw new Error("Cannot close a directory");
|
|
59
65
|
const stream = this._object.streamOrDirectory;
|
|
60
66
|
await new Promise((fulfill) => stream.end(fulfill));
|
|
61
|
-
if (this.
|
|
62
|
-
await import_fs.default.promises.utimes(this.path(), new Date(this.
|
|
67
|
+
if (this._object.lastModifiedMs)
|
|
68
|
+
await import_fs.default.promises.utimes(this.path(), new Date(this._object.lastModifiedMs), new Date(this._object.lastModifiedMs));
|
|
63
69
|
}
|
|
64
70
|
path() {
|
|
65
71
|
if (typeof this._object.streamOrDirectory === "string")
|
package/lib/server/dom.js
CHANGED
|
@@ -86,7 +86,6 @@ class FrameExecutionContext extends js.ExecutionContext {
|
|
|
86
86
|
testIdAttributeName: selectorsRegistry.testIdAttributeName(),
|
|
87
87
|
stableRafCount: this.frame._page.delegate.rafCountForStablePosition(),
|
|
88
88
|
browserName: this.frame._page.browserContext._browser.options.name,
|
|
89
|
-
inputFileRoleTextbox: process.env.PLAYWRIGHT_INPUT_FILE_TEXTBOX ? true : false,
|
|
90
89
|
customEngines
|
|
91
90
|
};
|
|
92
91
|
const source = `
|
|
@@ -430,11 +429,11 @@ class ElementHandle extends js.JSHandle {
|
|
|
430
429
|
progress.throwIfAborted();
|
|
431
430
|
let restoreModifiers;
|
|
432
431
|
if (options && options.modifiers)
|
|
433
|
-
restoreModifiers = await this._page.keyboard.ensureModifiers(options.modifiers);
|
|
432
|
+
restoreModifiers = await this._page.keyboard.ensureModifiers(progress, options.modifiers);
|
|
434
433
|
progress.log(` performing ${actionName} action`);
|
|
435
434
|
await action(point);
|
|
436
435
|
if (restoreModifiers)
|
|
437
|
-
await this._page.keyboard.ensureModifiers(restoreModifiers);
|
|
436
|
+
await this._page.keyboard.ensureModifiers(progress, restoreModifiers);
|
|
438
437
|
if (hitTargetInterceptionHandle) {
|
|
439
438
|
const stopHitTargetInterception = this._frame.raceAgainstEvaluationStallingEvents(() => {
|
|
440
439
|
return hitTargetInterceptionHandle.evaluate((h) => h.stop());
|
|
@@ -475,7 +474,7 @@ class ElementHandle extends js.JSHandle {
|
|
|
475
474
|
}, options.timeout);
|
|
476
475
|
}
|
|
477
476
|
_hover(progress, options) {
|
|
478
|
-
return this._retryPointerAction(progress, "hover", false, (point) => this._page.mouse.
|
|
477
|
+
return this._retryPointerAction(progress, "hover", false, (point) => this._page.mouse._move(progress, point.x, point.y), { ...options, waitAfter: "disabled" });
|
|
479
478
|
}
|
|
480
479
|
async click(metadata, options) {
|
|
481
480
|
const controller = new import_progress.ProgressController(metadata, this);
|
|
@@ -486,7 +485,7 @@ class ElementHandle extends js.JSHandle {
|
|
|
486
485
|
}, options.timeout);
|
|
487
486
|
}
|
|
488
487
|
_click(progress, options) {
|
|
489
|
-
return this._retryPointerAction(progress, "click", true, (point) => this._page.mouse.
|
|
488
|
+
return this._retryPointerAction(progress, "click", true, (point) => this._page.mouse._click(progress, point.x, point.y, options), options);
|
|
490
489
|
}
|
|
491
490
|
async dblclick(metadata, options) {
|
|
492
491
|
const controller = new import_progress.ProgressController(metadata, this);
|
|
@@ -497,7 +496,7 @@ class ElementHandle extends js.JSHandle {
|
|
|
497
496
|
}, options.timeout);
|
|
498
497
|
}
|
|
499
498
|
_dblclick(progress, options) {
|
|
500
|
-
return this._retryPointerAction(progress, "dblclick", true, (point) => this._page.mouse.
|
|
499
|
+
return this._retryPointerAction(progress, "dblclick", true, (point) => this._page.mouse._click(progress, point.x, point.y, { ...options, clickCount: 2 }), { ...options, waitAfter: "disabled" });
|
|
501
500
|
}
|
|
502
501
|
async tap(metadata, options) {
|
|
503
502
|
const controller = new import_progress.ProgressController(metadata, this);
|
|
@@ -508,7 +507,7 @@ class ElementHandle extends js.JSHandle {
|
|
|
508
507
|
}, options.timeout);
|
|
509
508
|
}
|
|
510
509
|
_tap(progress, options) {
|
|
511
|
-
return this._retryPointerAction(progress, "tap", true, (point) => this._page.touchscreen.
|
|
510
|
+
return this._retryPointerAction(progress, "tap", true, (point) => this._page.touchscreen._tap(progress, point.x, point.y), { ...options, waitAfter: "disabled" });
|
|
512
511
|
}
|
|
513
512
|
async selectOption(metadata, elements, values, options) {
|
|
514
513
|
const controller = new import_progress.ProgressController(metadata, this);
|
|
@@ -569,9 +568,9 @@ class ElementHandle extends js.JSHandle {
|
|
|
569
568
|
progress.throwIfAborted();
|
|
570
569
|
if (result === "needsinput") {
|
|
571
570
|
if (value)
|
|
572
|
-
await this._page.keyboard.
|
|
571
|
+
await this._page.keyboard._insertText(progress, value);
|
|
573
572
|
else
|
|
574
|
-
await this._page.keyboard.
|
|
573
|
+
await this._page.keyboard._press(progress, "Delete");
|
|
575
574
|
return "done";
|
|
576
575
|
} else {
|
|
577
576
|
return result;
|
|
@@ -677,7 +676,7 @@ class ElementHandle extends js.JSHandle {
|
|
|
677
676
|
if (result !== "done")
|
|
678
677
|
return result;
|
|
679
678
|
progress.throwIfAborted();
|
|
680
|
-
await this._page.keyboard.
|
|
679
|
+
await this._page.keyboard._type(progress, text, options);
|
|
681
680
|
return "done";
|
|
682
681
|
}
|
|
683
682
|
async press(metadata, key, options) {
|
|
@@ -700,7 +699,7 @@ class ElementHandle extends js.JSHandle {
|
|
|
700
699
|
if (result !== "done")
|
|
701
700
|
return result;
|
|
702
701
|
progress.throwIfAborted();
|
|
703
|
-
await this._page.keyboard.
|
|
702
|
+
await this._page.keyboard._press(progress, key, options);
|
|
704
703
|
return "done";
|
|
705
704
|
});
|
|
706
705
|
}
|
|
@@ -203,7 +203,7 @@ class Electron extends import_instrumentation.SdkObject {
|
|
|
203
203
|
const debuggerDisconnectPromise = waitForLine(progress, launchedProcess, /Waiting for the debugger to disconnect\.\.\./);
|
|
204
204
|
const nodeMatch = await nodeMatchPromise;
|
|
205
205
|
const nodeTransport = await import_transport.WebSocketTransport.connect(progress, nodeMatch[1]);
|
|
206
|
-
const nodeConnection = new import_crConnection.CRConnection(nodeTransport, import_helper.helper.debugProtocolLogger(), browserLogsCollector);
|
|
206
|
+
const nodeConnection = new import_crConnection.CRConnection(this, nodeTransport, import_helper.helper.debugProtocolLogger(), browserLogsCollector);
|
|
207
207
|
debuggerDisconnectPromise.then(() => {
|
|
208
208
|
nodeTransport.close();
|
|
209
209
|
}).catch(() => {
|
|
@@ -58,7 +58,7 @@ class RawKeyboardImpl {
|
|
|
58
58
|
constructor(client) {
|
|
59
59
|
this._client = client;
|
|
60
60
|
}
|
|
61
|
-
async keydown(modifiers, keyName, description, autoRepeat) {
|
|
61
|
+
async keydown(progress, modifiers, keyName, description, autoRepeat) {
|
|
62
62
|
let text = description.text;
|
|
63
63
|
if (text === "\r")
|
|
64
64
|
text = "";
|
|
@@ -72,8 +72,9 @@ class RawKeyboardImpl {
|
|
|
72
72
|
location,
|
|
73
73
|
text
|
|
74
74
|
});
|
|
75
|
+
progress.throwIfAborted();
|
|
75
76
|
}
|
|
76
|
-
async keyup(modifiers, keyName, description) {
|
|
77
|
+
async keyup(progress, modifiers, keyName, description) {
|
|
77
78
|
const { code, key, location } = description;
|
|
78
79
|
await this._client.send("Page.dispatchKeyEvent", {
|
|
79
80
|
type: "keyup",
|
|
@@ -83,16 +84,18 @@ class RawKeyboardImpl {
|
|
|
83
84
|
location,
|
|
84
85
|
repeat: false
|
|
85
86
|
});
|
|
87
|
+
progress.throwIfAborted();
|
|
86
88
|
}
|
|
87
|
-
async sendText(text) {
|
|
89
|
+
async sendText(progress, text) {
|
|
88
90
|
await this._client.send("Page.insertText", { text });
|
|
91
|
+
progress.throwIfAborted();
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
94
|
class RawMouseImpl {
|
|
92
95
|
constructor(client) {
|
|
93
96
|
this._client = client;
|
|
94
97
|
}
|
|
95
|
-
async move(x, y, button, buttons, modifiers, forClick) {
|
|
98
|
+
async move(progress, x, y, button, buttons, modifiers, forClick) {
|
|
96
99
|
await this._client.send("Page.dispatchMouseEvent", {
|
|
97
100
|
type: "mousemove",
|
|
98
101
|
button: 0,
|
|
@@ -101,8 +104,9 @@ class RawMouseImpl {
|
|
|
101
104
|
y: Math.floor(y),
|
|
102
105
|
modifiers: toModifiersMask(modifiers)
|
|
103
106
|
});
|
|
107
|
+
progress.throwIfAborted();
|
|
104
108
|
}
|
|
105
|
-
async down(x, y, button, buttons, modifiers, clickCount) {
|
|
109
|
+
async down(progress, x, y, button, buttons, modifiers, clickCount) {
|
|
106
110
|
await this._client.send("Page.dispatchMouseEvent", {
|
|
107
111
|
type: "mousedown",
|
|
108
112
|
button: toButtonNumber(button),
|
|
@@ -112,8 +116,9 @@ class RawMouseImpl {
|
|
|
112
116
|
modifiers: toModifiersMask(modifiers),
|
|
113
117
|
clickCount
|
|
114
118
|
});
|
|
119
|
+
progress.throwIfAborted();
|
|
115
120
|
}
|
|
116
|
-
async up(x, y, button, buttons, modifiers, clickCount) {
|
|
121
|
+
async up(progress, x, y, button, buttons, modifiers, clickCount) {
|
|
117
122
|
await this._client.send("Page.dispatchMouseEvent", {
|
|
118
123
|
type: "mouseup",
|
|
119
124
|
button: toButtonNumber(button),
|
|
@@ -123,8 +128,9 @@ class RawMouseImpl {
|
|
|
123
128
|
modifiers: toModifiersMask(modifiers),
|
|
124
129
|
clickCount
|
|
125
130
|
});
|
|
131
|
+
progress.throwIfAborted();
|
|
126
132
|
}
|
|
127
|
-
async wheel(x, y, buttons, modifiers, deltaX, deltaY) {
|
|
133
|
+
async wheel(progress, x, y, buttons, modifiers, deltaX, deltaY) {
|
|
128
134
|
await this._page.mainFrame().evaluateExpression(`new Promise(requestAnimationFrame)`, { world: "utility" });
|
|
129
135
|
await this._client.send("Page.dispatchWheelEvent", {
|
|
130
136
|
deltaX,
|
|
@@ -134,6 +140,7 @@ class RawMouseImpl {
|
|
|
134
140
|
deltaZ: 0,
|
|
135
141
|
modifiers: toModifiersMask(modifiers)
|
|
136
142
|
});
|
|
143
|
+
progress.throwIfAborted();
|
|
137
144
|
}
|
|
138
145
|
setPage(page) {
|
|
139
146
|
this._page = page;
|
|
@@ -143,12 +150,13 @@ class RawTouchscreenImpl {
|
|
|
143
150
|
constructor(client) {
|
|
144
151
|
this._client = client;
|
|
145
152
|
}
|
|
146
|
-
async tap(x, y, modifiers) {
|
|
153
|
+
async tap(progress, x, y, modifiers) {
|
|
147
154
|
await this._client.send("Page.dispatchTapEvent", {
|
|
148
155
|
x,
|
|
149
156
|
y,
|
|
150
157
|
modifiers: toModifiersMask(modifiers)
|
|
151
158
|
});
|
|
159
|
+
progress.throwIfAborted();
|
|
152
160
|
}
|
|
153
161
|
}
|
|
154
162
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -475,8 +475,8 @@ class FFPage {
|
|
|
475
475
|
}
|
|
476
476
|
async inputActionEpilogue() {
|
|
477
477
|
}
|
|
478
|
-
async resetForReuse() {
|
|
479
|
-
await this.rawMouse.move(-1, -1, "none", /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), false);
|
|
478
|
+
async resetForReuse(progress) {
|
|
479
|
+
await this.rawMouse.move(progress, -1, -1, "none", /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), false);
|
|
480
480
|
}
|
|
481
481
|
async getFrameElement(frame) {
|
|
482
482
|
const parent = frame.parentFrame();
|
package/lib/server/frames.js
CHANGED
|
@@ -488,7 +488,7 @@ class Frame extends import_instrumentation.SdkObject {
|
|
|
488
488
|
const controller = new import_progress.ProgressController((0, import_instrumentation.serverSideCallMetadata)(), this);
|
|
489
489
|
const data = {
|
|
490
490
|
url,
|
|
491
|
-
gotoPromise: controller.run((progress) => this.
|
|
491
|
+
gotoPromise: controller.run((progress) => this.gotoImpl(progress, url, { referer }), 0)
|
|
492
492
|
};
|
|
493
493
|
this._redirectedNavigations.set(documentId, data);
|
|
494
494
|
data.gotoPromise.finally(() => this._redirectedNavigations.delete(documentId));
|
|
@@ -497,10 +497,10 @@ class Frame extends import_instrumentation.SdkObject {
|
|
|
497
497
|
const constructedNavigationURL = (0, import_utils.constructURLBasedOnBaseURL)(this._page.browserContext._options.baseURL, url);
|
|
498
498
|
const controller = new import_progress.ProgressController(metadata, this);
|
|
499
499
|
return controller.run((progress) => {
|
|
500
|
-
return this.raceNavigationAction(progress, options, async () => this.
|
|
500
|
+
return this.raceNavigationAction(progress, options, async () => this.gotoImpl(progress, constructedNavigationURL, options));
|
|
501
501
|
}, options.timeout);
|
|
502
502
|
}
|
|
503
|
-
async
|
|
503
|
+
async gotoImpl(progress, url, options) {
|
|
504
504
|
const waitUntil = verifyLifecycle("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
|
|
505
505
|
progress.log(`navigating to "${url}", waiting until "${waitUntil}"`);
|
|
506
506
|
const headers = this._page.extraHTTPHeaders() || [];
|
|
@@ -971,8 +971,8 @@ class Frame extends import_instrumentation.SdkObject {
|
|
|
971
971
|
await controller.run(async (progress) => {
|
|
972
972
|
dom.assertDone(await this._retryWithProgressIfNotConnected(progress, source, options.strict, !options.force, async (handle) => {
|
|
973
973
|
return handle._retryPointerAction(progress, "move and down", false, async (point) => {
|
|
974
|
-
await this._page.mouse.
|
|
975
|
-
await this._page.mouse.
|
|
974
|
+
await this._page.mouse._move(progress, point.x, point.y);
|
|
975
|
+
await this._page.mouse._down(progress);
|
|
976
976
|
}, {
|
|
977
977
|
...options,
|
|
978
978
|
waitAfter: "disabled",
|
|
@@ -982,8 +982,8 @@ class Frame extends import_instrumentation.SdkObject {
|
|
|
982
982
|
}));
|
|
983
983
|
dom.assertDone(await this._retryWithProgressIfNotConnected(progress, target, options.strict, false, async (handle) => {
|
|
984
984
|
return handle._retryPointerAction(progress, "move and up", false, async (point) => {
|
|
985
|
-
await this._page.mouse.
|
|
986
|
-
await this._page.mouse.
|
|
985
|
+
await this._page.mouse._move(progress, point.x, point.y);
|
|
986
|
+
await this._page.mouse._up(progress);
|
|
987
987
|
}, {
|
|
988
988
|
...options,
|
|
989
989
|
waitAfter: "disabled",
|