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,518 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.frameSnapshotStreamer = frameSnapshotStreamer;
|
|
7
|
-
/**
|
|
8
|
-
* Copyright (c) Microsoft Corporation.
|
|
9
|
-
*
|
|
10
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
-
* you may not use this file except in compliance with the License.
|
|
12
|
-
* You may obtain a copy of the License at
|
|
13
|
-
*
|
|
14
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
*
|
|
16
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
-
* See the License for the specific language governing permissions and
|
|
20
|
-
* limitations under the License.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
function frameSnapshotStreamer(snapshotStreamer, removeNoScript) {
|
|
24
|
-
// Communication with Playwright.
|
|
25
|
-
if (window[snapshotStreamer]) return;
|
|
26
|
-
|
|
27
|
-
// Attributes present in the snapshot.
|
|
28
|
-
const kShadowAttribute = '__playwright_shadow_root_';
|
|
29
|
-
const kValueAttribute = '__playwright_value_';
|
|
30
|
-
const kCheckedAttribute = '__playwright_checked_';
|
|
31
|
-
const kSelectedAttribute = '__playwright_selected_';
|
|
32
|
-
const kScrollTopAttribute = '__playwright_scroll_top_';
|
|
33
|
-
const kScrollLeftAttribute = '__playwright_scroll_left_';
|
|
34
|
-
const kStyleSheetAttribute = '__playwright_style_sheet_';
|
|
35
|
-
const kTargetAttribute = '__playwright_target__';
|
|
36
|
-
const kCustomElementsAttribute = '__playwright_custom_elements__';
|
|
37
|
-
const kCurrentSrcAttribute = '__playwright_current_src__';
|
|
38
|
-
const kBoundingRectAttribute = '__playwright_bounding_rect__';
|
|
39
|
-
const kPopoverOpenAttribute = '__playwright_popover_open_';
|
|
40
|
-
|
|
41
|
-
// Symbols for our own info on Nodes/StyleSheets.
|
|
42
|
-
const kSnapshotFrameId = Symbol('__playwright_snapshot_frameid_');
|
|
43
|
-
const kCachedData = Symbol('__playwright_snapshot_cache_');
|
|
44
|
-
const kEndOfList = Symbol('__playwright_end_of_list_');
|
|
45
|
-
function resetCachedData(obj) {
|
|
46
|
-
delete obj[kCachedData];
|
|
47
|
-
}
|
|
48
|
-
function ensureCachedData(obj) {
|
|
49
|
-
if (!obj[kCachedData]) obj[kCachedData] = {};
|
|
50
|
-
return obj[kCachedData];
|
|
51
|
-
}
|
|
52
|
-
function removeHash(url) {
|
|
53
|
-
try {
|
|
54
|
-
const u = new URL(url);
|
|
55
|
-
u.hash = '';
|
|
56
|
-
return u.toString();
|
|
57
|
-
} catch (e) {
|
|
58
|
-
return url;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
class Streamer {
|
|
62
|
-
constructor() {
|
|
63
|
-
this._lastSnapshotNumber = 0;
|
|
64
|
-
this._staleStyleSheets = new Set();
|
|
65
|
-
this._readingStyleSheet = false;
|
|
66
|
-
// To avoid invalidating due to our own reads.
|
|
67
|
-
this._fakeBase = void 0;
|
|
68
|
-
this._observer = void 0;
|
|
69
|
-
const invalidateCSSGroupingRule = rule => {
|
|
70
|
-
if (rule.parentStyleSheet) this._invalidateStyleSheet(rule.parentStyleSheet);
|
|
71
|
-
};
|
|
72
|
-
this._interceptNativeMethod(window.CSSStyleSheet.prototype, 'insertRule', sheet => this._invalidateStyleSheet(sheet));
|
|
73
|
-
this._interceptNativeMethod(window.CSSStyleSheet.prototype, 'deleteRule', sheet => this._invalidateStyleSheet(sheet));
|
|
74
|
-
this._interceptNativeMethod(window.CSSStyleSheet.prototype, 'addRule', sheet => this._invalidateStyleSheet(sheet));
|
|
75
|
-
this._interceptNativeMethod(window.CSSStyleSheet.prototype, 'removeRule', sheet => this._invalidateStyleSheet(sheet));
|
|
76
|
-
this._interceptNativeGetter(window.CSSStyleSheet.prototype, 'rules', sheet => this._invalidateStyleSheet(sheet));
|
|
77
|
-
this._interceptNativeGetter(window.CSSStyleSheet.prototype, 'cssRules', sheet => this._invalidateStyleSheet(sheet));
|
|
78
|
-
this._interceptNativeMethod(window.CSSStyleSheet.prototype, 'replaceSync', sheet => this._invalidateStyleSheet(sheet));
|
|
79
|
-
this._interceptNativeMethod(window.CSSGroupingRule.prototype, 'insertRule', invalidateCSSGroupingRule);
|
|
80
|
-
this._interceptNativeMethod(window.CSSGroupingRule.prototype, 'deleteRule', invalidateCSSGroupingRule);
|
|
81
|
-
this._interceptNativeGetter(window.CSSGroupingRule.prototype, 'cssRules', invalidateCSSGroupingRule);
|
|
82
|
-
this._interceptNativeAsyncMethod(window.CSSStyleSheet.prototype, 'replace', sheet => this._invalidateStyleSheet(sheet));
|
|
83
|
-
this._fakeBase = document.createElement('base');
|
|
84
|
-
this._observer = new MutationObserver(list => this._handleMutations(list));
|
|
85
|
-
const observerConfig = {
|
|
86
|
-
attributes: true,
|
|
87
|
-
subtree: true
|
|
88
|
-
};
|
|
89
|
-
this._observer.observe(document, observerConfig);
|
|
90
|
-
this._refreshListenersWhenNeeded();
|
|
91
|
-
}
|
|
92
|
-
_refreshListenersWhenNeeded() {
|
|
93
|
-
this._refreshListeners();
|
|
94
|
-
const customEventName = '__playwright_snapshotter_global_listeners_check__';
|
|
95
|
-
let seenEvent = false;
|
|
96
|
-
const handleCustomEvent = () => seenEvent = true;
|
|
97
|
-
window.addEventListener(customEventName, handleCustomEvent);
|
|
98
|
-
const observer = new MutationObserver(entries => {
|
|
99
|
-
// Check for new documentElement in case we need to reinstall document listeners.
|
|
100
|
-
const newDocumentElement = entries.some(entry => Array.from(entry.addedNodes).includes(document.documentElement));
|
|
101
|
-
if (newDocumentElement) {
|
|
102
|
-
// New documentElement - let's check whether listeners are still here.
|
|
103
|
-
seenEvent = false;
|
|
104
|
-
window.dispatchEvent(new CustomEvent(customEventName));
|
|
105
|
-
if (!seenEvent) {
|
|
106
|
-
// Listener did not fire. Reattach the listener and notify.
|
|
107
|
-
window.addEventListener(customEventName, handleCustomEvent);
|
|
108
|
-
this._refreshListeners();
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
observer.observe(document, {
|
|
113
|
-
childList: true
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
_refreshListeners() {
|
|
117
|
-
document.addEventListener('__playwright_mark_target__', event => {
|
|
118
|
-
if (!event.detail) return;
|
|
119
|
-
const callId = event.detail;
|
|
120
|
-
event.composedPath()[0].__playwright_target__ = callId;
|
|
121
|
-
});
|
|
122
|
-
document.addEventListener('__playwright_unmark_target__', event => {
|
|
123
|
-
if (!event.detail) return;
|
|
124
|
-
const callId = event.detail;
|
|
125
|
-
if (event.composedPath()[0].__playwright_target__ === callId) delete event.composedPath()[0].__playwright_target__;
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
_interceptNativeMethod(obj, method, cb) {
|
|
129
|
-
const native = obj[method];
|
|
130
|
-
if (!native) return;
|
|
131
|
-
obj[method] = function (...args) {
|
|
132
|
-
const result = native.call(this, ...args);
|
|
133
|
-
cb(this, result);
|
|
134
|
-
return result;
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
_interceptNativeAsyncMethod(obj, method, cb) {
|
|
138
|
-
const native = obj[method];
|
|
139
|
-
if (!native) return;
|
|
140
|
-
obj[method] = async function (...args) {
|
|
141
|
-
const result = await native.call(this, ...args);
|
|
142
|
-
cb(this, result);
|
|
143
|
-
return result;
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
_interceptNativeGetter(obj, prop, cb) {
|
|
147
|
-
const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
|
|
148
|
-
Object.defineProperty(obj, prop, {
|
|
149
|
-
...descriptor,
|
|
150
|
-
get: function () {
|
|
151
|
-
const result = descriptor.get.call(this);
|
|
152
|
-
cb(this, result);
|
|
153
|
-
return result;
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
_handleMutations(list) {
|
|
158
|
-
for (const mutation of list) ensureCachedData(mutation.target).attributesCached = undefined;
|
|
159
|
-
}
|
|
160
|
-
_invalidateStyleSheet(sheet) {
|
|
161
|
-
if (this._readingStyleSheet) return;
|
|
162
|
-
this._staleStyleSheets.add(sheet);
|
|
163
|
-
}
|
|
164
|
-
_updateStyleElementStyleSheetTextIfNeeded(sheet, forceText) {
|
|
165
|
-
const data = ensureCachedData(sheet);
|
|
166
|
-
if (this._staleStyleSheets.has(sheet) || forceText && data.cssText === undefined) {
|
|
167
|
-
this._staleStyleSheets.delete(sheet);
|
|
168
|
-
try {
|
|
169
|
-
data.cssText = this._getSheetText(sheet);
|
|
170
|
-
} catch (e) {
|
|
171
|
-
// Sometimes we cannot access cross-origin stylesheets.
|
|
172
|
-
data.cssText = '';
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
return data.cssText;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// Returns either content, ref, or no override.
|
|
179
|
-
_updateLinkStyleSheetTextIfNeeded(sheet, snapshotNumber) {
|
|
180
|
-
const data = ensureCachedData(sheet);
|
|
181
|
-
if (this._staleStyleSheets.has(sheet)) {
|
|
182
|
-
this._staleStyleSheets.delete(sheet);
|
|
183
|
-
try {
|
|
184
|
-
data.cssText = this._getSheetText(sheet);
|
|
185
|
-
data.cssRef = snapshotNumber;
|
|
186
|
-
return data.cssText;
|
|
187
|
-
} catch (e) {
|
|
188
|
-
// Sometimes we cannot access cross-origin stylesheets.
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
return data.cssRef === undefined ? undefined : snapshotNumber - data.cssRef;
|
|
192
|
-
}
|
|
193
|
-
markIframe(iframeElement, frameId) {
|
|
194
|
-
iframeElement[kSnapshotFrameId] = frameId;
|
|
195
|
-
}
|
|
196
|
-
reset() {
|
|
197
|
-
this._staleStyleSheets.clear();
|
|
198
|
-
const visitNode = node => {
|
|
199
|
-
resetCachedData(node);
|
|
200
|
-
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
201
|
-
const element = node;
|
|
202
|
-
if (element.shadowRoot) visitNode(element.shadowRoot);
|
|
203
|
-
}
|
|
204
|
-
for (let child = node.firstChild; child; child = child.nextSibling) visitNode(child);
|
|
205
|
-
};
|
|
206
|
-
visitNode(document.documentElement);
|
|
207
|
-
visitNode(this._fakeBase);
|
|
208
|
-
}
|
|
209
|
-
__sanitizeMetaAttribute(name, value, httpEquiv) {
|
|
210
|
-
if (name === 'charset') return 'utf-8';
|
|
211
|
-
if (httpEquiv.toLowerCase() !== 'content-type' || name !== 'content') return value;
|
|
212
|
-
const [type, ...params] = value.split(';');
|
|
213
|
-
if (type !== 'text/html' || params.length <= 0) return value;
|
|
214
|
-
const charsetParamIdx = params.findIndex(param => param.trim().startsWith('charset='));
|
|
215
|
-
if (charsetParamIdx > -1) params[charsetParamIdx] = 'charset=utf-8';
|
|
216
|
-
return `${type}; ${params.join('; ')}`;
|
|
217
|
-
}
|
|
218
|
-
_sanitizeUrl(url) {
|
|
219
|
-
if (url.startsWith('javascript:') || url.startsWith('vbscript:')) return '';
|
|
220
|
-
return url;
|
|
221
|
-
}
|
|
222
|
-
_sanitizeSrcSet(srcset) {
|
|
223
|
-
return srcset.split(',').map(src => {
|
|
224
|
-
src = src.trim();
|
|
225
|
-
const spaceIndex = src.lastIndexOf(' ');
|
|
226
|
-
if (spaceIndex === -1) return this._sanitizeUrl(src);
|
|
227
|
-
return this._sanitizeUrl(src.substring(0, spaceIndex).trim()) + src.substring(spaceIndex);
|
|
228
|
-
}).join(', ');
|
|
229
|
-
}
|
|
230
|
-
_resolveUrl(base, url) {
|
|
231
|
-
if (url === '') return '';
|
|
232
|
-
try {
|
|
233
|
-
return new URL(url, base).href;
|
|
234
|
-
} catch (e) {
|
|
235
|
-
return url;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
_getSheetBase(sheet) {
|
|
239
|
-
let rootSheet = sheet;
|
|
240
|
-
while (rootSheet.parentStyleSheet) rootSheet = rootSheet.parentStyleSheet;
|
|
241
|
-
if (rootSheet.ownerNode) return rootSheet.ownerNode.baseURI;
|
|
242
|
-
return document.baseURI;
|
|
243
|
-
}
|
|
244
|
-
_getSheetText(sheet) {
|
|
245
|
-
this._readingStyleSheet = true;
|
|
246
|
-
try {
|
|
247
|
-
const rules = [];
|
|
248
|
-
for (const rule of sheet.cssRules) rules.push(rule.cssText);
|
|
249
|
-
return rules.join('\n');
|
|
250
|
-
} finally {
|
|
251
|
-
this._readingStyleSheet = false;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
captureSnapshot() {
|
|
255
|
-
const timestamp = performance.now();
|
|
256
|
-
const snapshotNumber = ++this._lastSnapshotNumber;
|
|
257
|
-
let nodeCounter = 0;
|
|
258
|
-
let shadowDomNesting = 0;
|
|
259
|
-
let headNesting = 0;
|
|
260
|
-
|
|
261
|
-
// Ensure we are up to date.
|
|
262
|
-
this._handleMutations(this._observer.takeRecords());
|
|
263
|
-
const definedCustomElements = new Set();
|
|
264
|
-
const visitNode = node => {
|
|
265
|
-
const nodeType = node.nodeType;
|
|
266
|
-
const nodeName = nodeType === Node.DOCUMENT_FRAGMENT_NODE ? 'template' : node.nodeName;
|
|
267
|
-
if (nodeType !== Node.ELEMENT_NODE && nodeType !== Node.DOCUMENT_FRAGMENT_NODE && nodeType !== Node.TEXT_NODE) return;
|
|
268
|
-
if (nodeName === 'SCRIPT') return;
|
|
269
|
-
// Don't preload resources.
|
|
270
|
-
if (nodeName === 'LINK' && nodeType === Node.ELEMENT_NODE) {
|
|
271
|
-
var _getAttribute;
|
|
272
|
-
const rel = (_getAttribute = node.getAttribute('rel')) === null || _getAttribute === void 0 ? void 0 : _getAttribute.toLowerCase();
|
|
273
|
-
if (rel === 'preload' || rel === 'prefetch') return;
|
|
274
|
-
}
|
|
275
|
-
if (removeNoScript && nodeName === 'NOSCRIPT') return;
|
|
276
|
-
if (nodeName === 'META' && node.httpEquiv.toLowerCase() === 'content-security-policy') return;
|
|
277
|
-
// Skip iframes which are inside document's head as they are not visible.
|
|
278
|
-
// See https://github.com/microsoft/playwright/issues/12005.
|
|
279
|
-
if ((nodeName === 'IFRAME' || nodeName === 'FRAME') && headNesting) return;
|
|
280
|
-
const data = ensureCachedData(node);
|
|
281
|
-
const values = [];
|
|
282
|
-
let equals = !!data.cached;
|
|
283
|
-
let extraNodes = 0;
|
|
284
|
-
const expectValue = value => {
|
|
285
|
-
equals = equals && data.cached[values.length] === value;
|
|
286
|
-
values.push(value);
|
|
287
|
-
};
|
|
288
|
-
const checkAndReturn = n => {
|
|
289
|
-
data.attributesCached = true;
|
|
290
|
-
if (equals) return {
|
|
291
|
-
equals: true,
|
|
292
|
-
n: [[snapshotNumber - data.ref[0], data.ref[1]]]
|
|
293
|
-
};
|
|
294
|
-
nodeCounter += extraNodes;
|
|
295
|
-
data.ref = [snapshotNumber, nodeCounter++];
|
|
296
|
-
data.cached = values;
|
|
297
|
-
return {
|
|
298
|
-
equals: false,
|
|
299
|
-
n
|
|
300
|
-
};
|
|
301
|
-
};
|
|
302
|
-
if (nodeType === Node.TEXT_NODE) {
|
|
303
|
-
const value = node.nodeValue || '';
|
|
304
|
-
expectValue(value);
|
|
305
|
-
return checkAndReturn(value);
|
|
306
|
-
}
|
|
307
|
-
if (nodeName === 'STYLE') {
|
|
308
|
-
const sheet = node.sheet;
|
|
309
|
-
let cssText;
|
|
310
|
-
if (sheet) cssText = this._updateStyleElementStyleSheetTextIfNeeded(sheet);
|
|
311
|
-
cssText = cssText || node.textContent || '';
|
|
312
|
-
expectValue(cssText);
|
|
313
|
-
// Compensate for the extra 'cssText' text node.
|
|
314
|
-
extraNodes++;
|
|
315
|
-
return checkAndReturn([nodeName, {}, cssText]);
|
|
316
|
-
}
|
|
317
|
-
const attrs = {};
|
|
318
|
-
const result = [nodeName, attrs];
|
|
319
|
-
const visitChild = child => {
|
|
320
|
-
const snapshot = visitNode(child);
|
|
321
|
-
if (snapshot) {
|
|
322
|
-
result.push(snapshot.n);
|
|
323
|
-
expectValue(child);
|
|
324
|
-
equals = equals && snapshot.equals;
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
const visitChildStyleSheet = child => {
|
|
328
|
-
const snapshot = visitStyleSheet(child);
|
|
329
|
-
if (snapshot) {
|
|
330
|
-
result.push(snapshot.n);
|
|
331
|
-
expectValue(child);
|
|
332
|
-
equals = equals && snapshot.equals;
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
if (nodeType === Node.DOCUMENT_FRAGMENT_NODE) attrs[kShadowAttribute] = 'open';
|
|
336
|
-
if (nodeType === Node.ELEMENT_NODE) {
|
|
337
|
-
var _window$customElement;
|
|
338
|
-
const element = node;
|
|
339
|
-
if (element.localName.includes('-') && (_window$customElement = window.customElements) !== null && _window$customElement !== void 0 && _window$customElement.get(element.localName)) definedCustomElements.add(element.localName);
|
|
340
|
-
if (nodeName === 'INPUT' || nodeName === 'TEXTAREA') {
|
|
341
|
-
const value = element.value;
|
|
342
|
-
expectValue(kValueAttribute);
|
|
343
|
-
expectValue(value);
|
|
344
|
-
attrs[kValueAttribute] = value;
|
|
345
|
-
}
|
|
346
|
-
if (nodeName === 'INPUT' && ['checkbox', 'radio'].includes(element.type)) {
|
|
347
|
-
const value = element.checked ? 'true' : 'false';
|
|
348
|
-
expectValue(kCheckedAttribute);
|
|
349
|
-
expectValue(value);
|
|
350
|
-
attrs[kCheckedAttribute] = value;
|
|
351
|
-
}
|
|
352
|
-
if (nodeName === 'OPTION') {
|
|
353
|
-
const value = element.selected ? 'true' : 'false';
|
|
354
|
-
expectValue(kSelectedAttribute);
|
|
355
|
-
expectValue(value);
|
|
356
|
-
attrs[kSelectedAttribute] = value;
|
|
357
|
-
}
|
|
358
|
-
if (nodeName === 'CANVAS' || nodeName === 'IFRAME' || nodeName === 'FRAME') {
|
|
359
|
-
const boundingRect = element.getBoundingClientRect();
|
|
360
|
-
const value = JSON.stringify({
|
|
361
|
-
left: boundingRect.left,
|
|
362
|
-
top: boundingRect.top,
|
|
363
|
-
right: boundingRect.right,
|
|
364
|
-
bottom: boundingRect.bottom
|
|
365
|
-
});
|
|
366
|
-
expectValue(kBoundingRectAttribute);
|
|
367
|
-
expectValue(value);
|
|
368
|
-
attrs[kBoundingRectAttribute] = value;
|
|
369
|
-
}
|
|
370
|
-
if (element.popover && element.matches && element.matches(':popover-open')) {
|
|
371
|
-
const value = 'true';
|
|
372
|
-
expectValue(kPopoverOpenAttribute);
|
|
373
|
-
expectValue(value);
|
|
374
|
-
attrs[kPopoverOpenAttribute] = value;
|
|
375
|
-
}
|
|
376
|
-
if (element.scrollTop) {
|
|
377
|
-
expectValue(kScrollTopAttribute);
|
|
378
|
-
expectValue(element.scrollTop);
|
|
379
|
-
attrs[kScrollTopAttribute] = '' + element.scrollTop;
|
|
380
|
-
}
|
|
381
|
-
if (element.scrollLeft) {
|
|
382
|
-
expectValue(kScrollLeftAttribute);
|
|
383
|
-
expectValue(element.scrollLeft);
|
|
384
|
-
attrs[kScrollLeftAttribute] = '' + element.scrollLeft;
|
|
385
|
-
}
|
|
386
|
-
if (element.shadowRoot) {
|
|
387
|
-
++shadowDomNesting;
|
|
388
|
-
visitChild(element.shadowRoot);
|
|
389
|
-
--shadowDomNesting;
|
|
390
|
-
}
|
|
391
|
-
if ('__playwright_target__' in element) {
|
|
392
|
-
expectValue(kTargetAttribute);
|
|
393
|
-
expectValue(element['__playwright_target__']);
|
|
394
|
-
attrs[kTargetAttribute] = element['__playwright_target__'];
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
if (nodeName === 'HEAD') {
|
|
398
|
-
++headNesting;
|
|
399
|
-
// Insert fake <base> first, to ensure all <link> elements use the proper base uri.
|
|
400
|
-
this._fakeBase.setAttribute('href', document.baseURI);
|
|
401
|
-
visitChild(this._fakeBase);
|
|
402
|
-
}
|
|
403
|
-
for (let child = node.firstChild; child; child = child.nextSibling) visitChild(child);
|
|
404
|
-
if (nodeName === 'HEAD') --headNesting;
|
|
405
|
-
expectValue(kEndOfList);
|
|
406
|
-
let documentOrShadowRoot = null;
|
|
407
|
-
if (node.ownerDocument.documentElement === node) documentOrShadowRoot = node.ownerDocument;else if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) documentOrShadowRoot = node;
|
|
408
|
-
if (documentOrShadowRoot) {
|
|
409
|
-
for (const sheet of documentOrShadowRoot.adoptedStyleSheets || []) visitChildStyleSheet(sheet);
|
|
410
|
-
expectValue(kEndOfList);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
// Process iframe src attribute before bailing out since it depends on a symbol, not the DOM.
|
|
414
|
-
if (nodeName === 'IFRAME' || nodeName === 'FRAME') {
|
|
415
|
-
const element = node;
|
|
416
|
-
const frameId = element[kSnapshotFrameId];
|
|
417
|
-
const name = 'src';
|
|
418
|
-
const value = frameId ? `/snapshot/${frameId}` : '';
|
|
419
|
-
expectValue(name);
|
|
420
|
-
expectValue(value);
|
|
421
|
-
attrs[name] = value;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
// Process custom elements before bailing out since they depend on JS, not the DOM.
|
|
425
|
-
if (nodeName === 'BODY' && definedCustomElements.size) {
|
|
426
|
-
const value = [...definedCustomElements].join(',');
|
|
427
|
-
expectValue(kCustomElementsAttribute);
|
|
428
|
-
expectValue(value);
|
|
429
|
-
attrs[kCustomElementsAttribute] = value;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
// Process currentSrc before bailing out since it depends on JS, not the DOM.
|
|
433
|
-
if (nodeName === 'IMG' || nodeName === 'PICTURE') {
|
|
434
|
-
const value = nodeName === 'PICTURE' ? '' : this._sanitizeUrl(node.currentSrc);
|
|
435
|
-
expectValue(kCurrentSrcAttribute);
|
|
436
|
-
expectValue(value);
|
|
437
|
-
attrs[kCurrentSrcAttribute] = value;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
// We can skip attributes comparison because nothing else has changed,
|
|
441
|
-
// and mutation observer didn't tell us about the attributes.
|
|
442
|
-
if (equals && data.attributesCached && !shadowDomNesting) return checkAndReturn(result);
|
|
443
|
-
if (nodeType === Node.ELEMENT_NODE) {
|
|
444
|
-
const element = node;
|
|
445
|
-
for (let i = 0; i < element.attributes.length; i++) {
|
|
446
|
-
const name = element.attributes[i].name;
|
|
447
|
-
if (nodeName === 'LINK' && name === 'integrity') continue;
|
|
448
|
-
if (nodeName === 'IFRAME' && (name === 'src' || name === 'srcdoc' || name === 'sandbox')) continue;
|
|
449
|
-
if (nodeName === 'FRAME' && name === 'src') continue;
|
|
450
|
-
let value = element.attributes[i].value;
|
|
451
|
-
if (nodeName === 'META') value = this.__sanitizeMetaAttribute(name, value, node.httpEquiv);else if (name === 'src' && nodeName === 'IMG') value = this._sanitizeUrl(value);else if (name === 'srcset' && nodeName === 'IMG') value = this._sanitizeSrcSet(value);else if (name === 'srcset' && nodeName === 'SOURCE') value = this._sanitizeSrcSet(value);else if (name === 'href' && nodeName === 'LINK') value = this._sanitizeUrl(value);else if (name.startsWith('on')) value = '';
|
|
452
|
-
expectValue(name);
|
|
453
|
-
expectValue(value);
|
|
454
|
-
attrs[name] = value;
|
|
455
|
-
}
|
|
456
|
-
expectValue(kEndOfList);
|
|
457
|
-
}
|
|
458
|
-
if (result.length === 2 && !Object.keys(attrs).length) result.pop(); // Remove empty attrs when there are no children.
|
|
459
|
-
return checkAndReturn(result);
|
|
460
|
-
};
|
|
461
|
-
const visitStyleSheet = sheet => {
|
|
462
|
-
const data = ensureCachedData(sheet);
|
|
463
|
-
const oldCSSText = data.cssText;
|
|
464
|
-
const cssText = this._updateStyleElementStyleSheetTextIfNeeded(sheet, true /* forceText */);
|
|
465
|
-
if (cssText === oldCSSText) return {
|
|
466
|
-
equals: true,
|
|
467
|
-
n: [[snapshotNumber - data.ref[0], data.ref[1]]]
|
|
468
|
-
};
|
|
469
|
-
data.ref = [snapshotNumber, nodeCounter++];
|
|
470
|
-
return {
|
|
471
|
-
equals: false,
|
|
472
|
-
n: ['template', {
|
|
473
|
-
[kStyleSheetAttribute]: cssText
|
|
474
|
-
}]
|
|
475
|
-
};
|
|
476
|
-
};
|
|
477
|
-
let html;
|
|
478
|
-
if (document.documentElement) {
|
|
479
|
-
const {
|
|
480
|
-
n
|
|
481
|
-
} = visitNode(document.documentElement);
|
|
482
|
-
html = n;
|
|
483
|
-
} else {
|
|
484
|
-
html = ['html'];
|
|
485
|
-
}
|
|
486
|
-
const result = {
|
|
487
|
-
html,
|
|
488
|
-
doctype: document.doctype ? document.doctype.name : undefined,
|
|
489
|
-
resourceOverrides: [],
|
|
490
|
-
viewport: {
|
|
491
|
-
width: window.innerWidth,
|
|
492
|
-
height: window.innerHeight
|
|
493
|
-
},
|
|
494
|
-
url: location.href,
|
|
495
|
-
wallTime: Date.now(),
|
|
496
|
-
collectionTime: 0
|
|
497
|
-
};
|
|
498
|
-
for (const sheet of this._staleStyleSheets) {
|
|
499
|
-
if (sheet.href === null) continue;
|
|
500
|
-
const content = this._updateLinkStyleSheetTextIfNeeded(sheet, snapshotNumber);
|
|
501
|
-
if (content === undefined) {
|
|
502
|
-
// Unable to capture stylesheet contents.
|
|
503
|
-
continue;
|
|
504
|
-
}
|
|
505
|
-
const base = this._getSheetBase(sheet);
|
|
506
|
-
const url = removeHash(this._resolveUrl(base, sheet.href));
|
|
507
|
-
result.resourceOverrides.push({
|
|
508
|
-
url,
|
|
509
|
-
content,
|
|
510
|
-
contentType: 'text/css'
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
result.collectionTime = performance.now() - timestamp;
|
|
514
|
-
return result;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
window[snapshotStreamer] = new Streamer();
|
|
518
|
-
}
|