brave-real-playwright-core 1.0.1
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/LICENSE +202 -0
- package/README.md +55 -0
- package/advanced-stealth.js +629 -0
- package/cli.js +18 -0
- package/index.d.ts +17 -0
- package/index.js +32 -0
- package/lib/androidServerImpl.js +65 -0
- package/lib/browserServerImpl.js +123 -0
- package/lib/cli/driver.js +97 -0
- package/lib/cli/program.js +633 -0
- package/lib/cli/programWithTestStub.js +74 -0
- package/lib/client/accessibility.js +49 -0
- package/lib/client/android.js +361 -0
- package/lib/client/api.js +137 -0
- package/lib/client/artifact.js +79 -0
- package/lib/client/browser.js +173 -0
- package/lib/client/browserContext.js +535 -0
- package/lib/client/browserType.js +184 -0
- package/lib/client/cdpSession.js +51 -0
- package/lib/client/channelOwner.js +201 -0
- package/lib/client/clientHelper.js +64 -0
- package/lib/client/clientInstrumentation.js +55 -0
- package/lib/client/clientStackTrace.js +69 -0
- package/lib/client/clock.js +68 -0
- package/lib/client/connection.js +314 -0
- package/lib/client/consoleMessage.js +55 -0
- package/lib/client/coverage.js +44 -0
- package/lib/client/dialog.js +56 -0
- package/lib/client/download.js +62 -0
- package/lib/client/electron.js +138 -0
- package/lib/client/elementHandle.js +281 -0
- package/lib/client/errors.js +77 -0
- package/lib/client/eventEmitter.js +314 -0
- package/lib/client/events.js +98 -0
- package/lib/client/fetch.js +369 -0
- package/lib/client/fileChooser.js +46 -0
- package/lib/client/fileUtils.js +34 -0
- package/lib/client/frame.js +408 -0
- package/lib/client/harRouter.js +87 -0
- package/lib/client/input.js +84 -0
- package/lib/client/jsHandle.js +109 -0
- package/lib/client/jsonPipe.js +39 -0
- package/lib/client/localUtils.js +60 -0
- package/lib/client/locator.js +366 -0
- package/lib/client/network.js +744 -0
- package/lib/client/page.js +709 -0
- package/lib/client/platform.js +74 -0
- package/lib/client/playwright.js +75 -0
- package/lib/client/selectors.js +55 -0
- package/lib/client/stream.js +39 -0
- package/lib/client/timeoutSettings.js +79 -0
- package/lib/client/tracing.js +117 -0
- package/lib/client/types.js +28 -0
- package/lib/client/video.js +59 -0
- package/lib/client/waiter.js +142 -0
- package/lib/client/webError.js +39 -0
- package/lib/client/webSocket.js +93 -0
- package/lib/client/worker.js +63 -0
- package/lib/client/writableStream.js +39 -0
- package/lib/generated/bindingsControllerSource.js +28 -0
- package/lib/generated/clockSource.js +28 -0
- package/lib/generated/injectedScriptSource.js +28 -0
- package/lib/generated/pollingRecorderSource.js +28 -0
- package/lib/generated/storageScriptSource.js +28 -0
- package/lib/generated/utilityScriptSource.js +28 -0
- package/lib/generated/webSocketMockSource.js +336 -0
- package/lib/inProcessFactory.js +62 -0
- package/lib/inprocess.js +3 -0
- package/lib/outofprocess.js +76 -0
- package/lib/protocol/serializers.js +192 -0
- package/lib/protocol/validator.js +2901 -0
- package/lib/protocol/validatorPrimitives.js +193 -0
- package/lib/remote/playwrightConnection.js +129 -0
- package/lib/remote/playwrightServer.js +337 -0
- package/lib/server/accessibility.js +69 -0
- package/lib/server/android/android.js +465 -0
- package/lib/server/android/backendAdb.js +177 -0
- package/lib/server/artifact.js +127 -0
- package/lib/server/bidi/bidiBrowser.js +446 -0
- package/lib/server/bidi/bidiChromium.js +153 -0
- package/lib/server/bidi/bidiConnection.js +187 -0
- package/lib/server/bidi/bidiExecutionContext.js +221 -0
- package/lib/server/bidi/bidiFirefox.js +115 -0
- package/lib/server/bidi/bidiInput.js +146 -0
- package/lib/server/bidi/bidiNetworkManager.js +317 -0
- package/lib/server/bidi/bidiOverCdp.js +102 -0
- package/lib/server/bidi/bidiPage.js +486 -0
- package/lib/server/bidi/bidiPdf.js +106 -0
- package/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
- package/lib/server/bidi/third_party/bidiDeserializer.js +98 -0
- package/lib/server/bidi/third_party/bidiKeyboard.js +256 -0
- package/lib/server/bidi/third_party/bidiProtocol.js +24 -0
- package/lib/server/bidi/third_party/bidiProtocolCore.js +179 -0
- package/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -0
- package/lib/server/bidi/third_party/bidiSerializer.js +148 -0
- package/lib/server/bidi/third_party/firefoxPrefs.js +259 -0
- package/lib/server/browser.js +149 -0
- package/lib/server/browserContext.js +696 -0
- package/lib/server/browserType.js +328 -0
- package/lib/server/callLog.js +82 -0
- package/lib/server/chromium/appIcon.png +0 -0
- package/lib/server/chromium/chromium.js +391 -0
- package/lib/server/chromium/chromiumSwitches.js +93 -0
- package/lib/server/chromium/crAccessibility.js +263 -0
- package/lib/server/chromium/crBrowser.js +532 -0
- package/lib/server/chromium/crConnection.js +323 -0
- package/lib/server/chromium/crCoverage.js +235 -0
- package/lib/server/chromium/crDevTools.js +117 -0
- package/lib/server/chromium/crDragDrop.js +131 -0
- package/lib/server/chromium/crExecutionContext.js +160 -0
- package/lib/server/chromium/crInput.js +187 -0
- package/lib/server/chromium/crNetworkManager.js +666 -0
- package/lib/server/chromium/crPage.js +1078 -0
- package/lib/server/chromium/crPdf.js +121 -0
- package/lib/server/chromium/crProtocolHelper.js +145 -0
- package/lib/server/chromium/crServiceWorker.js +125 -0
- package/lib/server/chromium/defaultFontFamilies.js +162 -0
- package/lib/server/chromium/protocol.d.js +16 -0
- package/lib/server/chromium/videoRecorder.js +113 -0
- package/lib/server/clock.js +149 -0
- package/lib/server/codegen/csharp.js +334 -0
- package/lib/server/codegen/java.js +270 -0
- package/lib/server/codegen/javascript.js +268 -0
- package/lib/server/codegen/jsonl.js +52 -0
- package/lib/server/codegen/language.js +132 -0
- package/lib/server/codegen/languages.js +68 -0
- package/lib/server/codegen/python.js +277 -0
- package/lib/server/codegen/types.js +16 -0
- package/lib/server/console.js +53 -0
- package/lib/server/cookieStore.js +206 -0
- package/lib/server/debugController.js +219 -0
- package/lib/server/debugger.js +119 -0
- package/lib/server/deviceDescriptors.js +39 -0
- package/lib/server/deviceDescriptorsSource.json +1779 -0
- package/lib/server/dialog.js +116 -0
- package/lib/server/dispatchers/androidDispatcher.js +308 -0
- package/lib/server/dispatchers/artifactDispatcher.js +118 -0
- package/lib/server/dispatchers/browserContextDispatcher.js +378 -0
- package/lib/server/dispatchers/browserDispatcher.js +118 -0
- package/lib/server/dispatchers/browserTypeDispatcher.js +64 -0
- package/lib/server/dispatchers/cdpSessionDispatcher.js +44 -0
- package/lib/server/dispatchers/debugControllerDispatcher.js +78 -0
- package/lib/server/dispatchers/dialogDispatcher.js +47 -0
- package/lib/server/dispatchers/dispatcher.js +371 -0
- package/lib/server/dispatchers/electronDispatcher.js +89 -0
- package/lib/server/dispatchers/elementHandlerDispatcher.js +181 -0
- package/lib/server/dispatchers/frameDispatcher.js +227 -0
- package/lib/server/dispatchers/jsHandleDispatcher.js +85 -0
- package/lib/server/dispatchers/jsonPipeDispatcher.js +58 -0
- package/lib/server/dispatchers/localUtilsDispatcher.js +149 -0
- package/lib/server/dispatchers/networkDispatchers.js +210 -0
- package/lib/server/dispatchers/pageDispatcher.js +377 -0
- package/lib/server/dispatchers/playwrightDispatcher.js +112 -0
- package/lib/server/dispatchers/streamDispatcher.js +67 -0
- package/lib/server/dispatchers/tracingDispatcher.js +68 -0
- package/lib/server/dispatchers/webSocketRouteDispatcher.js +165 -0
- package/lib/server/dispatchers/writableStreamDispatcher.js +79 -0
- package/lib/server/dom.js +801 -0
- package/lib/server/download.js +70 -0
- package/lib/server/electron/electron.js +270 -0
- package/lib/server/electron/loader.js +29 -0
- package/lib/server/errors.js +69 -0
- package/lib/server/fetch.js +621 -0
- package/lib/server/fileChooser.js +43 -0
- package/lib/server/fileUploadUtils.js +84 -0
- package/lib/server/firefox/ffAccessibility.js +238 -0
- package/lib/server/firefox/ffBrowser.js +428 -0
- package/lib/server/firefox/ffConnection.js +147 -0
- package/lib/server/firefox/ffExecutionContext.js +150 -0
- package/lib/server/firefox/ffInput.js +159 -0
- package/lib/server/firefox/ffNetworkManager.js +256 -0
- package/lib/server/firefox/ffPage.js +504 -0
- package/lib/server/firefox/firefox.js +105 -0
- package/lib/server/firefox/protocol.d.js +16 -0
- package/lib/server/formData.js +147 -0
- package/lib/server/frameSelectors.js +156 -0
- package/lib/server/frames.js +1460 -0
- package/lib/server/har/harRecorder.js +147 -0
- package/lib/server/har/harTracer.js +608 -0
- package/lib/server/harBackend.js +157 -0
- package/lib/server/helper.js +96 -0
- package/lib/server/index.js +58 -0
- package/lib/server/input.js +273 -0
- package/lib/server/instrumentation.js +69 -0
- package/lib/server/javascript.js +291 -0
- package/lib/server/launchApp.js +128 -0
- package/lib/server/localUtils.js +218 -0
- package/lib/server/macEditingCommands.js +143 -0
- package/lib/server/network.js +617 -0
- package/lib/server/page.js +862 -0
- package/lib/server/pipeTransport.js +89 -0
- package/lib/server/playwright.js +71 -0
- package/lib/server/progress.js +112 -0
- package/lib/server/protocolError.js +52 -0
- package/lib/server/recorder/chat.js +161 -0
- package/lib/server/recorder/recorderApp.js +387 -0
- package/lib/server/recorder/recorderRunner.js +134 -0
- package/lib/server/recorder/recorderSignalProcessor.js +83 -0
- package/lib/server/recorder/recorderUtils.js +157 -0
- package/lib/server/recorder/throttledFile.js +57 -0
- package/lib/server/recorder.js +498 -0
- package/lib/server/registry/browserFetcher.js +175 -0
- package/lib/server/registry/dependencies.js +371 -0
- package/lib/server/registry/index.js +1306 -0
- package/lib/server/registry/nativeDeps.js +1280 -0
- package/lib/server/registry/oopDownloadBrowserMain.js +120 -0
- package/lib/server/screenshotter.js +333 -0
- package/lib/server/selectors.js +112 -0
- package/lib/server/socksClientCertificatesInterceptor.js +383 -0
- package/lib/server/socksInterceptor.js +95 -0
- package/lib/server/trace/recorder/snapshotter.js +136 -0
- package/lib/server/trace/recorder/snapshotterInjected.js +539 -0
- package/lib/server/trace/recorder/tracing.js +602 -0
- package/lib/server/trace/test/inMemorySnapshotter.js +87 -0
- package/lib/server/trace/viewer/traceViewer.js +240 -0
- package/lib/server/transport.js +181 -0
- package/lib/server/types.js +28 -0
- package/lib/server/usKeyboardLayout.js +145 -0
- package/lib/server/utils/ascii.js +44 -0
- package/lib/server/utils/comparators.js +161 -0
- package/lib/server/utils/crypto.js +216 -0
- package/lib/server/utils/debug.js +42 -0
- package/lib/server/utils/debugLogger.js +122 -0
- package/lib/server/utils/env.js +68 -0
- package/lib/server/utils/eventsHelper.js +39 -0
- package/lib/server/utils/expectUtils.js +38 -0
- package/lib/server/utils/fileUtils.js +191 -0
- package/lib/server/utils/happyEyeballs.js +207 -0
- package/lib/server/utils/hostPlatform.js +111 -0
- package/lib/server/utils/httpServer.js +218 -0
- package/lib/server/utils/image_tools/colorUtils.js +89 -0
- package/lib/server/utils/image_tools/compare.js +109 -0
- package/lib/server/utils/image_tools/imageChannel.js +78 -0
- package/lib/server/utils/image_tools/stats.js +102 -0
- package/lib/server/utils/linuxUtils.js +71 -0
- package/lib/server/utils/network.js +227 -0
- package/lib/server/utils/nodePlatform.js +148 -0
- package/lib/server/utils/pipeTransport.js +84 -0
- package/lib/server/utils/processLauncher.js +241 -0
- package/lib/server/utils/profiler.js +65 -0
- package/lib/server/utils/socksProxy.js +511 -0
- package/lib/server/utils/spawnAsync.js +41 -0
- package/lib/server/utils/task.js +51 -0
- package/lib/server/utils/userAgent.js +98 -0
- package/lib/server/utils/wsServer.js +126 -0
- package/lib/server/utils/zipFile.js +74 -0
- package/lib/server/utils/zones.js +57 -0
- package/lib/server/webkit/protocol.d.js +16 -0
- package/lib/server/webkit/webkit.js +103 -0
- package/lib/server/webkit/wkAccessibility.js +237 -0
- package/lib/server/webkit/wkBrowser.js +335 -0
- package/lib/server/webkit/wkConnection.js +149 -0
- package/lib/server/webkit/wkExecutionContext.js +154 -0
- package/lib/server/webkit/wkInput.js +181 -0
- package/lib/server/webkit/wkInterceptableRequest.js +169 -0
- package/lib/server/webkit/wkPage.js +1135 -0
- package/lib/server/webkit/wkProvisionalPage.js +83 -0
- package/lib/server/webkit/wkWorkers.js +104 -0
- package/lib/third_party/pixelmatch.js +255 -0
- package/lib/utils/isomorphic/ariaSnapshot.js +390 -0
- package/lib/utils/isomorphic/assert.js +31 -0
- package/lib/utils/isomorphic/colors.js +72 -0
- package/lib/utils/isomorphic/cssParser.js +245 -0
- package/lib/utils/isomorphic/cssTokenizer.js +1051 -0
- package/lib/utils/isomorphic/headers.js +53 -0
- package/lib/utils/isomorphic/locatorGenerators.js +673 -0
- package/lib/utils/isomorphic/locatorParser.js +176 -0
- package/lib/utils/isomorphic/locatorUtils.js +81 -0
- package/lib/utils/isomorphic/manualPromise.js +114 -0
- package/lib/utils/isomorphic/mimeType.js +459 -0
- package/lib/utils/isomorphic/multimap.js +80 -0
- package/lib/utils/isomorphic/protocolFormatter.js +78 -0
- package/lib/utils/isomorphic/protocolMetainfo.js +318 -0
- package/lib/utils/isomorphic/rtti.js +43 -0
- package/lib/utils/isomorphic/selectorParser.js +386 -0
- package/lib/utils/isomorphic/semaphore.js +54 -0
- package/lib/utils/isomorphic/stackTrace.js +158 -0
- package/lib/utils/isomorphic/stringUtils.js +155 -0
- package/lib/utils/isomorphic/time.js +49 -0
- package/lib/utils/isomorphic/timeoutRunner.js +66 -0
- package/lib/utils/isomorphic/traceUtils.js +58 -0
- package/lib/utils/isomorphic/types.js +16 -0
- package/lib/utils/isomorphic/urlMatch.js +181 -0
- package/lib/utils/isomorphic/utilityScriptSerializers.js +251 -0
- package/lib/utils.js +107 -0
- package/lib/utilsBundle.js +106 -0
- package/lib/utilsBundleImpl/index.js +218 -0
- package/lib/utilsBundleImpl/xdg-open +1066 -0
- package/lib/vite/htmlReport/index.html +75 -0
- package/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +1 -0
- package/lib/vite/recorder/assets/codeMirrorModule-DzQ0k89p.js +24 -0
- package/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/lib/vite/recorder/assets/index-CI4HQ-Zb.css +1 -0
- package/lib/vite/recorder/assets/index-D7C7daHH.js +184 -0
- package/lib/vite/recorder/index.html +29 -0
- package/lib/vite/recorder/playwright-logo.svg +9 -0
- package/lib/vite/traceViewer/assets/codeMirrorModule-B9MwJ51G.js +24 -0
- package/lib/vite/traceViewer/assets/defaultSettingsView-Do_wwdKw.js +256 -0
- package/lib/vite/traceViewer/assets/xtermModule-BoAIEibi.js +9 -0
- package/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +1 -0
- package/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/lib/vite/traceViewer/defaultSettingsView.DVJHpiGt.css +1 -0
- package/lib/vite/traceViewer/index.BFsek2M6.css +1 -0
- package/lib/vite/traceViewer/index.BZPYnuWQ.js +2 -0
- package/lib/vite/traceViewer/index.html +43 -0
- package/lib/vite/traceViewer/playwright-logo.svg +9 -0
- package/lib/vite/traceViewer/snapshot.html +21 -0
- package/lib/vite/traceViewer/sw.bundle.js +3 -0
- package/lib/vite/traceViewer/uiMode.9zHYMU6d.js +5 -0
- package/lib/vite/traceViewer/uiMode.BatfzHMG.css +1 -0
- package/lib/vite/traceViewer/uiMode.html +17 -0
- package/lib/vite/traceViewer/xtermModule.Beg8tuEN.css +32 -0
- package/lib/zipBundle.js +34 -0
- package/lib/zipBundleImpl.js +5 -0
- package/package.json +64 -0
- package/stealth-injection.js +592 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var elementHandlerDispatcher_exports = {};
|
|
20
|
+
__export(elementHandlerDispatcher_exports, {
|
|
21
|
+
ElementHandleDispatcher: () => ElementHandleDispatcher
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(elementHandlerDispatcher_exports);
|
|
24
|
+
var import_browserContextDispatcher = require("./browserContextDispatcher");
|
|
25
|
+
var import_frameDispatcher = require("./frameDispatcher");
|
|
26
|
+
var import_jsHandleDispatcher = require("./jsHandleDispatcher");
|
|
27
|
+
class ElementHandleDispatcher extends import_jsHandleDispatcher.JSHandleDispatcher {
|
|
28
|
+
constructor(scope, elementHandle) {
|
|
29
|
+
super(scope, elementHandle);
|
|
30
|
+
this._type_ElementHandle = true;
|
|
31
|
+
this._elementHandle = elementHandle;
|
|
32
|
+
}
|
|
33
|
+
static from(scope, handle) {
|
|
34
|
+
return scope.connection.existingDispatcher(handle) || new ElementHandleDispatcher(scope, handle);
|
|
35
|
+
}
|
|
36
|
+
static fromNullable(scope, handle) {
|
|
37
|
+
if (!handle)
|
|
38
|
+
return void 0;
|
|
39
|
+
return scope.connection.existingDispatcher(handle) || new ElementHandleDispatcher(scope, handle);
|
|
40
|
+
}
|
|
41
|
+
static fromJSOrElementHandle(scope, handle) {
|
|
42
|
+
const result = scope.connection.existingDispatcher(handle);
|
|
43
|
+
if (result)
|
|
44
|
+
return result;
|
|
45
|
+
const elementHandle = handle.asElement();
|
|
46
|
+
if (!elementHandle)
|
|
47
|
+
return new import_jsHandleDispatcher.JSHandleDispatcher(scope, handle);
|
|
48
|
+
return new ElementHandleDispatcher(scope, elementHandle);
|
|
49
|
+
}
|
|
50
|
+
async ownerFrame(params, progress) {
|
|
51
|
+
const frame = await this._elementHandle.ownerFrame();
|
|
52
|
+
return { frame: frame ? import_frameDispatcher.FrameDispatcher.from(this._browserContextDispatcher(), frame) : void 0 };
|
|
53
|
+
}
|
|
54
|
+
async contentFrame(params, progress) {
|
|
55
|
+
const frame = await progress.race(this._elementHandle.contentFrame());
|
|
56
|
+
return { frame: frame ? import_frameDispatcher.FrameDispatcher.from(this._browserContextDispatcher(), frame) : void 0 };
|
|
57
|
+
}
|
|
58
|
+
async getAttribute(params, progress) {
|
|
59
|
+
const value = await this._elementHandle.getAttribute(progress, params.name);
|
|
60
|
+
return { value: value === null ? void 0 : value };
|
|
61
|
+
}
|
|
62
|
+
async inputValue(params, progress) {
|
|
63
|
+
const value = await this._elementHandle.inputValue(progress);
|
|
64
|
+
return { value };
|
|
65
|
+
}
|
|
66
|
+
async textContent(params, progress) {
|
|
67
|
+
const value = await this._elementHandle.textContent(progress);
|
|
68
|
+
return { value: value === null ? void 0 : value };
|
|
69
|
+
}
|
|
70
|
+
async innerText(params, progress) {
|
|
71
|
+
return { value: await this._elementHandle.innerText(progress) };
|
|
72
|
+
}
|
|
73
|
+
async innerHTML(params, progress) {
|
|
74
|
+
return { value: await this._elementHandle.innerHTML(progress) };
|
|
75
|
+
}
|
|
76
|
+
async isChecked(params, progress) {
|
|
77
|
+
return { value: await this._elementHandle.isChecked(progress) };
|
|
78
|
+
}
|
|
79
|
+
async isDisabled(params, progress) {
|
|
80
|
+
return { value: await this._elementHandle.isDisabled(progress) };
|
|
81
|
+
}
|
|
82
|
+
async isEditable(params, progress) {
|
|
83
|
+
return { value: await this._elementHandle.isEditable(progress) };
|
|
84
|
+
}
|
|
85
|
+
async isEnabled(params, progress) {
|
|
86
|
+
return { value: await this._elementHandle.isEnabled(progress) };
|
|
87
|
+
}
|
|
88
|
+
async isHidden(params, progress) {
|
|
89
|
+
return { value: await this._elementHandle.isHidden(progress) };
|
|
90
|
+
}
|
|
91
|
+
async isVisible(params, progress) {
|
|
92
|
+
return { value: await this._elementHandle.isVisible(progress) };
|
|
93
|
+
}
|
|
94
|
+
async dispatchEvent(params, progress) {
|
|
95
|
+
await this._elementHandle.dispatchEvent(progress, params.type, (0, import_jsHandleDispatcher.parseArgument)(params.eventInit));
|
|
96
|
+
}
|
|
97
|
+
async scrollIntoViewIfNeeded(params, progress) {
|
|
98
|
+
await this._elementHandle.scrollIntoViewIfNeeded(progress);
|
|
99
|
+
}
|
|
100
|
+
async hover(params, progress) {
|
|
101
|
+
return await this._elementHandle.hover(progress, params);
|
|
102
|
+
}
|
|
103
|
+
async click(params, progress) {
|
|
104
|
+
return await this._elementHandle.click(progress, params);
|
|
105
|
+
}
|
|
106
|
+
async dblclick(params, progress) {
|
|
107
|
+
return await this._elementHandle.dblclick(progress, params);
|
|
108
|
+
}
|
|
109
|
+
async tap(params, progress) {
|
|
110
|
+
return await this._elementHandle.tap(progress, params);
|
|
111
|
+
}
|
|
112
|
+
async selectOption(params, progress) {
|
|
113
|
+
const elements = (params.elements || []).map((e) => e._elementHandle);
|
|
114
|
+
return { values: await this._elementHandle.selectOption(progress, elements, params.options || [], params) };
|
|
115
|
+
}
|
|
116
|
+
async fill(params, progress) {
|
|
117
|
+
return await this._elementHandle.fill(progress, params.value, params);
|
|
118
|
+
}
|
|
119
|
+
async selectText(params, progress) {
|
|
120
|
+
await this._elementHandle.selectText(progress, params);
|
|
121
|
+
}
|
|
122
|
+
async setInputFiles(params, progress) {
|
|
123
|
+
return await this._elementHandle.setInputFiles(progress, params);
|
|
124
|
+
}
|
|
125
|
+
async focus(params, progress) {
|
|
126
|
+
await this._elementHandle.focus(progress);
|
|
127
|
+
}
|
|
128
|
+
async type(params, progress) {
|
|
129
|
+
return await this._elementHandle.type(progress, params.text, params);
|
|
130
|
+
}
|
|
131
|
+
async press(params, progress) {
|
|
132
|
+
return await this._elementHandle.press(progress, params.key, params);
|
|
133
|
+
}
|
|
134
|
+
async check(params, progress) {
|
|
135
|
+
return await this._elementHandle.check(progress, params);
|
|
136
|
+
}
|
|
137
|
+
async uncheck(params, progress) {
|
|
138
|
+
return await this._elementHandle.uncheck(progress, params);
|
|
139
|
+
}
|
|
140
|
+
async boundingBox(params, progress) {
|
|
141
|
+
const value = await progress.race(this._elementHandle.boundingBox());
|
|
142
|
+
return { value: value || void 0 };
|
|
143
|
+
}
|
|
144
|
+
async screenshot(params, progress) {
|
|
145
|
+
const mask = (params.mask || []).map(({ frame, selector }) => ({
|
|
146
|
+
frame: frame._object,
|
|
147
|
+
selector
|
|
148
|
+
}));
|
|
149
|
+
return { binary: await this._elementHandle.screenshot(progress, { ...params, mask }) };
|
|
150
|
+
}
|
|
151
|
+
async querySelector(params, progress) {
|
|
152
|
+
const handle = await progress.race(this._elementHandle.querySelector(params.selector, params));
|
|
153
|
+
return { element: ElementHandleDispatcher.fromNullable(this.parentScope(), handle) };
|
|
154
|
+
}
|
|
155
|
+
async querySelectorAll(params, progress) {
|
|
156
|
+
const elements = await progress.race(this._elementHandle.querySelectorAll(params.selector));
|
|
157
|
+
return { elements: elements.map((e) => ElementHandleDispatcher.from(this.parentScope(), e)) };
|
|
158
|
+
}
|
|
159
|
+
async evalOnSelector(params, progress) {
|
|
160
|
+
return { value: (0, import_jsHandleDispatcher.serializeResult)(await progress.race(this._elementHandle.evalOnSelector(params.selector, !!params.strict, params.expression, params.isFunction, (0, import_jsHandleDispatcher.parseArgument)(params.arg)))) };
|
|
161
|
+
}
|
|
162
|
+
async evalOnSelectorAll(params, progress) {
|
|
163
|
+
return { value: (0, import_jsHandleDispatcher.serializeResult)(await progress.race(this._elementHandle.evalOnSelectorAll(params.selector, params.expression, params.isFunction, (0, import_jsHandleDispatcher.parseArgument)(params.arg)))) };
|
|
164
|
+
}
|
|
165
|
+
async waitForElementState(params, progress) {
|
|
166
|
+
await this._elementHandle.waitForElementState(progress, params.state);
|
|
167
|
+
}
|
|
168
|
+
async waitForSelector(params, progress) {
|
|
169
|
+
return { element: ElementHandleDispatcher.fromNullable(this.parentScope(), await this._elementHandle.waitForSelector(progress, params.selector, params)) };
|
|
170
|
+
}
|
|
171
|
+
_browserContextDispatcher() {
|
|
172
|
+
const parentScope = this.parentScope().parentScope();
|
|
173
|
+
if (parentScope instanceof import_browserContextDispatcher.BrowserContextDispatcher)
|
|
174
|
+
return parentScope;
|
|
175
|
+
return parentScope.parentScope();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
179
|
+
0 && (module.exports = {
|
|
180
|
+
ElementHandleDispatcher
|
|
181
|
+
});
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var frameDispatcher_exports = {};
|
|
20
|
+
__export(frameDispatcher_exports, {
|
|
21
|
+
FrameDispatcher: () => FrameDispatcher
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(frameDispatcher_exports);
|
|
24
|
+
var import_frames = require("../frames");
|
|
25
|
+
var import_dispatcher = require("./dispatcher");
|
|
26
|
+
var import_elementHandlerDispatcher = require("./elementHandlerDispatcher");
|
|
27
|
+
var import_jsHandleDispatcher = require("./jsHandleDispatcher");
|
|
28
|
+
var import_networkDispatchers = require("./networkDispatchers");
|
|
29
|
+
var import_networkDispatchers2 = require("./networkDispatchers");
|
|
30
|
+
var import_ariaSnapshot = require("../../utils/isomorphic/ariaSnapshot");
|
|
31
|
+
var import_utilsBundle = require("../../utilsBundle");
|
|
32
|
+
class FrameDispatcher extends import_dispatcher.Dispatcher {
|
|
33
|
+
constructor(scope, frame) {
|
|
34
|
+
const gcBucket = frame._page.mainFrame() === frame ? "MainFrame" : "Frame";
|
|
35
|
+
const pageDispatcher = scope.connection.existingDispatcher(frame._page);
|
|
36
|
+
super(pageDispatcher || scope, frame, "Frame", {
|
|
37
|
+
url: frame.url(),
|
|
38
|
+
name: frame.name(),
|
|
39
|
+
parentFrame: FrameDispatcher.fromNullable(scope, frame.parentFrame()),
|
|
40
|
+
loadStates: Array.from(frame._firedLifecycleEvents)
|
|
41
|
+
}, gcBucket);
|
|
42
|
+
this._type_Frame = true;
|
|
43
|
+
this._browserContextDispatcher = scope;
|
|
44
|
+
this._frame = frame;
|
|
45
|
+
this.addObjectListener(import_frames.Frame.Events.AddLifecycle, (lifecycleEvent) => {
|
|
46
|
+
this._dispatchEvent("loadstate", { add: lifecycleEvent });
|
|
47
|
+
});
|
|
48
|
+
this.addObjectListener(import_frames.Frame.Events.RemoveLifecycle, (lifecycleEvent) => {
|
|
49
|
+
this._dispatchEvent("loadstate", { remove: lifecycleEvent });
|
|
50
|
+
});
|
|
51
|
+
this.addObjectListener(import_frames.Frame.Events.InternalNavigation, (event) => {
|
|
52
|
+
if (!event.isPublic)
|
|
53
|
+
return;
|
|
54
|
+
const params = { url: event.url, name: event.name, error: event.error ? event.error.message : void 0 };
|
|
55
|
+
if (event.newDocument)
|
|
56
|
+
params.newDocument = { request: import_networkDispatchers2.RequestDispatcher.fromNullable(this._browserContextDispatcher, event.newDocument.request || null) };
|
|
57
|
+
this._dispatchEvent("navigated", params);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
static from(scope, frame) {
|
|
61
|
+
const result = scope.connection.existingDispatcher(frame);
|
|
62
|
+
return result || new FrameDispatcher(scope, frame);
|
|
63
|
+
}
|
|
64
|
+
static fromNullable(scope, frame) {
|
|
65
|
+
if (!frame)
|
|
66
|
+
return;
|
|
67
|
+
return FrameDispatcher.from(scope, frame);
|
|
68
|
+
}
|
|
69
|
+
async goto(params, progress) {
|
|
70
|
+
return { response: import_networkDispatchers.ResponseDispatcher.fromNullable(this._browserContextDispatcher, await this._frame.goto(progress, params.url, params)) };
|
|
71
|
+
}
|
|
72
|
+
async frameElement(params, progress) {
|
|
73
|
+
return { element: import_elementHandlerDispatcher.ElementHandleDispatcher.from(this, await progress.race(this._frame.frameElement())) };
|
|
74
|
+
}
|
|
75
|
+
async evaluateExpression(params, progress) {
|
|
76
|
+
return { value: (0, import_jsHandleDispatcher.serializeResult)(await progress.race(this._frame.evaluateExpression(params.expression, { isFunction: params.isFunction }, (0, import_jsHandleDispatcher.parseArgument)(params.arg)))) };
|
|
77
|
+
}
|
|
78
|
+
async evaluateExpressionHandle(params, progress) {
|
|
79
|
+
return { handle: import_elementHandlerDispatcher.ElementHandleDispatcher.fromJSOrElementHandle(this, await progress.race(this._frame.evaluateExpressionHandle(params.expression, { isFunction: params.isFunction }, (0, import_jsHandleDispatcher.parseArgument)(params.arg)))) };
|
|
80
|
+
}
|
|
81
|
+
async waitForSelector(params, progress) {
|
|
82
|
+
return { element: import_elementHandlerDispatcher.ElementHandleDispatcher.fromNullable(this, await this._frame.waitForSelector(progress, params.selector, true, params)) };
|
|
83
|
+
}
|
|
84
|
+
async dispatchEvent(params, progress) {
|
|
85
|
+
return this._frame.dispatchEvent(progress, params.selector, params.type, (0, import_jsHandleDispatcher.parseArgument)(params.eventInit), params);
|
|
86
|
+
}
|
|
87
|
+
async evalOnSelector(params, progress) {
|
|
88
|
+
return { value: (0, import_jsHandleDispatcher.serializeResult)(await progress.race(this._frame.evalOnSelector(params.selector, !!params.strict, params.expression, params.isFunction, (0, import_jsHandleDispatcher.parseArgument)(params.arg)))) };
|
|
89
|
+
}
|
|
90
|
+
async evalOnSelectorAll(params, progress) {
|
|
91
|
+
return { value: (0, import_jsHandleDispatcher.serializeResult)(await progress.race(this._frame.evalOnSelectorAll(params.selector, params.expression, params.isFunction, (0, import_jsHandleDispatcher.parseArgument)(params.arg)))) };
|
|
92
|
+
}
|
|
93
|
+
async querySelector(params, progress) {
|
|
94
|
+
return { element: import_elementHandlerDispatcher.ElementHandleDispatcher.fromNullable(this, await progress.race(this._frame.querySelector(params.selector, params))) };
|
|
95
|
+
}
|
|
96
|
+
async querySelectorAll(params, progress) {
|
|
97
|
+
const elements = await progress.race(this._frame.querySelectorAll(params.selector));
|
|
98
|
+
return { elements: elements.map((e) => import_elementHandlerDispatcher.ElementHandleDispatcher.from(this, e)) };
|
|
99
|
+
}
|
|
100
|
+
async queryCount(params, progress) {
|
|
101
|
+
return { value: await progress.race(this._frame.queryCount(params.selector, params)) };
|
|
102
|
+
}
|
|
103
|
+
async content(params, progress) {
|
|
104
|
+
return { value: await progress.race(this._frame.content()) };
|
|
105
|
+
}
|
|
106
|
+
async setContent(params, progress) {
|
|
107
|
+
return await this._frame.setContent(progress, params.html, params);
|
|
108
|
+
}
|
|
109
|
+
async addScriptTag(params, progress) {
|
|
110
|
+
return { element: import_elementHandlerDispatcher.ElementHandleDispatcher.from(this, await progress.race(this._frame.addScriptTag(params))) };
|
|
111
|
+
}
|
|
112
|
+
async addStyleTag(params, progress) {
|
|
113
|
+
return { element: import_elementHandlerDispatcher.ElementHandleDispatcher.from(this, await progress.race(this._frame.addStyleTag(params))) };
|
|
114
|
+
}
|
|
115
|
+
async click(params, progress) {
|
|
116
|
+
progress.metadata.potentiallyClosesScope = true;
|
|
117
|
+
return await this._frame.click(progress, params.selector, params);
|
|
118
|
+
}
|
|
119
|
+
async dblclick(params, progress) {
|
|
120
|
+
return await this._frame.dblclick(progress, params.selector, params);
|
|
121
|
+
}
|
|
122
|
+
async dragAndDrop(params, progress) {
|
|
123
|
+
return await this._frame.dragAndDrop(progress, params.source, params.target, params);
|
|
124
|
+
}
|
|
125
|
+
async tap(params, progress) {
|
|
126
|
+
return await this._frame.tap(progress, params.selector, params);
|
|
127
|
+
}
|
|
128
|
+
async fill(params, progress) {
|
|
129
|
+
return await this._frame.fill(progress, params.selector, params.value, params);
|
|
130
|
+
}
|
|
131
|
+
async focus(params, progress) {
|
|
132
|
+
await this._frame.focus(progress, params.selector, params);
|
|
133
|
+
}
|
|
134
|
+
async blur(params, progress) {
|
|
135
|
+
await this._frame.blur(progress, params.selector, params);
|
|
136
|
+
}
|
|
137
|
+
async textContent(params, progress) {
|
|
138
|
+
const value = await this._frame.textContent(progress, params.selector, params);
|
|
139
|
+
return { value: value === null ? void 0 : value };
|
|
140
|
+
}
|
|
141
|
+
async innerText(params, progress) {
|
|
142
|
+
return { value: await this._frame.innerText(progress, params.selector, params) };
|
|
143
|
+
}
|
|
144
|
+
async innerHTML(params, progress) {
|
|
145
|
+
return { value: await this._frame.innerHTML(progress, params.selector, params) };
|
|
146
|
+
}
|
|
147
|
+
async resolveSelector(params, progress) {
|
|
148
|
+
return await this._frame.resolveSelector(progress, params.selector);
|
|
149
|
+
}
|
|
150
|
+
async getAttribute(params, progress) {
|
|
151
|
+
const value = await this._frame.getAttribute(progress, params.selector, params.name, params);
|
|
152
|
+
return { value: value === null ? void 0 : value };
|
|
153
|
+
}
|
|
154
|
+
async inputValue(params, progress) {
|
|
155
|
+
const value = await this._frame.inputValue(progress, params.selector, params);
|
|
156
|
+
return { value };
|
|
157
|
+
}
|
|
158
|
+
async isChecked(params, progress) {
|
|
159
|
+
return { value: await this._frame.isChecked(progress, params.selector, params) };
|
|
160
|
+
}
|
|
161
|
+
async isDisabled(params, progress) {
|
|
162
|
+
return { value: await this._frame.isDisabled(progress, params.selector, params) };
|
|
163
|
+
}
|
|
164
|
+
async isEditable(params, progress) {
|
|
165
|
+
return { value: await this._frame.isEditable(progress, params.selector, params) };
|
|
166
|
+
}
|
|
167
|
+
async isEnabled(params, progress) {
|
|
168
|
+
return { value: await this._frame.isEnabled(progress, params.selector, params) };
|
|
169
|
+
}
|
|
170
|
+
async isHidden(params, progress) {
|
|
171
|
+
return { value: await this._frame.isHidden(progress, params.selector, params) };
|
|
172
|
+
}
|
|
173
|
+
async isVisible(params, progress) {
|
|
174
|
+
return { value: await this._frame.isVisible(progress, params.selector, params) };
|
|
175
|
+
}
|
|
176
|
+
async hover(params, progress) {
|
|
177
|
+
return await this._frame.hover(progress, params.selector, params);
|
|
178
|
+
}
|
|
179
|
+
async selectOption(params, progress) {
|
|
180
|
+
const elements = (params.elements || []).map((e) => e._elementHandle);
|
|
181
|
+
return { values: await this._frame.selectOption(progress, params.selector, elements, params.options || [], params) };
|
|
182
|
+
}
|
|
183
|
+
async setInputFiles(params, progress) {
|
|
184
|
+
return await this._frame.setInputFiles(progress, params.selector, params);
|
|
185
|
+
}
|
|
186
|
+
async type(params, progress) {
|
|
187
|
+
return await this._frame.type(progress, params.selector, params.text, params);
|
|
188
|
+
}
|
|
189
|
+
async press(params, progress) {
|
|
190
|
+
return await this._frame.press(progress, params.selector, params.key, params);
|
|
191
|
+
}
|
|
192
|
+
async check(params, progress) {
|
|
193
|
+
return await this._frame.check(progress, params.selector, params);
|
|
194
|
+
}
|
|
195
|
+
async uncheck(params, progress) {
|
|
196
|
+
return await this._frame.uncheck(progress, params.selector, params);
|
|
197
|
+
}
|
|
198
|
+
async waitForTimeout(params, progress) {
|
|
199
|
+
return await this._frame.waitForTimeout(progress, params.waitTimeout);
|
|
200
|
+
}
|
|
201
|
+
async waitForFunction(params, progress) {
|
|
202
|
+
return { handle: import_elementHandlerDispatcher.ElementHandleDispatcher.fromJSOrElementHandle(this, await this._frame.waitForFunctionExpression(progress, params.expression, params.isFunction, (0, import_jsHandleDispatcher.parseArgument)(params.arg), params)) };
|
|
203
|
+
}
|
|
204
|
+
async title(params, progress) {
|
|
205
|
+
return { value: await progress.race(this._frame.title()) };
|
|
206
|
+
}
|
|
207
|
+
async highlight(params, progress) {
|
|
208
|
+
return await this._frame.highlight(progress, params.selector);
|
|
209
|
+
}
|
|
210
|
+
async expect(params, progress) {
|
|
211
|
+
progress.metadata.potentiallyClosesScope = true;
|
|
212
|
+
let expectedValue = params.expectedValue ? (0, import_jsHandleDispatcher.parseArgument)(params.expectedValue) : void 0;
|
|
213
|
+
if (params.expression === "to.match.aria" && expectedValue)
|
|
214
|
+
expectedValue = (0, import_ariaSnapshot.parseAriaSnapshotUnsafe)(import_utilsBundle.yaml, expectedValue);
|
|
215
|
+
const result = await this._frame.expect(progress, params.selector, { ...params, expectedValue }, params.timeout);
|
|
216
|
+
if (result.received !== void 0)
|
|
217
|
+
result.received = (0, import_jsHandleDispatcher.serializeResult)(result.received);
|
|
218
|
+
return result;
|
|
219
|
+
}
|
|
220
|
+
async ariaSnapshot(params, progress) {
|
|
221
|
+
return { snapshot: await this._frame.ariaSnapshot(progress, params.selector) };
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
225
|
+
0 && (module.exports = {
|
|
226
|
+
FrameDispatcher
|
|
227
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var jsHandleDispatcher_exports = {};
|
|
20
|
+
__export(jsHandleDispatcher_exports, {
|
|
21
|
+
JSHandleDispatcher: () => JSHandleDispatcher,
|
|
22
|
+
parseArgument: () => parseArgument,
|
|
23
|
+
parseValue: () => parseValue,
|
|
24
|
+
serializeResult: () => serializeResult
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(jsHandleDispatcher_exports);
|
|
27
|
+
var import_dispatcher = require("./dispatcher");
|
|
28
|
+
var import_elementHandlerDispatcher = require("./elementHandlerDispatcher");
|
|
29
|
+
var import_serializers = require("../../protocol/serializers");
|
|
30
|
+
class JSHandleDispatcher extends import_dispatcher.Dispatcher {
|
|
31
|
+
constructor(scope, jsHandle) {
|
|
32
|
+
super(scope, jsHandle, jsHandle.asElement() ? "ElementHandle" : "JSHandle", {
|
|
33
|
+
preview: jsHandle.toString()
|
|
34
|
+
});
|
|
35
|
+
this._type_JSHandle = true;
|
|
36
|
+
jsHandle._setPreviewCallback((preview) => this._dispatchEvent("previewUpdated", { preview }));
|
|
37
|
+
}
|
|
38
|
+
static fromJSHandle(scope, handle) {
|
|
39
|
+
return scope.connection.existingDispatcher(handle) || new JSHandleDispatcher(scope, handle);
|
|
40
|
+
}
|
|
41
|
+
async evaluateExpression(params, progress) {
|
|
42
|
+
const jsHandle = await progress.race(this._object.evaluateExpression(params.expression, { isFunction: params.isFunction }, parseArgument(params.arg)));
|
|
43
|
+
return { value: serializeResult(jsHandle) };
|
|
44
|
+
}
|
|
45
|
+
async evaluateExpressionHandle(params, progress) {
|
|
46
|
+
const jsHandle = await progress.race(this._object.evaluateExpressionHandle(params.expression, { isFunction: params.isFunction }, parseArgument(params.arg)));
|
|
47
|
+
return { handle: import_elementHandlerDispatcher.ElementHandleDispatcher.fromJSOrElementHandle(this.parentScope(), jsHandle) };
|
|
48
|
+
}
|
|
49
|
+
async getProperty(params, progress) {
|
|
50
|
+
const jsHandle = await progress.race(this._object.getProperty(params.name));
|
|
51
|
+
return { handle: import_elementHandlerDispatcher.ElementHandleDispatcher.fromJSOrElementHandle(this.parentScope(), jsHandle) };
|
|
52
|
+
}
|
|
53
|
+
async getPropertyList(params, progress) {
|
|
54
|
+
const map = await progress.race(this._object.getProperties());
|
|
55
|
+
const properties = [];
|
|
56
|
+
for (const [name, value] of map) {
|
|
57
|
+
properties.push({ name, value: import_elementHandlerDispatcher.ElementHandleDispatcher.fromJSOrElementHandle(this.parentScope(), value) });
|
|
58
|
+
}
|
|
59
|
+
return { properties };
|
|
60
|
+
}
|
|
61
|
+
async jsonValue(params, progress) {
|
|
62
|
+
return { value: serializeResult(await progress.race(this._object.jsonValue())) };
|
|
63
|
+
}
|
|
64
|
+
async dispose(_, progress) {
|
|
65
|
+
progress.metadata.potentiallyClosesScope = true;
|
|
66
|
+
this._object.dispose();
|
|
67
|
+
this._dispose();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function parseArgument(arg) {
|
|
71
|
+
return (0, import_serializers.parseSerializedValue)(arg.value, arg.handles.map((a) => a._object));
|
|
72
|
+
}
|
|
73
|
+
function parseValue(v) {
|
|
74
|
+
return (0, import_serializers.parseSerializedValue)(v, []);
|
|
75
|
+
}
|
|
76
|
+
function serializeResult(arg) {
|
|
77
|
+
return (0, import_serializers.serializeValue)(arg, (value) => ({ fallThrough: value }));
|
|
78
|
+
}
|
|
79
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
+
0 && (module.exports = {
|
|
81
|
+
JSHandleDispatcher,
|
|
82
|
+
parseArgument,
|
|
83
|
+
parseValue,
|
|
84
|
+
serializeResult
|
|
85
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var jsonPipeDispatcher_exports = {};
|
|
20
|
+
__export(jsonPipeDispatcher_exports, {
|
|
21
|
+
JsonPipeDispatcher: () => JsonPipeDispatcher
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(jsonPipeDispatcher_exports);
|
|
24
|
+
var import_dispatcher = require("./dispatcher");
|
|
25
|
+
var import_instrumentation = require("../instrumentation");
|
|
26
|
+
class JsonPipeDispatcher extends import_dispatcher.Dispatcher {
|
|
27
|
+
constructor(scope) {
|
|
28
|
+
super(scope, new import_instrumentation.SdkObject(scope._object, "jsonPipe"), "JsonPipe", {});
|
|
29
|
+
this._type_JsonPipe = true;
|
|
30
|
+
}
|
|
31
|
+
async send(params, progress) {
|
|
32
|
+
this.emit("message", params.message);
|
|
33
|
+
}
|
|
34
|
+
async close(params, progress) {
|
|
35
|
+
this.emit("close");
|
|
36
|
+
if (!this._disposed) {
|
|
37
|
+
this._dispatchEvent("closed", {});
|
|
38
|
+
this._dispose();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
dispatch(message) {
|
|
42
|
+
if (!this._disposed)
|
|
43
|
+
this._dispatchEvent("message", { message });
|
|
44
|
+
}
|
|
45
|
+
wasClosed(reason) {
|
|
46
|
+
if (!this._disposed) {
|
|
47
|
+
this._dispatchEvent("closed", { reason });
|
|
48
|
+
this._dispose();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
dispose() {
|
|
52
|
+
this._dispose();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
JsonPipeDispatcher
|
|
58
|
+
});
|