easytouch-linux 1.0.7 → 1.0.17
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.txt +201 -0
- package/README.md +33 -314
- package/SKILL.md +366 -0
- package/bin/arm64/et +0 -0
- package/bin/et.js +60 -0
- package/bin/x64/et +0 -0
- package/package.json +19 -37
- package/.playwright/node/LICENSE +0 -2607
- package/.playwright/node/linux-x64/node +0 -0
- package/.playwright/package/README.md +0 -3
- package/.playwright/package/ThirdPartyNotices.txt +0 -1602
- package/.playwright/package/api.json +0 -1
- package/.playwright/package/bin/install_media_pack.ps1 +0 -5
- package/.playwright/package/bin/reinstall_chrome_beta_linux.sh +0 -42
- package/.playwright/package/bin/reinstall_chrome_beta_mac.sh +0 -13
- package/.playwright/package/bin/reinstall_chrome_beta_win.ps1 +0 -24
- package/.playwright/package/bin/reinstall_chrome_stable_linux.sh +0 -42
- package/.playwright/package/bin/reinstall_chrome_stable_mac.sh +0 -12
- package/.playwright/package/bin/reinstall_chrome_stable_win.ps1 +0 -24
- package/.playwright/package/bin/reinstall_msedge_beta_linux.sh +0 -48
- package/.playwright/package/bin/reinstall_msedge_beta_mac.sh +0 -11
- package/.playwright/package/bin/reinstall_msedge_beta_win.ps1 +0 -23
- package/.playwright/package/bin/reinstall_msedge_dev_linux.sh +0 -48
- package/.playwright/package/bin/reinstall_msedge_dev_mac.sh +0 -11
- package/.playwright/package/bin/reinstall_msedge_dev_win.ps1 +0 -23
- package/.playwright/package/bin/reinstall_msedge_stable_linux.sh +0 -48
- package/.playwright/package/bin/reinstall_msedge_stable_mac.sh +0 -11
- package/.playwright/package/bin/reinstall_msedge_stable_win.ps1 +0 -24
- package/.playwright/package/browsers.json +0 -66
- package/.playwright/package/cli.js +0 -18
- package/.playwright/package/index.d.ts +0 -17
- package/.playwright/package/index.js +0 -33
- package/.playwright/package/index.mjs +0 -28
- package/.playwright/package/lib/androidServerImpl.js +0 -69
- package/.playwright/package/lib/browserServerImpl.js +0 -92
- package/.playwright/package/lib/cli/driver.js +0 -95
- package/.playwright/package/lib/cli/program.js +0 -583
- package/.playwright/package/lib/cli/programWithTestStub.js +0 -67
- package/.playwright/package/lib/client/accessibility.js +0 -50
- package/.playwright/package/lib/client/android.js +0 -473
- package/.playwright/package/lib/client/api.js +0 -285
- package/.playwright/package/lib/client/artifact.js +0 -79
- package/.playwright/package/lib/client/browser.js +0 -145
- package/.playwright/package/lib/client/browserContext.js +0 -559
- package/.playwright/package/lib/client/browserType.js +0 -241
- package/.playwright/package/lib/client/cdpSession.js +0 -53
- package/.playwright/package/lib/client/channelOwner.js +0 -215
- package/.playwright/package/lib/client/clientHelper.js +0 -57
- package/.playwright/package/lib/client/clientInstrumentation.js +0 -52
- package/.playwright/package/lib/client/clock.js +0 -68
- package/.playwright/package/lib/client/connection.js +0 -333
- package/.playwright/package/lib/client/consoleMessage.js +0 -55
- package/.playwright/package/lib/client/coverage.js +0 -41
- package/.playwright/package/lib/client/dialog.js +0 -57
- package/.playwright/package/lib/client/download.js +0 -62
- package/.playwright/package/lib/client/electron.js +0 -135
- package/.playwright/package/lib/client/elementHandle.js +0 -321
- package/.playwright/package/lib/client/errors.js +0 -77
- package/.playwright/package/lib/client/eventEmitter.js +0 -314
- package/.playwright/package/lib/client/events.js +0 -94
- package/.playwright/package/lib/client/fetch.js +0 -391
- package/.playwright/package/lib/client/fileChooser.js +0 -45
- package/.playwright/package/lib/client/frame.js +0 -504
- package/.playwright/package/lib/client/harRouter.js +0 -99
- package/.playwright/package/lib/client/input.js +0 -111
- package/.playwright/package/lib/client/jsHandle.js +0 -121
- package/.playwright/package/lib/client/jsonPipe.js +0 -35
- package/.playwright/package/lib/client/localUtils.js +0 -36
- package/.playwright/package/lib/client/locator.js +0 -448
- package/.playwright/package/lib/client/network.js +0 -769
- package/.playwright/package/lib/client/page.js +0 -748
- package/.playwright/package/lib/client/playwright.js +0 -80
- package/.playwright/package/lib/client/selectors.js +0 -67
- package/.playwright/package/lib/client/stream.js +0 -54
- package/.playwright/package/lib/client/tracing.js +0 -147
- package/.playwright/package/lib/client/types.js +0 -24
- package/.playwright/package/lib/client/video.js +0 -51
- package/.playwright/package/lib/client/waiter.js +0 -162
- package/.playwright/package/lib/client/webError.js +0 -37
- package/.playwright/package/lib/client/worker.js +0 -71
- package/.playwright/package/lib/client/writableStream.js +0 -54
- package/.playwright/package/lib/common/socksProxy.js +0 -569
- package/.playwright/package/lib/common/timeoutSettings.js +0 -73
- package/.playwright/package/lib/common/types.js +0 -5
- package/.playwright/package/lib/generated/clockSource.js +0 -7
- package/.playwright/package/lib/generated/consoleApiSource.js +0 -7
- package/.playwright/package/lib/generated/injectedScriptSource.js +0 -7
- package/.playwright/package/lib/generated/pollingRecorderSource.js +0 -7
- package/.playwright/package/lib/generated/utilityScriptSource.js +0 -7
- package/.playwright/package/lib/generated/webSocketMockSource.js +0 -7
- package/.playwright/package/lib/image_tools/colorUtils.js +0 -98
- package/.playwright/package/lib/image_tools/compare.js +0 -108
- package/.playwright/package/lib/image_tools/imageChannel.js +0 -70
- package/.playwright/package/lib/image_tools/stats.js +0 -102
- package/.playwright/package/lib/inProcessFactory.js +0 -56
- package/.playwright/package/lib/inprocess.js +0 -20
- package/.playwright/package/lib/outofprocess.js +0 -67
- package/.playwright/package/lib/protocol/debug.js +0 -27
- package/.playwright/package/lib/protocol/serializers.js +0 -173
- package/.playwright/package/lib/protocol/transport.js +0 -82
- package/.playwright/package/lib/protocol/validator.js +0 -2780
- package/.playwright/package/lib/protocol/validatorPrimitives.js +0 -139
- package/.playwright/package/lib/remote/playwrightConnection.js +0 -275
- package/.playwright/package/lib/remote/playwrightServer.js +0 -111
- package/.playwright/package/lib/server/accessibility.js +0 -62
- package/.playwright/package/lib/server/android/android.js +0 -441
- package/.playwright/package/lib/server/android/backendAdb.js +0 -172
- package/.playwright/package/lib/server/artifact.js +0 -104
- package/.playwright/package/lib/server/bidi/bidiBrowser.js +0 -314
- package/.playwright/package/lib/server/bidi/bidiChromium.js +0 -124
- package/.playwright/package/lib/server/bidi/bidiConnection.js +0 -204
- package/.playwright/package/lib/server/bidi/bidiExecutionContext.js +0 -175
- package/.playwright/package/lib/server/bidi/bidiFirefox.js +0 -104
- package/.playwright/package/lib/server/bidi/bidiInput.js +0 -160
- package/.playwright/package/lib/server/bidi/bidiNetworkManager.js +0 -337
- package/.playwright/package/lib/server/bidi/bidiOverCdp.js +0 -103
- package/.playwright/package/lib/server/bidi/bidiPage.js +0 -518
- package/.playwright/package/lib/server/bidi/bidiPdf.js +0 -140
- package/.playwright/package/lib/server/bidi/third_party/bidiDeserializer.js +0 -93
- package/.playwright/package/lib/server/bidi/third_party/bidiKeyboard.js +0 -240
- package/.playwright/package/lib/server/bidi/third_party/bidiProtocol.js +0 -139
- package/.playwright/package/lib/server/bidi/third_party/bidiSerializer.js +0 -144
- package/.playwright/package/lib/server/bidi/third_party/firefoxPrefs.js +0 -221
- package/.playwright/package/lib/server/browser.js +0 -148
- package/.playwright/package/lib/server/browserContext.js +0 -675
- package/.playwright/package/lib/server/browserType.js +0 -338
- package/.playwright/package/lib/server/chromium/appIcon.png +0 -0
- package/.playwright/package/lib/server/chromium/chromium.js +0 -354
- package/.playwright/package/lib/server/chromium/chromiumSwitches.js +0 -46
- package/.playwright/package/lib/server/chromium/crAccessibility.js +0 -237
- package/.playwright/package/lib/server/chromium/crBrowser.js +0 -516
- package/.playwright/package/lib/server/chromium/crConnection.js +0 -228
- package/.playwright/package/lib/server/chromium/crCoverage.js +0 -246
- package/.playwright/package/lib/server/chromium/crDevTools.js +0 -104
- package/.playwright/package/lib/server/chromium/crDragDrop.js +0 -143
- package/.playwright/package/lib/server/chromium/crExecutionContext.js +0 -132
- package/.playwright/package/lib/server/chromium/crInput.js +0 -182
- package/.playwright/package/lib/server/chromium/crNetworkManager.js +0 -767
- package/.playwright/package/lib/server/chromium/crPage.js +0 -1122
- package/.playwright/package/lib/server/chromium/crPdf.js +0 -153
- package/.playwright/package/lib/server/chromium/crProtocolHelper.js +0 -133
- package/.playwright/package/lib/server/chromium/crServiceWorker.js +0 -112
- package/.playwright/package/lib/server/chromium/defaultFontFamilies.js +0 -145
- package/.playwright/package/lib/server/chromium/videoRecorder.js +0 -155
- package/.playwright/package/lib/server/clock.js +0 -125
- package/.playwright/package/lib/server/codegen/csharp.js +0 -304
- package/.playwright/package/lib/server/codegen/java.js +0 -243
- package/.playwright/package/lib/server/codegen/javascript.js +0 -253
- package/.playwright/package/lib/server/codegen/jsonl.js +0 -47
- package/.playwright/package/lib/server/codegen/language.js +0 -88
- package/.playwright/package/lib/server/codegen/languages.js +0 -30
- package/.playwright/package/lib/server/codegen/python.js +0 -262
- package/.playwright/package/lib/server/codegen/types.js +0 -5
- package/.playwright/package/lib/server/console.js +0 -57
- package/.playwright/package/lib/server/cookieStore.js +0 -185
- package/.playwright/package/lib/server/debugController.js +0 -212
- package/.playwright/package/lib/server/debugger.js +0 -132
- package/.playwright/package/lib/server/deviceDescriptors.js +0 -26
- package/.playwright/package/lib/server/deviceDescriptorsSource.json +0 -1669
- package/.playwright/package/lib/server/dialog.js +0 -71
- package/.playwright/package/lib/server/dispatchers/androidDispatcher.js +0 -204
- package/.playwright/package/lib/server/dispatchers/artifactDispatcher.js +0 -118
- package/.playwright/package/lib/server/dispatchers/browserContextDispatcher.js +0 -357
- package/.playwright/package/lib/server/dispatchers/browserDispatcher.js +0 -170
- package/.playwright/package/lib/server/dispatchers/browserTypeDispatcher.js +0 -55
- package/.playwright/package/lib/server/dispatchers/cdpSessionDispatcher.js +0 -48
- package/.playwright/package/lib/server/dispatchers/debugControllerDispatcher.js +0 -105
- package/.playwright/package/lib/server/dispatchers/dialogDispatcher.js +0 -44
- package/.playwright/package/lib/server/dispatchers/dispatcher.js +0 -395
- package/.playwright/package/lib/server/dispatchers/electronDispatcher.js +0 -93
- package/.playwright/package/lib/server/dispatchers/elementHandlerDispatcher.js +0 -228
- package/.playwright/package/lib/server/dispatchers/frameDispatcher.js +0 -294
- package/.playwright/package/lib/server/dispatchers/jsHandleDispatcher.js +0 -97
- package/.playwright/package/lib/server/dispatchers/jsonPipeDispatcher.js +0 -59
- package/.playwright/package/lib/server/dispatchers/localUtilsDispatcher.js +0 -413
- package/.playwright/package/lib/server/dispatchers/networkDispatchers.js +0 -221
- package/.playwright/package/lib/server/dispatchers/pageDispatcher.js +0 -367
- package/.playwright/package/lib/server/dispatchers/playwrightDispatcher.js +0 -107
- package/.playwright/package/lib/server/dispatchers/selectorsDispatcher.js +0 -36
- package/.playwright/package/lib/server/dispatchers/streamDispatcher.js +0 -62
- package/.playwright/package/lib/server/dispatchers/tracingDispatcher.js +0 -64
- package/.playwright/package/lib/server/dispatchers/webSocketRouteDispatcher.js +0 -188
- package/.playwright/package/lib/server/dispatchers/writableStreamDispatcher.js +0 -58
- package/.playwright/package/lib/server/dom.js +0 -893
- package/.playwright/package/lib/server/download.js +0 -60
- package/.playwright/package/lib/server/electron/electron.js +0 -296
- package/.playwright/package/lib/server/electron/loader.js +0 -57
- package/.playwright/package/lib/server/errors.js +0 -68
- package/.playwright/package/lib/server/fetch.js +0 -663
- package/.playwright/package/lib/server/fileChooser.js +0 -42
- package/.playwright/package/lib/server/fileUploadUtils.js +0 -75
- package/.playwright/package/lib/server/firefox/ffAccessibility.js +0 -216
- package/.playwright/package/lib/server/firefox/ffBrowser.js +0 -462
- package/.playwright/package/lib/server/firefox/ffConnection.js +0 -168
- package/.playwright/package/lib/server/firefox/ffExecutionContext.js +0 -123
- package/.playwright/package/lib/server/firefox/ffInput.js +0 -161
- package/.playwright/package/lib/server/firefox/ffNetworkManager.js +0 -233
- package/.playwright/package/lib/server/firefox/ffPage.js +0 -544
- package/.playwright/package/lib/server/firefox/firefox.js +0 -99
- package/.playwright/package/lib/server/formData.js +0 -75
- package/.playwright/package/lib/server/frameSelectors.js +0 -171
- package/.playwright/package/lib/server/frames.js +0 -1663
- package/.playwright/package/lib/server/har/harRecorder.js +0 -139
- package/.playwright/package/lib/server/har/harTracer.js +0 -542
- package/.playwright/package/lib/server/helper.js +0 -103
- package/.playwright/package/lib/server/index.js +0 -108
- package/.playwright/package/lib/server/input.js +0 -309
- package/.playwright/package/lib/server/instrumentation.js +0 -70
- package/.playwright/package/lib/server/isomorphic/utilityScriptSerializers.js +0 -226
- package/.playwright/package/lib/server/javascript.js +0 -293
- package/.playwright/package/lib/server/launchApp.js +0 -91
- package/.playwright/package/lib/server/macEditingCommands.js +0 -139
- package/.playwright/package/lib/server/network.js +0 -617
- package/.playwright/package/lib/server/page.js +0 -863
- package/.playwright/package/lib/server/pipeTransport.js +0 -85
- package/.playwright/package/lib/server/playwright.js +0 -88
- package/.playwright/package/lib/server/progress.js +0 -99
- package/.playwright/package/lib/server/protocolError.js +0 -49
- package/.playwright/package/lib/server/recorder/chat.js +0 -177
- package/.playwright/package/lib/server/recorder/contextRecorder.js +0 -290
- package/.playwright/package/lib/server/recorder/recorderApp.js +0 -187
- package/.playwright/package/lib/server/recorder/recorderCollection.js +0 -104
- package/.playwright/package/lib/server/recorder/recorderFrontend.js +0 -5
- package/.playwright/package/lib/server/recorder/recorderRunner.js +0 -159
- package/.playwright/package/lib/server/recorder/recorderUtils.js +0 -89
- package/.playwright/package/lib/server/recorder/throttledFile.js +0 -46
- package/.playwright/package/lib/server/recorder.js +0 -367
- package/.playwright/package/lib/server/registry/browserFetcher.js +0 -168
- package/.playwright/package/lib/server/registry/dependencies.js +0 -322
- package/.playwright/package/lib/server/registry/index.js +0 -1165
- package/.playwright/package/lib/server/registry/nativeDeps.js +0 -496
- package/.playwright/package/lib/server/registry/oopDownloadBrowserMain.js +0 -138
- package/.playwright/package/lib/server/screenshotter.js +0 -348
- package/.playwright/package/lib/server/selectors.js +0 -73
- package/.playwright/package/lib/server/socksClientCertificatesInterceptor.js +0 -340
- package/.playwright/package/lib/server/socksInterceptor.js +0 -100
- package/.playwright/package/lib/server/trace/recorder/snapshotter.js +0 -161
- package/.playwright/package/lib/server/trace/recorder/snapshotterInjected.js +0 -518
- package/.playwright/package/lib/server/trace/recorder/tracing.js +0 -596
- package/.playwright/package/lib/server/trace/test/inMemorySnapshotter.js +0 -93
- package/.playwright/package/lib/server/trace/viewer/traceViewer.js +0 -219
- package/.playwright/package/lib/server/transport.js +0 -192
- package/.playwright/package/lib/server/types.js +0 -24
- package/.playwright/package/lib/server/usKeyboardLayout.js +0 -555
- package/.playwright/package/lib/server/webkit/webkit.js +0 -87
- package/.playwright/package/lib/server/webkit/wkAccessibility.js +0 -194
- package/.playwright/package/lib/server/webkit/wkBrowser.js +0 -329
- package/.playwright/package/lib/server/webkit/wkConnection.js +0 -173
- package/.playwright/package/lib/server/webkit/wkExecutionContext.js +0 -131
- package/.playwright/package/lib/server/webkit/wkInput.js +0 -179
- package/.playwright/package/lib/server/webkit/wkInterceptableRequest.js +0 -162
- package/.playwright/package/lib/server/webkit/wkPage.js +0 -1207
- package/.playwright/package/lib/server/webkit/wkProvisionalPage.js +0 -94
- package/.playwright/package/lib/server/webkit/wkWorkers.js +0 -104
- package/.playwright/package/lib/third_party/pixelmatch.js +0 -255
- package/.playwright/package/lib/utils/ascii.js +0 -31
- package/.playwright/package/lib/utils/comparators.js +0 -159
- package/.playwright/package/lib/utils/crypto.js +0 -171
- package/.playwright/package/lib/utils/debug.js +0 -46
- package/.playwright/package/lib/utils/debugLogger.js +0 -93
- package/.playwright/package/lib/utils/env.js +0 -49
- package/.playwright/package/lib/utils/eventsHelper.js +0 -38
- package/.playwright/package/lib/utils/expectUtils.js +0 -33
- package/.playwright/package/lib/utils/fileUtils.js +0 -205
- package/.playwright/package/lib/utils/happy-eyeballs.js +0 -194
- package/.playwright/package/lib/utils/headers.js +0 -52
- package/.playwright/package/lib/utils/hostPlatform.js +0 -145
- package/.playwright/package/lib/utils/httpServer.js +0 -233
- package/.playwright/package/lib/utils/index.js +0 -368
- package/.playwright/package/lib/utils/isomorphic/ariaSnapshot.js +0 -391
- package/.playwright/package/lib/utils/isomorphic/cssParser.js +0 -250
- package/.playwright/package/lib/utils/isomorphic/cssTokenizer.js +0 -979
- package/.playwright/package/lib/utils/isomorphic/locatorGenerators.js +0 -660
- package/.playwright/package/lib/utils/isomorphic/locatorParser.js +0 -185
- package/.playwright/package/lib/utils/isomorphic/locatorUtils.js +0 -62
- package/.playwright/package/lib/utils/isomorphic/mimeType.js +0 -29
- package/.playwright/package/lib/utils/isomorphic/selectorParser.js +0 -397
- package/.playwright/package/lib/utils/isomorphic/stringUtils.js +0 -169
- package/.playwright/package/lib/utils/isomorphic/traceUtils.js +0 -39
- package/.playwright/package/lib/utils/isomorphic/urlMatch.js +0 -122
- package/.playwright/package/lib/utils/linuxUtils.js +0 -78
- package/.playwright/package/lib/utils/manualPromise.js +0 -109
- package/.playwright/package/lib/utils/multimap.js +0 -75
- package/.playwright/package/lib/utils/network.js +0 -160
- package/.playwright/package/lib/utils/processLauncher.js +0 -248
- package/.playwright/package/lib/utils/profiler.js +0 -53
- package/.playwright/package/lib/utils/rtti.js +0 -44
- package/.playwright/package/lib/utils/semaphore.js +0 -51
- package/.playwright/package/lib/utils/sequence.js +0 -64
- package/.playwright/package/lib/utils/spawnAsync.js +0 -45
- package/.playwright/package/lib/utils/stackTrace.js +0 -134
- package/.playwright/package/lib/utils/task.js +0 -58
- package/.playwright/package/lib/utils/time.js +0 -37
- package/.playwright/package/lib/utils/timeoutRunner.js +0 -66
- package/.playwright/package/lib/utils/traceUtils.js +0 -44
- package/.playwright/package/lib/utils/userAgent.js +0 -105
- package/.playwright/package/lib/utils/wsServer.js +0 -128
- package/.playwright/package/lib/utils/zipFile.js +0 -75
- package/.playwright/package/lib/utils/zones.js +0 -69
- package/.playwright/package/lib/utilsBundle.js +0 -81
- package/.playwright/package/lib/utilsBundleImpl/index.js +0 -210
- package/.playwright/package/lib/utilsBundleImpl/xdg-open +0 -1066
- package/.playwright/package/lib/vite/htmlReport/index.html +0 -69
- package/.playwright/package/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +0 -1
- package/.playwright/package/lib/vite/recorder/assets/codeMirrorModule-k-61wZCK.js +0 -24
- package/.playwright/package/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/.playwright/package/lib/vite/recorder/assets/index-B70BEW3b.js +0 -184
- package/.playwright/package/lib/vite/recorder/assets/index-eHBmevrY.css +0 -1
- package/.playwright/package/lib/vite/recorder/index.html +0 -29
- package/.playwright/package/lib/vite/recorder/playwright-logo.svg +0 -9
- package/.playwright/package/lib/vite/traceViewer/assets/codeMirrorModule-CyuxU5C-.js +0 -24
- package/.playwright/package/lib/vite/traceViewer/assets/defaultSettingsView-5nVJRt0A.js +0 -243
- package/.playwright/package/lib/vite/traceViewer/assets/xtermModule-c-SNdYZy.js +0 -9
- package/.playwright/package/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +0 -1
- package/.playwright/package/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/.playwright/package/lib/vite/traceViewer/defaultSettingsView.2xeEXCXv.css +0 -1
- package/.playwright/package/lib/vite/traceViewer/index.CFOW-Ezb.css +0 -1
- package/.playwright/package/lib/vite/traceViewer/index.html +0 -43
- package/.playwright/package/lib/vite/traceViewer/index.qVn2ZnpC.js +0 -2
- package/.playwright/package/lib/vite/traceViewer/playwright-logo.svg +0 -9
- package/.playwright/package/lib/vite/traceViewer/snapshot.html +0 -21
- package/.playwright/package/lib/vite/traceViewer/sw.bundle.js +0 -3
- package/.playwright/package/lib/vite/traceViewer/uiMode.BatfzHMG.css +0 -1
- package/.playwright/package/lib/vite/traceViewer/uiMode.html +0 -17
- package/.playwright/package/lib/vite/traceViewer/uiMode.m4IPRPOd.js +0 -5
- package/.playwright/package/lib/vite/traceViewer/xtermModule.Beg8tuEN.css +0 -32
- package/.playwright/package/lib/zipBundle.js +0 -25
- package/.playwright/package/lib/zipBundleImpl.js +0 -5
- package/.playwright/package/package.json +0 -44
- package/.playwright/package/protocol.yml +0 -3758
- package/.playwright/package/types/protocol.d.ts +0 -21868
- package/.playwright/package/types/structs.d.ts +0 -45
- package/.playwright/package/types/types.d.ts +0 -22663
- package/et +0 -0
- package/install.js +0 -19
- package/playwright.ps1 +0 -7
- package/scripts/playwright-bridge.js +0 -560
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BidiNetworkManager = void 0;
|
|
7
|
-
exports.bidiBytesValueToString = bidiBytesValueToString;
|
|
8
|
-
var _eventsHelper = require("../../utils/eventsHelper");
|
|
9
|
-
var network = _interopRequireWildcard(require("../network"));
|
|
10
|
-
var bidi = _interopRequireWildcard(require("./third_party/bidiProtocol"));
|
|
11
|
-
var _cookieStore = require("../cookieStore");
|
|
12
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
-
/**
|
|
15
|
-
* Copyright (c) Microsoft Corporation.
|
|
16
|
-
*
|
|
17
|
-
* Licensed under the Apache License, Version 2.0 (the 'License');
|
|
18
|
-
* you may not use this file except in compliance with the License.
|
|
19
|
-
* You may obtain a copy of the License at
|
|
20
|
-
*
|
|
21
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
-
*
|
|
23
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
-
* distributed under the License is distributed on an 'AS IS' BASIS,
|
|
25
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
-
* See the License for the specific language governing permissions and
|
|
27
|
-
* limitations under the License.
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
class BidiNetworkManager {
|
|
31
|
-
constructor(bidiSession, page, onNavigationResponseStarted) {
|
|
32
|
-
this._session = void 0;
|
|
33
|
-
this._requests = void 0;
|
|
34
|
-
this._page = void 0;
|
|
35
|
-
this._eventListeners = void 0;
|
|
36
|
-
this._onNavigationResponseStarted = void 0;
|
|
37
|
-
this._userRequestInterceptionEnabled = false;
|
|
38
|
-
this._protocolRequestInterceptionEnabled = false;
|
|
39
|
-
this._credentials = void 0;
|
|
40
|
-
this._intercepId = void 0;
|
|
41
|
-
this._session = bidiSession;
|
|
42
|
-
this._requests = new Map();
|
|
43
|
-
this._page = page;
|
|
44
|
-
this._onNavigationResponseStarted = onNavigationResponseStarted;
|
|
45
|
-
this._eventListeners = [_eventsHelper.eventsHelper.addEventListener(bidiSession, 'network.beforeRequestSent', this._onBeforeRequestSent.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'network.responseStarted', this._onResponseStarted.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'network.responseCompleted', this._onResponseCompleted.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'network.fetchError', this._onFetchError.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'network.authRequired', this._onAuthRequired.bind(this))];
|
|
46
|
-
}
|
|
47
|
-
dispose() {
|
|
48
|
-
_eventsHelper.eventsHelper.removeEventListeners(this._eventListeners);
|
|
49
|
-
}
|
|
50
|
-
_onBeforeRequestSent(param) {
|
|
51
|
-
if (param.request.url.startsWith('data:')) return;
|
|
52
|
-
const redirectedFrom = param.redirectCount ? this._requests.get(param.request.request) || null : null;
|
|
53
|
-
const frame = redirectedFrom ? redirectedFrom.request.frame() : param.context ? this._page._frameManager.frame(param.context) : null;
|
|
54
|
-
if (!frame) return;
|
|
55
|
-
if (redirectedFrom) this._requests.delete(redirectedFrom._id);
|
|
56
|
-
let route;
|
|
57
|
-
if (param.intercepts) {
|
|
58
|
-
// We do not support intercepting redirects.
|
|
59
|
-
if (redirectedFrom) {
|
|
60
|
-
var _redirectedFrom$_orig, _redirectedFrom$_orig2;
|
|
61
|
-
let params = {};
|
|
62
|
-
if ((_redirectedFrom$_orig = redirectedFrom._originalRequestRoute) !== null && _redirectedFrom$_orig !== void 0 && _redirectedFrom$_orig._alreadyContinuedHeaders) params = toBidiRequestHeaders((_redirectedFrom$_orig2 = redirectedFrom._originalRequestRoute._alreadyContinuedHeaders) !== null && _redirectedFrom$_orig2 !== void 0 ? _redirectedFrom$_orig2 : []);
|
|
63
|
-
this._session.sendMayFail('network.continueRequest', {
|
|
64
|
-
request: param.request.request,
|
|
65
|
-
...params
|
|
66
|
-
});
|
|
67
|
-
} else {
|
|
68
|
-
route = new BidiRouteImpl(this._session, param.request.request);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
const request = new BidiRequest(frame, redirectedFrom, param, route);
|
|
72
|
-
this._requests.set(request._id, request);
|
|
73
|
-
this._page._frameManager.requestStarted(request.request, route);
|
|
74
|
-
}
|
|
75
|
-
_onResponseStarted(params) {
|
|
76
|
-
const request = this._requests.get(params.request.request);
|
|
77
|
-
if (!request) return;
|
|
78
|
-
const getResponseBody = async () => {
|
|
79
|
-
throw new Error(`Response body is not available for requests in Bidi`);
|
|
80
|
-
};
|
|
81
|
-
const timings = params.request.timings;
|
|
82
|
-
const startTime = timings.requestTime;
|
|
83
|
-
function relativeToStart(time) {
|
|
84
|
-
if (!time) return -1;
|
|
85
|
-
return time - startTime;
|
|
86
|
-
}
|
|
87
|
-
const timing = {
|
|
88
|
-
startTime: startTime,
|
|
89
|
-
requestStart: relativeToStart(timings.requestStart),
|
|
90
|
-
responseStart: relativeToStart(timings.responseStart),
|
|
91
|
-
domainLookupStart: relativeToStart(timings.dnsStart),
|
|
92
|
-
domainLookupEnd: relativeToStart(timings.dnsEnd),
|
|
93
|
-
connectStart: relativeToStart(timings.connectStart),
|
|
94
|
-
secureConnectionStart: relativeToStart(timings.tlsStart),
|
|
95
|
-
connectEnd: relativeToStart(timings.connectEnd)
|
|
96
|
-
};
|
|
97
|
-
const response = new network.Response(request.request, params.response.status, params.response.statusText, fromBidiHeaders(params.response.headers), timing, getResponseBody, false);
|
|
98
|
-
response._serverAddrFinished();
|
|
99
|
-
response._securityDetailsFinished();
|
|
100
|
-
// "raw" headers are the same as "provisional" headers in Bidi.
|
|
101
|
-
response.setRawResponseHeaders(null);
|
|
102
|
-
response.setResponseHeadersSize(params.response.headersSize);
|
|
103
|
-
this._page._frameManager.requestReceivedResponse(response);
|
|
104
|
-
if (params.navigation) this._onNavigationResponseStarted(params);
|
|
105
|
-
}
|
|
106
|
-
_onResponseCompleted(params) {
|
|
107
|
-
const request = this._requests.get(params.request.request);
|
|
108
|
-
if (!request) return;
|
|
109
|
-
const response = request.request._existingResponse();
|
|
110
|
-
// TODO: body size is the encoded size
|
|
111
|
-
response.setTransferSize(params.response.bodySize);
|
|
112
|
-
response.setEncodedBodySize(params.response.bodySize);
|
|
113
|
-
|
|
114
|
-
// Keep redirected requests in the map for future reference as redirectedFrom.
|
|
115
|
-
const isRedirected = response.status() >= 300 && response.status() <= 399;
|
|
116
|
-
const responseEndTime = params.request.timings.responseEnd - response.timing().startTime;
|
|
117
|
-
if (isRedirected) {
|
|
118
|
-
response._requestFinished(responseEndTime);
|
|
119
|
-
} else {
|
|
120
|
-
this._requests.delete(request._id);
|
|
121
|
-
response._requestFinished(responseEndTime);
|
|
122
|
-
}
|
|
123
|
-
response._setHttpVersion(params.response.protocol);
|
|
124
|
-
this._page._frameManager.reportRequestFinished(request.request, response);
|
|
125
|
-
}
|
|
126
|
-
_onFetchError(params) {
|
|
127
|
-
const request = this._requests.get(params.request.request);
|
|
128
|
-
if (!request) return;
|
|
129
|
-
this._requests.delete(request._id);
|
|
130
|
-
const response = request.request._existingResponse();
|
|
131
|
-
if (response) {
|
|
132
|
-
response.setTransferSize(null);
|
|
133
|
-
response.setEncodedBodySize(null);
|
|
134
|
-
response._requestFinished(-1);
|
|
135
|
-
}
|
|
136
|
-
request.request._setFailureText(params.errorText);
|
|
137
|
-
// TODO: support canceled flag
|
|
138
|
-
this._page._frameManager.requestFailed(request.request, params.errorText === 'NS_BINDING_ABORTED');
|
|
139
|
-
}
|
|
140
|
-
_onAuthRequired(params) {
|
|
141
|
-
var _params$response$auth;
|
|
142
|
-
const isBasic = (_params$response$auth = params.response.authChallenges) === null || _params$response$auth === void 0 ? void 0 : _params$response$auth.some(challenge => challenge.scheme.startsWith('Basic'));
|
|
143
|
-
const credentials = this._page._browserContext._options.httpCredentials;
|
|
144
|
-
if (isBasic && credentials) {
|
|
145
|
-
this._session.sendMayFail('network.continueWithAuth', {
|
|
146
|
-
request: params.request.request,
|
|
147
|
-
action: 'provideCredentials',
|
|
148
|
-
credentials: {
|
|
149
|
-
type: 'password',
|
|
150
|
-
username: credentials.username,
|
|
151
|
-
password: credentials.password
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
} else {
|
|
155
|
-
this._session.sendMayFail('network.continueWithAuth', {
|
|
156
|
-
request: params.request.request,
|
|
157
|
-
action: 'default'
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
async setRequestInterception(value) {
|
|
162
|
-
this._userRequestInterceptionEnabled = value;
|
|
163
|
-
await this._updateProtocolRequestInterception();
|
|
164
|
-
}
|
|
165
|
-
async setCredentials(credentials) {
|
|
166
|
-
this._credentials = credentials;
|
|
167
|
-
await this._updateProtocolRequestInterception();
|
|
168
|
-
}
|
|
169
|
-
async _updateProtocolRequestInterception(initial) {
|
|
170
|
-
const enabled = this._userRequestInterceptionEnabled || !!this._credentials;
|
|
171
|
-
if (enabled === this._protocolRequestInterceptionEnabled) return;
|
|
172
|
-
this._protocolRequestInterceptionEnabled = enabled;
|
|
173
|
-
if (initial && !enabled) return;
|
|
174
|
-
const cachePromise = this._session.send('network.setCacheBehavior', {
|
|
175
|
-
cacheBehavior: enabled ? 'bypass' : 'default'
|
|
176
|
-
});
|
|
177
|
-
let interceptPromise = Promise.resolve(undefined);
|
|
178
|
-
if (enabled) {
|
|
179
|
-
interceptPromise = this._session.send('network.addIntercept', {
|
|
180
|
-
phases: [bidi.Network.InterceptPhase.AuthRequired, bidi.Network.InterceptPhase.BeforeRequestSent],
|
|
181
|
-
urlPatterns: [{
|
|
182
|
-
type: 'pattern'
|
|
183
|
-
}]
|
|
184
|
-
// urlPatterns: [{ type: 'string', pattern: '*' }],
|
|
185
|
-
}).then(r => {
|
|
186
|
-
this._intercepId = r.intercept;
|
|
187
|
-
});
|
|
188
|
-
} else if (this._intercepId) {
|
|
189
|
-
interceptPromise = this._session.send('network.removeIntercept', {
|
|
190
|
-
intercept: this._intercepId
|
|
191
|
-
});
|
|
192
|
-
this._intercepId = undefined;
|
|
193
|
-
}
|
|
194
|
-
await Promise.all([cachePromise, interceptPromise]);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
exports.BidiNetworkManager = BidiNetworkManager;
|
|
198
|
-
class BidiRequest {
|
|
199
|
-
constructor(frame, redirectedFrom, payload, route) {
|
|
200
|
-
var _payload$navigation;
|
|
201
|
-
this.request = void 0;
|
|
202
|
-
this._id = void 0;
|
|
203
|
-
this._redirectedTo = void 0;
|
|
204
|
-
// Only first request in the chain can be intercepted, so this will
|
|
205
|
-
// store the first and only Route in the chain (if any).
|
|
206
|
-
this._originalRequestRoute = void 0;
|
|
207
|
-
this._id = payload.request.request;
|
|
208
|
-
if (redirectedFrom) redirectedFrom._redirectedTo = this;
|
|
209
|
-
// TODO: missing in the spec?
|
|
210
|
-
const postDataBuffer = null;
|
|
211
|
-
this.request = new network.Request(frame._page._browserContext, frame, null, redirectedFrom ? redirectedFrom.request : null, (_payload$navigation = payload.navigation) !== null && _payload$navigation !== void 0 ? _payload$navigation : undefined, payload.request.url, 'other', payload.request.method, postDataBuffer, fromBidiHeaders(payload.request.headers));
|
|
212
|
-
// "raw" headers are the same as "provisional" headers in Bidi.
|
|
213
|
-
this.request.setRawRequestHeaders(null);
|
|
214
|
-
this.request._setBodySize(payload.request.bodySize || 0);
|
|
215
|
-
this._originalRequestRoute = route !== null && route !== void 0 ? route : redirectedFrom === null || redirectedFrom === void 0 ? void 0 : redirectedFrom._originalRequestRoute;
|
|
216
|
-
route === null || route === void 0 || route._setRequest(this.request);
|
|
217
|
-
}
|
|
218
|
-
_finalRequest() {
|
|
219
|
-
let request = this;
|
|
220
|
-
while (request._redirectedTo) request = request._redirectedTo;
|
|
221
|
-
return request;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
class BidiRouteImpl {
|
|
225
|
-
constructor(session, requestId) {
|
|
226
|
-
this._requestId = void 0;
|
|
227
|
-
this._session = void 0;
|
|
228
|
-
this._request = void 0;
|
|
229
|
-
this._alreadyContinuedHeaders = void 0;
|
|
230
|
-
this._session = session;
|
|
231
|
-
this._requestId = requestId;
|
|
232
|
-
}
|
|
233
|
-
_setRequest(request) {
|
|
234
|
-
this._request = request;
|
|
235
|
-
}
|
|
236
|
-
async continue(overrides) {
|
|
237
|
-
// Firefox does not update content-length header.
|
|
238
|
-
let headers = overrides.headers || this._request.headers();
|
|
239
|
-
if (overrides.postData && headers) {
|
|
240
|
-
headers = headers.map(header => {
|
|
241
|
-
if (header.name.toLowerCase() === 'content-length') return {
|
|
242
|
-
name: header.name,
|
|
243
|
-
value: overrides.postData.byteLength.toString()
|
|
244
|
-
};
|
|
245
|
-
return header;
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
this._alreadyContinuedHeaders = headers;
|
|
249
|
-
await this._session.sendMayFail('network.continueRequest', {
|
|
250
|
-
request: this._requestId,
|
|
251
|
-
url: overrides.url,
|
|
252
|
-
method: overrides.method,
|
|
253
|
-
...toBidiRequestHeaders(this._alreadyContinuedHeaders),
|
|
254
|
-
body: overrides.postData ? {
|
|
255
|
-
type: 'base64',
|
|
256
|
-
value: Buffer.from(overrides.postData).toString('base64')
|
|
257
|
-
} : undefined
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
async fulfill(response) {
|
|
261
|
-
const base64body = response.isBase64 ? response.body : Buffer.from(response.body).toString('base64');
|
|
262
|
-
await this._session.sendMayFail('network.provideResponse', {
|
|
263
|
-
request: this._requestId,
|
|
264
|
-
statusCode: response.status,
|
|
265
|
-
reasonPhrase: network.statusText(response.status),
|
|
266
|
-
...toBidiResponseHeaders(response.headers),
|
|
267
|
-
body: {
|
|
268
|
-
type: 'base64',
|
|
269
|
-
value: base64body
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
async abort(errorCode) {
|
|
274
|
-
await this._session.sendMayFail('network.failRequest', {
|
|
275
|
-
request: this._requestId
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
function fromBidiHeaders(bidiHeaders) {
|
|
280
|
-
const result = [];
|
|
281
|
-
for (const {
|
|
282
|
-
name,
|
|
283
|
-
value
|
|
284
|
-
} of bidiHeaders) result.push({
|
|
285
|
-
name,
|
|
286
|
-
value: bidiBytesValueToString(value)
|
|
287
|
-
});
|
|
288
|
-
return result;
|
|
289
|
-
}
|
|
290
|
-
function toBidiRequestHeaders(allHeaders) {
|
|
291
|
-
const bidiHeaders = toBidiHeaders(allHeaders);
|
|
292
|
-
return {
|
|
293
|
-
headers: bidiHeaders
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
function toBidiResponseHeaders(headers) {
|
|
297
|
-
const setCookieHeaders = headers.filter(h => h.name.toLowerCase() === 'set-cookie');
|
|
298
|
-
const otherHeaders = headers.filter(h => h.name.toLowerCase() !== 'set-cookie');
|
|
299
|
-
const rawCookies = setCookieHeaders.map(h => (0, _cookieStore.parseRawCookie)(h.value));
|
|
300
|
-
const cookies = rawCookies.filter(Boolean).map(c => {
|
|
301
|
-
return {
|
|
302
|
-
...c,
|
|
303
|
-
value: {
|
|
304
|
-
type: 'string',
|
|
305
|
-
value: c.value
|
|
306
|
-
},
|
|
307
|
-
sameSite: toBidiSameSite(c.sameSite)
|
|
308
|
-
};
|
|
309
|
-
});
|
|
310
|
-
return {
|
|
311
|
-
cookies,
|
|
312
|
-
headers: toBidiHeaders(otherHeaders)
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
function toBidiHeaders(headers) {
|
|
316
|
-
return headers.map(({
|
|
317
|
-
name,
|
|
318
|
-
value
|
|
319
|
-
}) => ({
|
|
320
|
-
name,
|
|
321
|
-
value: {
|
|
322
|
-
type: 'string',
|
|
323
|
-
value
|
|
324
|
-
}
|
|
325
|
-
}));
|
|
326
|
-
}
|
|
327
|
-
function bidiBytesValueToString(value) {
|
|
328
|
-
if (value.type === 'string') return value.value;
|
|
329
|
-
if (value.type === 'base64') return Buffer.from(value.type, 'base64').toString('binary');
|
|
330
|
-
return 'unknown value type: ' + value.type;
|
|
331
|
-
}
|
|
332
|
-
function toBidiSameSite(sameSite) {
|
|
333
|
-
if (!sameSite) return undefined;
|
|
334
|
-
if (sameSite === 'Strict') return bidi.Network.SameSite.Strict;
|
|
335
|
-
if (sameSite === 'Lax') return bidi.Network.SameSite.Lax;
|
|
336
|
-
return bidi.Network.SameSite.None;
|
|
337
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.connectBidiOverCdp = connectBidiOverCdp;
|
|
7
|
-
var bidiMapper = _interopRequireWildcard(require("chromium-bidi/lib/cjs/bidiMapper/BidiMapper"));
|
|
8
|
-
var bidiCdpConnection = _interopRequireWildcard(require("chromium-bidi/lib/cjs/cdp/CdpConnection"));
|
|
9
|
-
var _debugLogger = require("../../utils/debugLogger");
|
|
10
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
-
/**
|
|
13
|
-
* Copyright (c) Microsoft Corporation.
|
|
14
|
-
*
|
|
15
|
-
* Licensed under the Apache License, Version 2.0 (the 'License');
|
|
16
|
-
* you may not use this file except in compliance with the License.
|
|
17
|
-
* You may obtain a copy of the License at
|
|
18
|
-
*
|
|
19
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
-
*
|
|
21
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
22
|
-
* distributed under the License is distributed on an 'AS IS' BASIS,
|
|
23
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
|
-
* See the License for the specific language governing permissions and
|
|
25
|
-
* limitations under the License.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
const bidiServerLogger = (prefix, ...args) => {
|
|
29
|
-
_debugLogger.debugLogger.log(prefix, args);
|
|
30
|
-
};
|
|
31
|
-
async function connectBidiOverCdp(cdp) {
|
|
32
|
-
let server = undefined;
|
|
33
|
-
const bidiTransport = new BidiTransportImpl();
|
|
34
|
-
const bidiConnection = new BidiConnection(bidiTransport, () => {
|
|
35
|
-
var _server;
|
|
36
|
-
return (_server = server) === null || _server === void 0 ? void 0 : _server.close();
|
|
37
|
-
});
|
|
38
|
-
const cdpTransportImpl = new CdpTransportImpl(cdp);
|
|
39
|
-
const cdpConnection = new bidiCdpConnection.MapperCdpConnection(cdpTransportImpl, bidiServerLogger);
|
|
40
|
-
// Make sure onclose event is propagated.
|
|
41
|
-
cdp.onclose = () => {
|
|
42
|
-
var _bidiConnection$onclo;
|
|
43
|
-
return (_bidiConnection$onclo = bidiConnection.onclose) === null || _bidiConnection$onclo === void 0 ? void 0 : _bidiConnection$onclo.call(bidiConnection);
|
|
44
|
-
};
|
|
45
|
-
server = await bidiMapper.BidiServer.createAndStart(bidiTransport, cdpConnection, await cdpConnection.createBrowserSession(), /* selfTargetId= */'', undefined, bidiServerLogger);
|
|
46
|
-
return bidiConnection;
|
|
47
|
-
}
|
|
48
|
-
class BidiTransportImpl {
|
|
49
|
-
constructor() {
|
|
50
|
-
this._handler = void 0;
|
|
51
|
-
this._bidiConnection = void 0;
|
|
52
|
-
}
|
|
53
|
-
setOnMessage(handler) {
|
|
54
|
-
this._handler = handler;
|
|
55
|
-
}
|
|
56
|
-
sendMessage(message) {
|
|
57
|
-
var _this$_bidiConnection, _this$_bidiConnection2;
|
|
58
|
-
return (_this$_bidiConnection = (_this$_bidiConnection2 = this._bidiConnection).onmessage) === null || _this$_bidiConnection === void 0 ? void 0 : _this$_bidiConnection.call(_this$_bidiConnection2, message);
|
|
59
|
-
}
|
|
60
|
-
close() {
|
|
61
|
-
var _this$_bidiConnection3, _this$_bidiConnection4;
|
|
62
|
-
(_this$_bidiConnection3 = (_this$_bidiConnection4 = this._bidiConnection).onclose) === null || _this$_bidiConnection3 === void 0 || _this$_bidiConnection3.call(_this$_bidiConnection4);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
class BidiConnection {
|
|
66
|
-
constructor(bidiTransport, closeCallback) {
|
|
67
|
-
this._bidiTransport = void 0;
|
|
68
|
-
this._closeCallback = void 0;
|
|
69
|
-
this.onmessage = void 0;
|
|
70
|
-
this.onclose = void 0;
|
|
71
|
-
this._bidiTransport = bidiTransport;
|
|
72
|
-
this._bidiTransport._bidiConnection = this;
|
|
73
|
-
this._closeCallback = closeCallback;
|
|
74
|
-
}
|
|
75
|
-
send(s) {
|
|
76
|
-
var _this$_bidiTransport$, _this$_bidiTransport;
|
|
77
|
-
(_this$_bidiTransport$ = (_this$_bidiTransport = this._bidiTransport)._handler) === null || _this$_bidiTransport$ === void 0 || _this$_bidiTransport$.call(_this$_bidiTransport, s);
|
|
78
|
-
}
|
|
79
|
-
close() {
|
|
80
|
-
this._closeCallback();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
class CdpTransportImpl {
|
|
84
|
-
constructor(connection) {
|
|
85
|
-
this._connection = void 0;
|
|
86
|
-
this._handler = void 0;
|
|
87
|
-
this._bidiConnection = void 0;
|
|
88
|
-
this._connection = connection;
|
|
89
|
-
this._connection.onmessage = message => {
|
|
90
|
-
var _this$_handler;
|
|
91
|
-
(_this$_handler = this._handler) === null || _this$_handler === void 0 || _this$_handler.call(this, JSON.stringify(message));
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
setOnMessage(handler) {
|
|
95
|
-
this._handler = handler;
|
|
96
|
-
}
|
|
97
|
-
sendMessage(message) {
|
|
98
|
-
return this._connection.send(JSON.parse(message));
|
|
99
|
-
}
|
|
100
|
-
close() {
|
|
101
|
-
this._connection.close();
|
|
102
|
-
}
|
|
103
|
-
}
|