rebrowser-playwright-core 1.47.100 → 1.49.0
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/README.md +1 -1
- package/ThirdPartyNotices.txt +70 -384
- package/bin/reinstall_chrome_beta_linux.sh +10 -8
- package/bin/reinstall_chrome_stable_linux.sh +10 -8
- package/bin/reinstall_msedge_beta_linux.sh +11 -9
- package/bin/reinstall_msedge_dev_linux.sh +11 -9
- package/bin/reinstall_msedge_stable_linux.sh +11 -9
- package/browsers.json +24 -12
- package/lib/cli/program.js +49 -19
- package/lib/client/api.js +6 -0
- package/lib/client/browserContext.js +20 -2
- package/lib/client/channelOwner.js +6 -2
- package/lib/client/connection.js +3 -0
- package/lib/client/fetch.js +16 -21
- package/lib/client/jsHandle.js +0 -8
- package/lib/client/localUtils.js +1 -0
- package/lib/client/locator.js +7 -0
- package/lib/client/network.js +180 -17
- package/lib/client/page.js +25 -2
- package/lib/client/playwright.js +6 -3
- package/lib/client/tracing.js +29 -20
- package/lib/client/waiter.js +15 -11
- package/lib/generated/consoleApiSource.js +1 -1
- package/lib/generated/injectedScriptSource.js +1 -1
- package/lib/generated/pollingRecorderSource.js +7 -0
- package/lib/generated/webSocketMockSource.js +7 -0
- package/lib/protocol/validator.js +103 -17
- package/lib/server/ariaSnapshot.js +33 -0
- package/lib/server/bidi/bidiBrowser.js +23 -8
- package/lib/server/bidi/bidiChromium.js +124 -0
- package/lib/server/bidi/bidiConnection.js +1 -3
- package/lib/server/bidi/bidiExecutionContext.js +0 -6
- package/lib/server/bidi/bidiFirefox.js +15 -21
- package/lib/server/bidi/bidiInput.js +16 -32
- package/lib/server/bidi/bidiNetworkManager.js +39 -5
- package/lib/server/bidi/bidiOverCdp.js +103 -0
- package/lib/server/bidi/bidiPage.js +98 -25
- package/lib/server/bidi/bidiPdf.js +140 -0
- package/lib/server/bidi/third_party/firefoxPrefs.js +221 -0
- package/lib/server/browser.js +13 -2
- package/lib/server/browserContext.js +6 -23
- package/lib/server/browserType.js +43 -12
- package/lib/server/chromium/chromium.js +9 -17
- package/lib/server/chromium/chromiumSwitches.js +3 -1
- package/lib/server/chromium/crBrowser.js +4 -3
- package/lib/server/chromium/crConnection.js +153 -0
- package/lib/server/chromium/crExecutionContext.js +0 -20
- package/lib/server/chromium/crPage.js +13 -7
- package/lib/server/chromium/videoRecorder.js +1 -1
- package/lib/server/codegen/csharp.js +12 -17
- package/lib/server/codegen/java.js +5 -8
- package/lib/server/codegen/javascript.js +29 -7
- package/lib/server/codegen/language.js +14 -2
- package/lib/server/codegen/python.js +13 -17
- package/lib/server/cookieStore.js +73 -0
- package/lib/server/debugController.js +10 -7
- package/lib/server/deviceDescriptorsSource.json +127 -127
- package/lib/server/dialog.js +1 -0
- package/lib/server/dispatchers/androidDispatcher.js +13 -2
- package/lib/server/dispatchers/browserContextDispatcher.js +19 -2
- package/lib/server/dispatchers/debugControllerDispatcher.js +1 -1
- package/lib/server/dispatchers/dispatcher.js +1 -1
- package/lib/server/dispatchers/frameDispatcher.js +8 -1
- package/lib/server/dispatchers/jsHandleDispatcher.js +0 -5
- package/lib/server/dispatchers/pageDispatcher.js +9 -0
- package/lib/server/dispatchers/playwrightDispatcher.js +2 -1
- package/lib/server/dispatchers/tracingDispatcher.js +10 -0
- package/lib/server/dispatchers/webSocketRouteDispatcher.js +189 -0
- package/lib/server/dom.js +79 -36
- package/lib/server/download.js +9 -2
- package/lib/server/fetch.js +105 -96
- package/lib/server/firefox/ffBrowser.js +6 -4
- package/lib/server/firefox/ffExecutionContext.js +0 -15
- package/lib/server/firefox/ffNetworkManager.js +1 -1
- package/lib/server/firefox/ffPage.js +6 -3
- package/lib/server/firefox/firefox.js +2 -13
- package/lib/server/frameSelectors.js +1 -1
- package/lib/server/frames.js +68 -67
- package/lib/server/har/harTracer.js +11 -0
- package/lib/server/index.js +0 -6
- package/lib/server/input.js +0 -1
- package/lib/server/javascript.js +0 -13
- package/lib/server/page.js +53 -9
- package/lib/server/playwright.js +5 -2
- package/lib/server/progress.js +0 -3
- package/lib/server/recorder/contextRecorder.js +33 -50
- package/lib/server/recorder/recorderApp.js +22 -25
- package/lib/server/recorder/recorderCollection.js +68 -79
- package/lib/server/recorder/recorderInTraceViewer.js +144 -0
- package/lib/server/recorder/recorderRunner.js +75 -97
- package/lib/server/recorder/recorderUtils.js +48 -6
- package/lib/server/recorder.js +87 -47
- package/lib/server/registry/index.js +154 -26
- package/lib/server/registry/nativeDeps.js +6 -3
- package/lib/server/socksClientCertificatesInterceptor.js +15 -3
- package/lib/server/trace/recorder/snapshotter.js +2 -12
- package/lib/server/trace/recorder/snapshotterInjected.js +21 -3
- package/lib/server/trace/recorder/tracing.js +127 -17
- package/lib/server/trace/test/inMemorySnapshotter.js +4 -4
- package/lib/server/trace/viewer/traceViewer.js +4 -6
- package/lib/server/webkit/webkit.js +1 -1
- package/lib/server/webkit/wkBrowser.js +8 -7
- package/lib/server/webkit/wkExecutionContext.js +0 -16
- package/lib/server/webkit/wkPage.js +11 -4
- package/lib/utils/comparators.js +12 -30
- package/lib/utils/crypto.js +1 -4
- package/lib/utils/happy-eyeballs.js +13 -0
- package/lib/utils/hostPlatform.js +8 -2
- package/lib/utils/httpServer.js +1 -0
- package/lib/utils/isomorphic/ariaSnapshot.js +267 -0
- package/lib/utils/isomorphic/locatorGenerators.js +30 -21
- package/lib/utils/isomorphic/locatorParser.js +2 -2
- package/lib/utils/isomorphic/recorderUtils.js +227 -0
- package/lib/utils/isomorphic/stringUtils.js +30 -0
- package/lib/utils/isomorphic/urlMatch.js +5 -1
- package/lib/utils/network.js +1 -1
- package/lib/utils/sequence.js +64 -0
- package/lib/utils/stackTrace.js +16 -3
- package/lib/utils/zones.js +32 -23
- package/lib/utilsBundle.js +4 -5
- package/lib/utilsBundleImpl/index.js +190 -33
- package/lib/vite/htmlReport/index.html +19 -16
- package/lib/vite/recorder/assets/codeMirrorModule-AFvV6hAs.js +24 -0
- package/lib/vite/recorder/assets/index-_cTWgVuJ.js +184 -0
- package/lib/vite/recorder/assets/{index-B-MT5gKo.css → index-iA1aAGZg.css} +1 -1
- package/lib/vite/recorder/index.html +2 -2
- package/lib/vite/traceViewer/assets/codeMirrorModule-KatbITLF.js +24 -0
- package/lib/vite/traceViewer/assets/inspectorTab-DdpLd2bb.js +68 -0
- package/lib/vite/traceViewer/assets/workbench-CdYbzWFD.js +9 -0
- package/lib/vite/traceViewer/embedded.6m3UZh7r.js +2 -0
- package/lib/vite/traceViewer/embedded.html +5 -3
- package/lib/vite/traceViewer/index.WUV-8boJ.js +2 -0
- package/lib/vite/traceViewer/index.html +24 -5
- package/lib/vite/traceViewer/inspectorTab.DEOUW62d.css +1 -0
- package/lib/vite/traceViewer/recorder.B_SY1GJM.css +0 -0
- package/lib/vite/traceViewer/recorder.OT2tVHgn.js +2 -0
- package/lib/vite/traceViewer/recorder.html +17 -0
- package/lib/vite/traceViewer/sw.bundle.js +3 -3
- package/lib/vite/traceViewer/uiMode.BZBTyvGn.js +5 -0
- package/lib/vite/traceViewer/uiMode.html +6 -4
- package/lib/vite/traceViewer/{uiMode.D3cNFP6u.css → uiMode.voC1ZiOQ.css} +1 -1
- package/lib/vite/traceViewer/workbench.C-zR9ysA.css +1 -0
- package/package.json +1 -1
- package/types/protocol.d.ts +135 -16
- package/types/types.d.ts +2149 -965
- package/lib/generated/recorderSource.js +0 -7
- package/lib/third_party/diff_match_patch.js +0 -2222
- package/lib/vite/recorder/assets/codeMirrorModule-aW6Vz3gf.js +0 -24
- package/lib/vite/recorder/assets/index-DCpXOVIh.js +0 -47
- package/lib/vite/traceViewer/assets/codeMirrorModule-eFKCUIu2.js +0 -24
- package/lib/vite/traceViewer/assets/workbench-D0cirtfA.js +0 -72
- package/lib/vite/traceViewer/embedded.BkuvsLJp.js +0 -2
- package/lib/vite/traceViewer/index.C968kAiC.js +0 -2
- package/lib/vite/traceViewer/uiMode.BkFnr4V0.js +0 -10
- package/lib/vite/traceViewer/workbench.DjbIuxix.css +0 -1
- /package/lib/server/recorder/{recorderActions.js → recorderFrontend.js} +0 -0
|
@@ -129,8 +129,9 @@ const deps = exports.deps = {
|
|
|
129
129
|
tools: ['xvfb', 'fonts-noto-color-emoji', 'fonts-unifont', 'libfontconfig1', 'libfreetype6', 'xfonts-cyrillic', 'xfonts-scalable', 'fonts-liberation', 'fonts-ipafont-gothic', 'fonts-wqy-zenhei', 'fonts-tlwg-loma-otf', 'fonts-freefont-ttf'],
|
|
130
130
|
chromium: ['libasound2', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libatspi2.0-0', 'libcairo2', 'libcups2', 'libdbus-1-3', 'libdrm2', 'libgbm1', 'libglib2.0-0', 'libnspr4', 'libnss3', 'libpango-1.0-0', 'libwayland-client0', 'libx11-6', 'libxcb1', 'libxcomposite1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxkbcommon0', 'libxrandr2'],
|
|
131
131
|
firefox: ['ffmpeg', 'libasound2', 'libatk1.0-0', 'libcairo-gobject2', 'libcairo2', 'libdbus-1-3', 'libdbus-glib-1-2', 'libfontconfig1', 'libfreetype6', 'libgdk-pixbuf-2.0-0', 'libglib2.0-0', 'libgtk-3-0', 'libpango-1.0-0', 'libpangocairo-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb-shm0', 'libxcb1', 'libxcomposite1', 'libxcursor1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxi6', 'libxrandr2', 'libxrender1', 'libxtst6'],
|
|
132
|
-
webkit: ['libsoup-3.0-0', 'libenchant-2-2', 'gstreamer1.0-libav', 'gstreamer1.0-plugins-bad', 'gstreamer1.0-plugins-base', 'gstreamer1.0-plugins-good', 'libicu70', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libcairo2', 'libdbus-1-3', 'libdrm2', 'libegl1', 'libepoxy0', 'libevdev2', 'libffi7', 'libfontconfig1', 'libfreetype6', 'libgbm1', 'libgdk-pixbuf-2.0-0', 'libgles2', 'libglib2.0-0', 'libglx0', 'libgstreamer-gl1.0-0', 'libgstreamer-plugins-base1.0-0', 'libgstreamer1.0-0', 'libgtk-3-0', 'libgudev-1.0-0', 'libharfbuzz-icu0', 'libharfbuzz0b', 'libhyphen0', 'libjpeg-turbo8', 'liblcms2-2', 'libmanette-0.2-0', 'libnotify4', 'libopengl0', 'libopenjp2-7', 'libopus0', 'libpango-1.0-0', 'libpng16-16', 'libproxy1v5', 'libsecret-1-0', 'libwayland-client0', 'libwayland-egl1', 'libwayland-server0', 'libwebpdemux2', 'libwoff1', 'libx11-6', 'libxcomposite1', 'libxdamage1', 'libxkbcommon0', 'libxml2', 'libxslt1.1', 'libx264-163', 'libatomic1', 'libevent-2.1-7'],
|
|
132
|
+
webkit: ['libsoup-3.0-0', 'libenchant-2-2', 'gstreamer1.0-libav', 'gstreamer1.0-plugins-bad', 'gstreamer1.0-plugins-base', 'gstreamer1.0-plugins-good', 'libicu70', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libcairo2', 'libdbus-1-3', 'libdrm2', 'libegl1', 'libepoxy0', 'libevdev2', 'libffi7', 'libfontconfig1', 'libfreetype6', 'libgbm1', 'libgdk-pixbuf-2.0-0', 'libgles2', 'libglib2.0-0', 'libglx0', 'libgstreamer-gl1.0-0', 'libgstreamer-plugins-base1.0-0', 'libgstreamer1.0-0', 'libgtk-3-0', 'libgudev-1.0-0', 'libharfbuzz-icu0', 'libharfbuzz0b', 'libhyphen0', 'libjpeg-turbo8', 'liblcms2-2', 'libmanette-0.2-0', 'libnotify4', 'libopengl0', 'libopenjp2-7', 'libopus0', 'libpango-1.0-0', 'libpng16-16', 'libproxy1v5', 'libsecret-1-0', 'libwayland-client0', 'libwayland-egl1', 'libwayland-server0', 'libwebpdemux2', 'libwoff1', 'libx11-6', 'libxcomposite1', 'libxdamage1', 'libxkbcommon0', 'libxml2', 'libxslt1.1', 'libx264-163', 'libatomic1', 'libevent-2.1-7', 'libavif13'],
|
|
133
133
|
lib2package: {
|
|
134
|
+
'libavif.so.13': 'libavif13',
|
|
134
135
|
'libsoup-3.0.so.0': 'libsoup-3.0-0',
|
|
135
136
|
'libasound.so.2': 'libasound2',
|
|
136
137
|
'libatk-1.0.so.0': 'libatk1.0-0',
|
|
@@ -224,8 +225,9 @@ const deps = exports.deps = {
|
|
|
224
225
|
tools: ['xvfb', 'fonts-noto-color-emoji', 'fonts-unifont', 'libfontconfig1', 'libfreetype6', 'xfonts-cyrillic', 'xfonts-scalable', 'fonts-liberation', 'fonts-ipafont-gothic', 'fonts-wqy-zenhei', 'fonts-tlwg-loma-otf', 'fonts-freefont-ttf'],
|
|
225
226
|
chromium: ['libasound2t64', 'libatk-bridge2.0-0t64', 'libatk1.0-0t64', 'libatspi2.0-0t64', 'libcairo2', 'libcups2t64', 'libdbus-1-3', 'libdrm2', 'libgbm1', 'libglib2.0-0t64', 'libnspr4', 'libnss3', 'libpango-1.0-0', 'libx11-6', 'libxcb1', 'libxcomposite1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxkbcommon0', 'libxrandr2'],
|
|
226
227
|
firefox: ['libasound2t64', 'libatk1.0-0t64', 'libcairo-gobject2', 'libcairo2', 'libdbus-1-3', 'libfontconfig1', 'libfreetype6', 'libgdk-pixbuf-2.0-0', 'libglib2.0-0t64', 'libgtk-3-0t64', 'libpango-1.0-0', 'libpangocairo-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb-shm0', 'libxcb1', 'libxcomposite1', 'libxcursor1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxi6', 'libxrandr2', 'libxrender1'],
|
|
227
|
-
webkit: ['gstreamer1.0-libav', 'gstreamer1.0-plugins-bad', 'gstreamer1.0-plugins-base', 'gstreamer1.0-plugins-good', 'libicu74', 'libatomic1', 'libatk-bridge2.0-0t64', 'libatk1.0-0t64', 'libcairo-gobject2', 'libcairo2', 'libdbus-1-3', 'libdrm2', 'libenchant-2-2', 'libepoxy0', 'libevent-2.1-7t64', 'libflite1', 'libfontconfig1', 'libfreetype6', 'libgbm1', 'libgdk-pixbuf-2.0-0', 'libgles2', 'libglib2.0-0t64', 'libgstreamer-gl1.0-0', 'libgstreamer-plugins-bad1.0-0', 'libgstreamer-plugins-base1.0-0', 'libgstreamer1.0-0', 'libgtk-3-0t64', 'libharfbuzz-icu0', 'libharfbuzz0b', 'libhyphen0', 'libicu74', 'libjpeg-turbo8', 'liblcms2-2', 'libmanette-0.2-0', 'libopus0', 'libpango-1.0-0', 'libpangocairo-1.0-0', 'libpng16-16t64', 'libsecret-1-0', 'libvpx9', 'libwayland-client0', 'libwayland-egl1', 'libwayland-server0', 'libwebp7', 'libwebpdemux2', 'libwoff1', 'libx11-6', 'libxkbcommon0', 'libxml2', 'libxslt1.1', 'libx264-164'],
|
|
228
|
+
webkit: ['gstreamer1.0-libav', 'gstreamer1.0-plugins-bad', 'gstreamer1.0-plugins-base', 'gstreamer1.0-plugins-good', 'libicu74', 'libatomic1', 'libatk-bridge2.0-0t64', 'libatk1.0-0t64', 'libcairo-gobject2', 'libcairo2', 'libdbus-1-3', 'libdrm2', 'libenchant-2-2', 'libepoxy0', 'libevent-2.1-7t64', 'libflite1', 'libfontconfig1', 'libfreetype6', 'libgbm1', 'libgdk-pixbuf-2.0-0', 'libgles2', 'libglib2.0-0t64', 'libgstreamer-gl1.0-0', 'libgstreamer-plugins-bad1.0-0', 'libgstreamer-plugins-base1.0-0', 'libgstreamer1.0-0', 'libgtk-3-0t64', 'libharfbuzz-icu0', 'libharfbuzz0b', 'libhyphen0', 'libicu74', 'libjpeg-turbo8', 'liblcms2-2', 'libmanette-0.2-0', 'libopus0', 'libpango-1.0-0', 'libpangocairo-1.0-0', 'libpng16-16t64', 'libsecret-1-0', 'libvpx9', 'libwayland-client0', 'libwayland-egl1', 'libwayland-server0', 'libwebp7', 'libwebpdemux2', 'libwoff1', 'libx11-6', 'libxkbcommon0', 'libxml2', 'libxslt1.1', 'libx264-164', 'libavif16'],
|
|
228
229
|
lib2package: {
|
|
230
|
+
'libavif.so.16': 'libavif16',
|
|
229
231
|
'libasound.so.2': 'libasound2t64',
|
|
230
232
|
'libatk-1.0.so.0': 'libatk1.0-0t64',
|
|
231
233
|
'libatk-bridge-2.0.so.0': 'libatk-bridge2.0-0t64',
|
|
@@ -412,8 +414,9 @@ const deps = exports.deps = {
|
|
|
412
414
|
tools: ['xvfb', 'fonts-noto-color-emoji', 'fonts-unifont', 'libfontconfig1', 'libfreetype6', 'xfonts-scalable', 'fonts-liberation', 'fonts-ipafont-gothic', 'fonts-wqy-zenhei', 'fonts-tlwg-loma-otf', 'fonts-freefont-ttf'],
|
|
413
415
|
chromium: ['libasound2', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libatspi2.0-0', 'libcairo2', 'libcups2', 'libdbus-1-3', 'libdrm2', 'libgbm1', 'libglib2.0-0', 'libnspr4', 'libnss3', 'libpango-1.0-0', 'libx11-6', 'libxcb1', 'libxcomposite1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxkbcommon0', 'libxrandr2'],
|
|
414
416
|
firefox: ['libasound2', 'libatk1.0-0', 'libcairo-gobject2', 'libcairo2', 'libdbus-1-3', 'libdbus-glib-1-2', 'libfontconfig1', 'libfreetype6', 'libgdk-pixbuf-2.0-0', 'libglib2.0-0', 'libgtk-3-0', 'libharfbuzz0b', 'libpango-1.0-0', 'libpangocairo-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb-shm0', 'libxcb1', 'libxcomposite1', 'libxcursor1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxi6', 'libxrandr2', 'libxrender1', 'libxtst6'],
|
|
415
|
-
webkit: ['libsoup-3.0-0', 'gstreamer1.0-libav', 'gstreamer1.0-plugins-bad', 'gstreamer1.0-plugins-base', 'gstreamer1.0-plugins-good', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libcairo2', 'libdbus-1-3', 'libdrm2', 'libegl1', 'libenchant-2-2', 'libepoxy0', 'libevdev2', 'libfontconfig1', 'libfreetype6', 'libgbm1', 'libgdk-pixbuf-2.0-0', 'libgles2', 'libglib2.0-0', 'libglx0', 'libgstreamer-gl1.0-0', 'libgstreamer-plugins-base1.0-0', 'libgstreamer1.0-0', 'libgtk-3-0', 'libgudev-1.0-0', 'libharfbuzz-icu0', 'libharfbuzz0b', 'libhyphen0', 'libicu72', 'libjpeg62-turbo', 'liblcms2-2', 'libmanette-0.2-0', 'libnotify4', 'libopengl0', 'libopenjp2-7', 'libopus0', 'libpango-1.0-0', 'libpng16-16', 'libproxy1v5', 'libsecret-1-0', 'libwayland-client0', 'libwayland-egl1', 'libwayland-server0', 'libwebp7', 'libwebpdemux2', 'libwoff1', 'libx11-6', 'libxcomposite1', 'libxdamage1', 'libxkbcommon0', 'libxml2', 'libxslt1.1', 'libatomic1', 'libevent-2.1-7'],
|
|
417
|
+
webkit: ['libsoup-3.0-0', 'gstreamer1.0-libav', 'gstreamer1.0-plugins-bad', 'gstreamer1.0-plugins-base', 'gstreamer1.0-plugins-good', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libcairo2', 'libdbus-1-3', 'libdrm2', 'libegl1', 'libenchant-2-2', 'libepoxy0', 'libevdev2', 'libfontconfig1', 'libfreetype6', 'libgbm1', 'libgdk-pixbuf-2.0-0', 'libgles2', 'libglib2.0-0', 'libglx0', 'libgstreamer-gl1.0-0', 'libgstreamer-plugins-base1.0-0', 'libgstreamer1.0-0', 'libgtk-3-0', 'libgudev-1.0-0', 'libharfbuzz-icu0', 'libharfbuzz0b', 'libhyphen0', 'libicu72', 'libjpeg62-turbo', 'liblcms2-2', 'libmanette-0.2-0', 'libnotify4', 'libopengl0', 'libopenjp2-7', 'libopus0', 'libpango-1.0-0', 'libpng16-16', 'libproxy1v5', 'libsecret-1-0', 'libwayland-client0', 'libwayland-egl1', 'libwayland-server0', 'libwebp7', 'libwebpdemux2', 'libwoff1', 'libx11-6', 'libxcomposite1', 'libxdamage1', 'libxkbcommon0', 'libxml2', 'libxslt1.1', 'libatomic1', 'libevent-2.1-7', 'libavif15'],
|
|
416
418
|
lib2package: {
|
|
419
|
+
'libavif.so.15': 'libavif15',
|
|
417
420
|
'libsoup-3.0.so.0': 'libsoup-3.0-0',
|
|
418
421
|
'libasound.so.2': 'libasound2',
|
|
419
422
|
'libatk-1.0.so.0': 'libatk1.0-0',
|
|
@@ -14,6 +14,9 @@ var _happyEyeballs = require("../utils/happy-eyeballs");
|
|
|
14
14
|
var _utils = require("../utils");
|
|
15
15
|
var _socksProxy = require("../common/socksProxy");
|
|
16
16
|
var _debugLogger = require("../utils/debugLogger");
|
|
17
|
+
var _fetch = require("./fetch");
|
|
18
|
+
var _events = require("events");
|
|
19
|
+
var _browserContext = require("./browserContext");
|
|
17
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
21
|
/**
|
|
19
22
|
* Copyright (c) Microsoft Corporation.
|
|
@@ -104,7 +107,11 @@ class SocksProxyConnection {
|
|
|
104
107
|
};
|
|
105
108
|
}
|
|
106
109
|
async connect() {
|
|
107
|
-
this.target = await (
|
|
110
|
+
if (this.socksProxy.proxyAgentFromOptions) this.target = await this.socksProxy.proxyAgentFromOptions.connect(new _events.EventEmitter(), {
|
|
111
|
+
host: rewriteToLocalhostIfNeeded(this.host),
|
|
112
|
+
port: this.port,
|
|
113
|
+
secureEndpoint: false
|
|
114
|
+
});else this.target = await (0, _happyEyeballs.createSocket)(rewriteToLocalhostIfNeeded(this.host), this.port);
|
|
108
115
|
this.target.once('close', this._targetCloseEventListener);
|
|
109
116
|
this.target.once('error', error => this.socksProxy._socksProxy.sendSocketError({
|
|
110
117
|
uid: this.uid,
|
|
@@ -231,8 +238,11 @@ class ClientCertificatesProxy {
|
|
|
231
238
|
this.ignoreHTTPSErrors = void 0;
|
|
232
239
|
this.secureContextMap = new Map();
|
|
233
240
|
this.alpnCache = void 0;
|
|
241
|
+
this.proxyAgentFromOptions = void 0;
|
|
242
|
+
(0, _browserContext.verifyClientCertificates)(contextOptions.clientCertificates);
|
|
234
243
|
this.alpnCache = new ALPNCache();
|
|
235
244
|
this.ignoreHTTPSErrors = contextOptions.ignoreHTTPSErrors;
|
|
245
|
+
this.proxyAgentFromOptions = contextOptions.proxy ? (0, _fetch.createProxyAgent)(contextOptions.proxy) : undefined;
|
|
236
246
|
this._initSecureContexts(contextOptions.clientCertificates);
|
|
237
247
|
this._socksProxy = new _socksProxy.SocksProxy();
|
|
238
248
|
this._socksProxy.setPattern('*');
|
|
@@ -281,7 +291,9 @@ class ClientCertificatesProxy {
|
|
|
281
291
|
}
|
|
282
292
|
async listen() {
|
|
283
293
|
const port = await this._socksProxy.listen(0, '127.0.0.1');
|
|
284
|
-
return
|
|
294
|
+
return {
|
|
295
|
+
server: `socks5://127.0.0.1:${port}`
|
|
296
|
+
};
|
|
285
297
|
}
|
|
286
298
|
async close() {
|
|
287
299
|
await this._socksProxy.close();
|
|
@@ -323,6 +335,6 @@ function rewriteToLocalhostIfNeeded(host) {
|
|
|
323
335
|
return host === 'local.playwright' ? 'localhost' : host;
|
|
324
336
|
}
|
|
325
337
|
function rewriteOpenSSLErrorIfNeeded(error) {
|
|
326
|
-
if (error.message !== 'unsupported') return error;
|
|
338
|
+
if (error.message !== 'unsupported' && error.code !== 'ERR_CRYPTO_UNSUPPORTED_OPERATION') return error;
|
|
327
339
|
return (0, _utils.rewriteErrorMessage)(error, ['Unsupported TLS certificate.', 'Most likely, the security algorithm of the given certificate was deprecated by OpenSSL.', 'For more details, see https://github.com/openssl/openssl/blob/master/README-PROVIDERS.md#the-legacy-provider', 'You could probably modernize the certificate by following the steps at https://github.com/nodejs/node/issues/40672#issuecomment-1243648223'].join('\n'));
|
|
328
340
|
}
|
|
@@ -81,21 +81,10 @@ class Snapshotter {
|
|
|
81
81
|
dispose() {
|
|
82
82
|
_eventsHelper.eventsHelper.removeEventListeners(this._eventListeners);
|
|
83
83
|
}
|
|
84
|
-
async captureSnapshot(page, callId, snapshotName
|
|
84
|
+
async captureSnapshot(page, callId, snapshotName) {
|
|
85
85
|
// Prepare expression synchronously.
|
|
86
86
|
const expression = `window["${this._snapshotStreamer}"].captureSnapshot(${JSON.stringify(snapshotName)})`;
|
|
87
87
|
|
|
88
|
-
// In a best-effort manner, without waiting for it, mark target element.
|
|
89
|
-
element === null || element === void 0 || element.callFunctionNoReply((element, callId) => {
|
|
90
|
-
const customEvent = new CustomEvent('__playwright_target__', {
|
|
91
|
-
bubbles: true,
|
|
92
|
-
cancelable: true,
|
|
93
|
-
detail: callId,
|
|
94
|
-
composed: true
|
|
95
|
-
});
|
|
96
|
-
element.dispatchEvent(customEvent);
|
|
97
|
-
}, callId);
|
|
98
|
-
|
|
99
88
|
// In each frame, in a non-stalling manner, capture the snapshots.
|
|
100
89
|
const snapshots = page.frames().map(async frame => {
|
|
101
90
|
const data = await frame.nonStallingRawEvaluateInExistingMainContext(expression).catch(e => _debugLogger.debugLogger.log('error', e));
|
|
@@ -111,6 +100,7 @@ class Snapshotter {
|
|
|
111
100
|
html: data.html,
|
|
112
101
|
viewport: data.viewport,
|
|
113
102
|
timestamp: (0, _utils.monotonicTime)(),
|
|
103
|
+
wallTime: data.wallTime,
|
|
114
104
|
collectionTime: data.collectionTime,
|
|
115
105
|
resourceOverrides: [],
|
|
116
106
|
isMainFrame: page.mainFrame() === frame
|
|
@@ -35,6 +35,7 @@ function frameSnapshotStreamer(snapshotStreamer, removeNoScript) {
|
|
|
35
35
|
const kTargetAttribute = '__playwright_target__';
|
|
36
36
|
const kCustomElementsAttribute = '__playwright_custom_elements__';
|
|
37
37
|
const kCurrentSrcAttribute = '__playwright_current_src__';
|
|
38
|
+
const kBoundingRectAttribute = '__playwright_bounding_rect__';
|
|
38
39
|
|
|
39
40
|
// Symbols for our own info on Nodes/StyleSheets.
|
|
40
41
|
const kSnapshotFrameId = Symbol('__playwright_snapshot_frameid_');
|
|
@@ -112,11 +113,16 @@ function frameSnapshotStreamer(snapshotStreamer, removeNoScript) {
|
|
|
112
113
|
});
|
|
113
114
|
}
|
|
114
115
|
_refreshListeners() {
|
|
115
|
-
document.addEventListener('
|
|
116
|
+
document.addEventListener('__playwright_mark_target__', event => {
|
|
116
117
|
if (!event.detail) return;
|
|
117
118
|
const callId = event.detail;
|
|
118
119
|
event.composedPath()[0].__playwright_target__ = callId;
|
|
119
120
|
});
|
|
121
|
+
document.addEventListener('__playwright_unmark_target__', event => {
|
|
122
|
+
if (!event.detail) return;
|
|
123
|
+
const callId = event.detail;
|
|
124
|
+
if (event.composedPath()[0].__playwright_target__ === callId) delete event.composedPath()[0].__playwright_target__;
|
|
125
|
+
});
|
|
120
126
|
}
|
|
121
127
|
_interceptNativeMethod(obj, method, cb) {
|
|
122
128
|
const native = obj[method];
|
|
@@ -348,6 +354,18 @@ function frameSnapshotStreamer(snapshotStreamer, removeNoScript) {
|
|
|
348
354
|
expectValue(value);
|
|
349
355
|
attrs[kSelectedAttribute] = value;
|
|
350
356
|
}
|
|
357
|
+
if (nodeName === 'CANVAS') {
|
|
358
|
+
const boundingRect = element.getBoundingClientRect();
|
|
359
|
+
const value = JSON.stringify({
|
|
360
|
+
left: boundingRect.left / window.innerWidth,
|
|
361
|
+
top: boundingRect.top / window.innerHeight,
|
|
362
|
+
right: boundingRect.right / window.innerWidth,
|
|
363
|
+
bottom: boundingRect.bottom / window.innerHeight
|
|
364
|
+
});
|
|
365
|
+
expectValue(kBoundingRectAttribute);
|
|
366
|
+
expectValue(value);
|
|
367
|
+
attrs[kBoundingRectAttribute] = value;
|
|
368
|
+
}
|
|
351
369
|
if (element.scrollTop) {
|
|
352
370
|
expectValue(kScrollTopAttribute);
|
|
353
371
|
expectValue(element.scrollTop);
|
|
@@ -467,7 +485,7 @@ function frameSnapshotStreamer(snapshotStreamer, removeNoScript) {
|
|
|
467
485
|
height: window.innerHeight
|
|
468
486
|
},
|
|
469
487
|
url: location.href,
|
|
470
|
-
|
|
488
|
+
wallTime: Date.now(),
|
|
471
489
|
collectionTime: 0
|
|
472
490
|
};
|
|
473
491
|
for (const sheet of this._staleStyleSheets) {
|
|
@@ -485,7 +503,7 @@ function frameSnapshotStreamer(snapshotStreamer, removeNoScript) {
|
|
|
485
503
|
contentType: 'text/css'
|
|
486
504
|
});
|
|
487
505
|
}
|
|
488
|
-
result.collectionTime = performance.now() -
|
|
506
|
+
result.collectionTime = performance.now() - timestamp;
|
|
489
507
|
return result;
|
|
490
508
|
}
|
|
491
509
|
}
|
|
@@ -120,7 +120,8 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
120
120
|
traceSha1s: new Set(),
|
|
121
121
|
networkSha1s: new Set(),
|
|
122
122
|
recording: false,
|
|
123
|
-
callIds: new Set()
|
|
123
|
+
callIds: new Set(),
|
|
124
|
+
groupStack: []
|
|
124
125
|
};
|
|
125
126
|
this._fs.mkdir(this._state.resourcesDir);
|
|
126
127
|
this._fs.writeFile(this._state.networkFile, '');
|
|
@@ -146,7 +147,7 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
146
147
|
wallTime: Date.now(),
|
|
147
148
|
monotonicTime: (0, _utils.monotonicTime)()
|
|
148
149
|
};
|
|
149
|
-
this.
|
|
150
|
+
this._appendTraceEvent(event);
|
|
150
151
|
this._context.instrumentation.addListener(this, this._context);
|
|
151
152
|
this._eventListeners.push(_utils.eventsHelper.addEventListener(this._context, _browserContext.BrowserContext.Events.Console, this._onConsoleMessage.bind(this)), _utils.eventsHelper.addEventListener(this._context, _browserContext.BrowserContext.Events.PageError, this._onPageError.bind(this)));
|
|
152
153
|
if (this._state.options.screenshots) this._startScreencast();
|
|
@@ -155,6 +156,52 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
155
156
|
traceName: this._state.traceName
|
|
156
157
|
};
|
|
157
158
|
}
|
|
159
|
+
_currentGroupId() {
|
|
160
|
+
var _this$_state;
|
|
161
|
+
return (_this$_state = this._state) !== null && _this$_state !== void 0 && _this$_state.groupStack.length ? this._state.groupStack[this._state.groupStack.length - 1] : undefined;
|
|
162
|
+
}
|
|
163
|
+
async group(name, location, metadata) {
|
|
164
|
+
var _ref;
|
|
165
|
+
if (!this._state) return;
|
|
166
|
+
const stackFrames = [];
|
|
167
|
+
const {
|
|
168
|
+
file,
|
|
169
|
+
line,
|
|
170
|
+
column
|
|
171
|
+
} = (_ref = location !== null && location !== void 0 ? location : metadata.location) !== null && _ref !== void 0 ? _ref : {};
|
|
172
|
+
if (file) {
|
|
173
|
+
stackFrames.push({
|
|
174
|
+
file,
|
|
175
|
+
line: line !== null && line !== void 0 ? line : 0,
|
|
176
|
+
column: column !== null && column !== void 0 ? column : 0
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
const event = {
|
|
180
|
+
type: 'before',
|
|
181
|
+
callId: metadata.id,
|
|
182
|
+
startTime: metadata.startTime,
|
|
183
|
+
apiName: name,
|
|
184
|
+
class: 'Tracing',
|
|
185
|
+
method: 'tracingGroup',
|
|
186
|
+
params: {},
|
|
187
|
+
stepId: metadata.stepId,
|
|
188
|
+
stack: stackFrames
|
|
189
|
+
};
|
|
190
|
+
if (this._currentGroupId()) event.parentId = this._currentGroupId();
|
|
191
|
+
this._state.groupStack.push(event.callId);
|
|
192
|
+
this._appendTraceEvent(event);
|
|
193
|
+
}
|
|
194
|
+
groupEnd() {
|
|
195
|
+
if (!this._state) return;
|
|
196
|
+
const callId = this._state.groupStack.pop();
|
|
197
|
+
if (!callId) return;
|
|
198
|
+
const event = {
|
|
199
|
+
type: 'after',
|
|
200
|
+
callId,
|
|
201
|
+
endTime: (0, _utils.monotonicTime)()
|
|
202
|
+
};
|
|
203
|
+
this._appendTraceEvent(event);
|
|
204
|
+
}
|
|
158
205
|
_startScreencast() {
|
|
159
206
|
if (!(this._context instanceof _browserContext.BrowserContext)) return;
|
|
160
207
|
for (const page of this._context.pages()) this._startScreencastInPage(page);
|
|
@@ -184,6 +231,7 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
184
231
|
if (!this._state) return;
|
|
185
232
|
if (this._isStopping) throw new Error(`Tracing is already stopping`);
|
|
186
233
|
if (this._state.recording) throw new Error(`Must stop trace file before stopping tracing`);
|
|
234
|
+
this._closeAllGroups();
|
|
187
235
|
this._harTracer.stop();
|
|
188
236
|
this.flushHarEntries();
|
|
189
237
|
await this._fs.syncAndGetError();
|
|
@@ -206,6 +254,9 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
206
254
|
this.abort();
|
|
207
255
|
await this._fs.syncAndGetError();
|
|
208
256
|
}
|
|
257
|
+
_closeAllGroups() {
|
|
258
|
+
while (this._currentGroupId()) this.groupEnd();
|
|
259
|
+
}
|
|
209
260
|
async stopChunk(params) {
|
|
210
261
|
var _this$_snapshotter4;
|
|
211
262
|
if (this._isStopping) throw new Error(`Tracing is already stopping`);
|
|
@@ -215,6 +266,7 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
215
266
|
if (params.mode !== 'discard') throw new Error(`Must start tracing before stopping`);
|
|
216
267
|
return {};
|
|
217
268
|
}
|
|
269
|
+
this._closeAllGroups();
|
|
218
270
|
this._context.instrumentation.removeListener(this);
|
|
219
271
|
_utils.eventsHelper.removeEventListeners(this._eventListeners);
|
|
220
272
|
if (this._state.options.screenshots) this._stopScreencast();
|
|
@@ -275,34 +327,34 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
275
327
|
artifact
|
|
276
328
|
};
|
|
277
329
|
}
|
|
278
|
-
async _captureSnapshot(snapshotName, sdkObject, metadata
|
|
330
|
+
async _captureSnapshot(snapshotName, sdkObject, metadata) {
|
|
279
331
|
if (!this._snapshotter) return;
|
|
280
332
|
if (!sdkObject.attribution.page) return;
|
|
281
333
|
if (!this._snapshotter.started()) return;
|
|
282
334
|
if (!shouldCaptureSnapshot(metadata)) return;
|
|
283
|
-
await this._snapshotter.captureSnapshot(sdkObject.attribution.page, metadata.id, snapshotName
|
|
335
|
+
await this._snapshotter.captureSnapshot(sdkObject.attribution.page, metadata.id, snapshotName).catch(() => {});
|
|
284
336
|
}
|
|
285
337
|
onBeforeCall(sdkObject, metadata) {
|
|
286
|
-
var _sdkObject$attributio, _this$
|
|
338
|
+
var _sdkObject$attributio, _this$_state2;
|
|
287
339
|
// IMPORTANT: no awaits before this._appendTraceEvent in this method.
|
|
288
|
-
const event = createBeforeActionTraceEvent(metadata);
|
|
340
|
+
const event = createBeforeActionTraceEvent(metadata, this._currentGroupId());
|
|
289
341
|
if (!event) return Promise.resolve();
|
|
290
342
|
(_sdkObject$attributio = sdkObject.attribution.page) === null || _sdkObject$attributio === void 0 || _sdkObject$attributio.temporarilyDisableTracingScreencastThrottling();
|
|
291
343
|
event.beforeSnapshot = `before@${metadata.id}`;
|
|
292
|
-
(_this$
|
|
344
|
+
(_this$_state2 = this._state) === null || _this$_state2 === void 0 || _this$_state2.callIds.add(metadata.id);
|
|
293
345
|
this._appendTraceEvent(event);
|
|
294
346
|
return this._captureSnapshot(event.beforeSnapshot, sdkObject, metadata);
|
|
295
347
|
}
|
|
296
|
-
onBeforeInputAction(sdkObject, metadata
|
|
297
|
-
var _this$
|
|
298
|
-
if (!((_this$
|
|
348
|
+
onBeforeInputAction(sdkObject, metadata) {
|
|
349
|
+
var _this$_state3, _sdkObject$attributio2;
|
|
350
|
+
if (!((_this$_state3 = this._state) !== null && _this$_state3 !== void 0 && _this$_state3.callIds.has(metadata.id))) return Promise.resolve();
|
|
299
351
|
// IMPORTANT: no awaits before this._appendTraceEvent in this method.
|
|
300
352
|
const event = createInputActionTraceEvent(metadata);
|
|
301
353
|
if (!event) return Promise.resolve();
|
|
302
354
|
(_sdkObject$attributio2 = sdkObject.attribution.page) === null || _sdkObject$attributio2 === void 0 || _sdkObject$attributio2.temporarilyDisableTracingScreencastThrottling();
|
|
303
355
|
event.inputSnapshot = `input@${metadata.id}`;
|
|
304
356
|
this._appendTraceEvent(event);
|
|
305
|
-
return this._captureSnapshot(event.inputSnapshot, sdkObject, metadata
|
|
357
|
+
return this._captureSnapshot(event.inputSnapshot, sdkObject, metadata);
|
|
306
358
|
}
|
|
307
359
|
onCallLog(sdkObject, metadata, logName, message) {
|
|
308
360
|
if (metadata.isServerSide || metadata.internal) return;
|
|
@@ -311,9 +363,9 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
311
363
|
if (event) this._appendTraceEvent(event);
|
|
312
364
|
}
|
|
313
365
|
async onAfterCall(sdkObject, metadata) {
|
|
314
|
-
var _this$
|
|
315
|
-
if (!((_this$
|
|
316
|
-
(_this$
|
|
366
|
+
var _this$_state4, _this$_state5, _sdkObject$attributio3;
|
|
367
|
+
if (!((_this$_state4 = this._state) !== null && _this$_state4 !== void 0 && _this$_state4.callIds.has(metadata.id))) return;
|
|
368
|
+
(_this$_state5 = this._state) === null || _this$_state5 === void 0 || _this$_state5.callIds.delete(metadata.id);
|
|
317
369
|
const event = createAfterActionTraceEvent(metadata);
|
|
318
370
|
if (!event) return;
|
|
319
371
|
(_sdkObject$attributio3 = sdkObject.attribution.page) === null || _sdkObject$attributio3 === void 0 || _sdkObject$attributio3.temporarilyDisableTracingScreencastThrottling();
|
|
@@ -374,6 +426,61 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
374
426
|
};
|
|
375
427
|
this._appendTraceEvent(event);
|
|
376
428
|
}
|
|
429
|
+
onDialog(dialog) {
|
|
430
|
+
const event = {
|
|
431
|
+
type: 'event',
|
|
432
|
+
time: (0, _utils.monotonicTime)(),
|
|
433
|
+
class: 'BrowserContext',
|
|
434
|
+
method: 'dialog',
|
|
435
|
+
params: {
|
|
436
|
+
pageId: dialog.page().guid,
|
|
437
|
+
type: dialog.type(),
|
|
438
|
+
message: dialog.message(),
|
|
439
|
+
defaultValue: dialog.defaultValue()
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
this._appendTraceEvent(event);
|
|
443
|
+
}
|
|
444
|
+
onDownload(page, download) {
|
|
445
|
+
const event = {
|
|
446
|
+
type: 'event',
|
|
447
|
+
time: (0, _utils.monotonicTime)(),
|
|
448
|
+
class: 'BrowserContext',
|
|
449
|
+
method: 'download',
|
|
450
|
+
params: {
|
|
451
|
+
pageId: page.guid,
|
|
452
|
+
url: download.url,
|
|
453
|
+
suggestedFilename: download.suggestedFilename()
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
this._appendTraceEvent(event);
|
|
457
|
+
}
|
|
458
|
+
onPageOpen(page) {
|
|
459
|
+
var _page$opener;
|
|
460
|
+
const event = {
|
|
461
|
+
type: 'event',
|
|
462
|
+
time: (0, _utils.monotonicTime)(),
|
|
463
|
+
class: 'BrowserContext',
|
|
464
|
+
method: 'page',
|
|
465
|
+
params: {
|
|
466
|
+
pageId: page.guid,
|
|
467
|
+
openerPageId: (_page$opener = page.opener()) === null || _page$opener === void 0 ? void 0 : _page$opener.guid
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
this._appendTraceEvent(event);
|
|
471
|
+
}
|
|
472
|
+
onPageClose(page) {
|
|
473
|
+
const event = {
|
|
474
|
+
type: 'event',
|
|
475
|
+
time: (0, _utils.monotonicTime)(),
|
|
476
|
+
class: 'BrowserContext',
|
|
477
|
+
method: 'pageClosed',
|
|
478
|
+
params: {
|
|
479
|
+
pageId: page.guid
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
this._appendTraceEvent(event);
|
|
483
|
+
}
|
|
377
484
|
_onPageError(error, page) {
|
|
378
485
|
const event = {
|
|
379
486
|
type: 'event',
|
|
@@ -399,7 +506,8 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
399
506
|
sha1,
|
|
400
507
|
width: params.width,
|
|
401
508
|
height: params.height,
|
|
402
|
-
timestamp: (0, _utils.monotonicTime)()
|
|
509
|
+
timestamp: (0, _utils.monotonicTime)(),
|
|
510
|
+
frameSwapWallTime: params.frameSwapWallTime
|
|
403
511
|
};
|
|
404
512
|
// Make sure to write the screencast frame before adding a reference to it.
|
|
405
513
|
this._appendResource(sha1, params.buffer);
|
|
@@ -441,9 +549,9 @@ function visitTraceEvent(object, sha1s) {
|
|
|
441
549
|
function shouldCaptureSnapshot(metadata) {
|
|
442
550
|
return _debug.commandsWithTracingSnapshots.has(metadata.type + '.' + metadata.method);
|
|
443
551
|
}
|
|
444
|
-
function createBeforeActionTraceEvent(metadata) {
|
|
552
|
+
function createBeforeActionTraceEvent(metadata, parentId) {
|
|
445
553
|
if (metadata.internal || metadata.method.startsWith('tracing')) return null;
|
|
446
|
-
|
|
554
|
+
const event = {
|
|
447
555
|
type: 'before',
|
|
448
556
|
callId: metadata.id,
|
|
449
557
|
startTime: metadata.startTime,
|
|
@@ -454,6 +562,8 @@ function createBeforeActionTraceEvent(metadata) {
|
|
|
454
562
|
stepId: metadata.stepId,
|
|
455
563
|
pageId: metadata.pageId
|
|
456
564
|
};
|
|
565
|
+
if (parentId) event.parentId = parentId;
|
|
566
|
+
return event;
|
|
457
567
|
}
|
|
458
568
|
function createInputActionTraceEvent(metadata) {
|
|
459
569
|
if (metadata.internal || metadata.method.startsWith('tracing')) return null;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.InMemorySnapshotter = void 0;
|
|
7
|
-
var _snapshotStorage = require("../../../../../trace-viewer/src/snapshotStorage");
|
|
7
|
+
var _snapshotStorage = require("../../../../../trace-viewer/src/sw/snapshotStorage");
|
|
8
8
|
var _snapshotter = require("../recorder/snapshotter");
|
|
9
9
|
var _harTracer = require("../../har/harTracer");
|
|
10
10
|
var _utils = require("../../../utils");
|
|
@@ -60,9 +60,9 @@ class InMemorySnapshotter {
|
|
|
60
60
|
await this._harTracer.flush();
|
|
61
61
|
this._harTracer.stop();
|
|
62
62
|
}
|
|
63
|
-
async captureSnapshot(page, callId, snapshotName
|
|
63
|
+
async captureSnapshot(page, callId, snapshotName) {
|
|
64
64
|
if (this._snapshotReadyPromises.has(snapshotName)) throw new Error('Duplicate snapshot name: ' + snapshotName);
|
|
65
|
-
this._snapshotter.captureSnapshot(page, callId, snapshotName
|
|
65
|
+
this._snapshotter.captureSnapshot(page, callId, snapshotName).catch(() => {});
|
|
66
66
|
const promise = new _utils.ManualPromise();
|
|
67
67
|
this._snapshotReadyPromises.set(snapshotName, promise);
|
|
68
68
|
return promise;
|
|
@@ -80,7 +80,7 @@ class InMemorySnapshotter {
|
|
|
80
80
|
onFrameSnapshot(snapshot) {
|
|
81
81
|
var _this$_snapshotReadyP;
|
|
82
82
|
++this._snapshotCount;
|
|
83
|
-
const renderer = this._storage.addFrameSnapshot(snapshot);
|
|
83
|
+
const renderer = this._storage.addFrameSnapshot(snapshot, []);
|
|
84
84
|
(_this$_snapshotReadyP = this._snapshotReadyPromises.get(snapshot.snapshotName || '')) === null || _this$_snapshotReadyP === void 0 || _this$_snapshotReadyP.resolve(renderer);
|
|
85
85
|
}
|
|
86
86
|
async resourceContentForTest(sha1) {
|
|
@@ -84,6 +84,7 @@ async function startTraceViewerServer(options) {
|
|
|
84
84
|
}
|
|
85
85
|
async function installRootRedirect(server, traceUrls, options) {
|
|
86
86
|
const params = new URLSearchParams();
|
|
87
|
+
if (_path.default.sep !== _path.default.posix.sep) params.set('pathSeparator', _path.default.sep);
|
|
87
88
|
for (const traceUrl of traceUrls) params.append('trace', traceUrl);
|
|
88
89
|
if (server.wsGuid()) params.append('ws', server.wsGuid());
|
|
89
90
|
if (options !== null && options !== void 0 && options.isServer) params.append('isServer', '');
|
|
@@ -92,11 +93,6 @@ async function installRootRedirect(server, traceUrls, options) {
|
|
|
92
93
|
if (options.grep) params.append('grep', options.grep);
|
|
93
94
|
if (options.grepInvert) params.append('grepInvert', options.grepInvert);
|
|
94
95
|
for (const project of options.project || []) params.append('project', project);
|
|
95
|
-
if (options.workers) params.append('workers', String(options.workers));
|
|
96
|
-
if (options.timeout) params.append('timeout', String(options.timeout));
|
|
97
|
-
if (options.headed) params.append('headed', '');
|
|
98
|
-
if (options.outputDir) params.append('outputDir', options.outputDir);
|
|
99
|
-
if (options.updateSnapshots) params.append('updateSnapshots', options.updateSnapshots);
|
|
100
96
|
for (const reporter of options.reporter || []) params.append('reporter', reporter);
|
|
101
97
|
const urlPath = `./trace/${options.webApp || 'index.html'}?${params.toString()}`;
|
|
102
98
|
server.routePath('/', (_, response) => {
|
|
@@ -139,7 +135,8 @@ async function openTraceViewerApp(url, browserName, options) {
|
|
|
139
135
|
persistentContextOptions: {
|
|
140
136
|
...(options === null || options === void 0 ? void 0 : options.persistentContextOptions),
|
|
141
137
|
useWebSocket: (0, _utils.isUnderTest)(),
|
|
142
|
-
headless: !!(options !== null && options !== void 0 && options.headless)
|
|
138
|
+
headless: !!(options !== null && options !== void 0 && options.headless),
|
|
139
|
+
colorScheme: (0, _utils.isUnderTest)() ? 'light' : undefined
|
|
143
140
|
}
|
|
144
141
|
});
|
|
145
142
|
const controller = new _progress.ProgressController((0, _instrumentation.serverSideCallMetadata)(), context._browser);
|
|
@@ -172,6 +169,7 @@ class StdinServer {
|
|
|
172
169
|
});
|
|
173
170
|
process.stdin.on('close', () => (0, _utils.gracefullyProcessExitDoNotHang)(0));
|
|
174
171
|
}
|
|
172
|
+
onconnect() {}
|
|
175
173
|
async dispatch(method, params) {
|
|
176
174
|
if (method === 'initialize') {
|
|
177
175
|
if (this._traceUrl) this._loadTrace(this._traceUrl);
|
|
@@ -55,7 +55,6 @@ class WebKit extends _browserType.BrowserType {
|
|
|
55
55
|
defaultArgs(options, isPersistent, userDataDir) {
|
|
56
56
|
const {
|
|
57
57
|
args = [],
|
|
58
|
-
proxy,
|
|
59
58
|
headless
|
|
60
59
|
} = options;
|
|
61
60
|
const userDataDirArg = args.find(arg => arg.startsWith('--user-data-dir'));
|
|
@@ -65,6 +64,7 @@ class WebKit extends _browserType.BrowserType {
|
|
|
65
64
|
if (process.platform === 'win32') webkitArguments.push('--disable-accelerated-compositing');
|
|
66
65
|
if (headless) webkitArguments.push('--headless');
|
|
67
66
|
if (isPersistent) webkitArguments.push(`--user-data-dir=${userDataDir}`);else webkitArguments.push(`--no-startup-window`);
|
|
67
|
+
const proxy = options.proxyOverride || options.proxy;
|
|
68
68
|
if (proxy) {
|
|
69
69
|
if (process.platform === 'darwin') {
|
|
70
70
|
webkitArguments.push(`--proxy=${proxy.server}`);
|
|
@@ -30,8 +30,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
30
30
|
* limitations under the License.
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
-
const DEFAULT_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.
|
|
34
|
-
const BROWSER_VERSION = '18.
|
|
33
|
+
const DEFAULT_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15';
|
|
34
|
+
const BROWSER_VERSION = '18.2';
|
|
35
35
|
class WKBrowser extends _browser.Browser {
|
|
36
36
|
static async connect(parent, transport, options) {
|
|
37
37
|
const browser = new WKBrowser(parent, transport, options);
|
|
@@ -72,11 +72,12 @@ class WKBrowser extends _browser.Browser {
|
|
|
72
72
|
this._didClose();
|
|
73
73
|
}
|
|
74
74
|
async doCreateNewContext(options) {
|
|
75
|
-
const
|
|
76
|
-
|
|
75
|
+
const proxy = options.proxyOverride || options.proxy;
|
|
76
|
+
const createOptions = proxy ? {
|
|
77
|
+
// Enable socks5 hostname resolution on Windows.
|
|
77
78
|
// See https://github.com/microsoft/playwright/issues/20451
|
|
78
|
-
proxyServer: process.platform === 'win32' ?
|
|
79
|
-
proxyBypassList:
|
|
79
|
+
proxyServer: process.platform === 'win32' ? proxy.server.replace(/^socks5:\/\//, 'socks5h://') : proxy.server,
|
|
80
|
+
proxyBypassList: proxy.bypass
|
|
80
81
|
} : undefined;
|
|
81
82
|
const {
|
|
82
83
|
browserContextId
|
|
@@ -192,7 +193,7 @@ class WKBrowserContext extends _browserContext.BrowserContext {
|
|
|
192
193
|
downloadPath: this._browser.options.downloadsPath,
|
|
193
194
|
browserContextId
|
|
194
195
|
}));
|
|
195
|
-
if (this._options.ignoreHTTPSErrors) promises.push(this._browser._browserSession.send('Playwright.setIgnoreCertificateErrors', {
|
|
196
|
+
if (this._options.ignoreHTTPSErrors || this._options.internalIgnoreHTTPSErrors) promises.push(this._browser._browserSession.send('Playwright.setIgnoreCertificateErrors', {
|
|
196
197
|
browserContextId,
|
|
197
198
|
ignore: true
|
|
198
199
|
}));
|
|
@@ -59,19 +59,6 @@ class WKExecutionContext {
|
|
|
59
59
|
throw rewriteError(error);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
rawCallFunctionNoReply(func, ...args) {
|
|
63
|
-
this._session.send('Runtime.callFunctionOn', {
|
|
64
|
-
functionDeclaration: func.toString(),
|
|
65
|
-
objectId: args.find(a => a instanceof js.JSHandle)._objectId,
|
|
66
|
-
arguments: args.map(a => a instanceof js.JSHandle ? {
|
|
67
|
-
objectId: a._objectId
|
|
68
|
-
} : {
|
|
69
|
-
value: a
|
|
70
|
-
}),
|
|
71
|
-
returnByValue: true,
|
|
72
|
-
emulateUserGesture: true
|
|
73
|
-
}).catch(() => {});
|
|
74
|
-
}
|
|
75
62
|
async evaluateWithArguments(expression, returnByValue, utilityScript, values, objectIds) {
|
|
76
63
|
try {
|
|
77
64
|
const response = await this._session.send('Runtime.callFunctionOn', {
|
|
@@ -116,9 +103,6 @@ class WKExecutionContext {
|
|
|
116
103
|
objectId
|
|
117
104
|
});
|
|
118
105
|
}
|
|
119
|
-
objectCount(objectId) {
|
|
120
|
-
throw new Error('Method not implemented in WebKit.');
|
|
121
|
-
}
|
|
122
106
|
}
|
|
123
107
|
exports.WKExecutionContext = WKExecutionContext;
|
|
124
108
|
function potentiallyUnserializableValue(remoteObject) {
|
|
@@ -247,6 +247,10 @@ class WKPage {
|
|
|
247
247
|
setting: 'InputTypeWeekEnabled',
|
|
248
248
|
value: contextOptions.isMobile
|
|
249
249
|
}));
|
|
250
|
+
promises.push(session.send('Page.overrideSetting', {
|
|
251
|
+
setting: 'FixedBackgroundsPaintRelativeToDocument',
|
|
252
|
+
value: contextOptions.isMobile
|
|
253
|
+
}));
|
|
250
254
|
await Promise.all(promises);
|
|
251
255
|
}
|
|
252
256
|
_onDidCommitProvisionalTarget(event) {
|
|
@@ -461,11 +465,11 @@ class WKPage {
|
|
|
461
465
|
const frame = this._page._frameManager.frame(contextPayload.frameId);
|
|
462
466
|
if (!frame) return;
|
|
463
467
|
const delegate = new _wkExecutionContext.WKExecutionContext(this._session, contextPayload.id);
|
|
464
|
-
let worldName;
|
|
465
|
-
if (contextPayload.type === 'normal') worldName = 'main';else if (contextPayload.type === 'user' && contextPayload.name === UTILITY_WORLD_NAME) worldName = 'utility';
|
|
468
|
+
let worldName = null;
|
|
469
|
+
if (contextPayload.type === 'normal') worldName = 'main';else if (contextPayload.type === 'user' && contextPayload.name === UTILITY_WORLD_NAME) worldName = 'utility';
|
|
466
470
|
const context = new dom.FrameExecutionContext(delegate, frame, worldName);
|
|
467
471
|
context[contextDelegateSymbol] = delegate;
|
|
468
|
-
frame._contextCreated(worldName, context);
|
|
472
|
+
if (worldName) frame._contextCreated(worldName, context);
|
|
469
473
|
this._contextIdToContext.set(contextPayload.id, context);
|
|
470
474
|
}
|
|
471
475
|
async _onBindingCalled(contextId, argument) {
|
|
@@ -746,6 +750,9 @@ class WKPage {
|
|
|
746
750
|
throw error;
|
|
747
751
|
});
|
|
748
752
|
}
|
|
753
|
+
async requestGC() {
|
|
754
|
+
await this._session.send('Heap.gc');
|
|
755
|
+
}
|
|
749
756
|
async addInitScript(initScript) {
|
|
750
757
|
await this._updateBootstrapScript();
|
|
751
758
|
}
|
|
@@ -1070,7 +1077,7 @@ class WKPage {
|
|
|
1070
1077
|
this._requestIdToResponseReceivedPayloadEvent.set(event.requestId, event);
|
|
1071
1078
|
const response = request.createResponse(event.response);
|
|
1072
1079
|
this._page._frameManager.requestReceivedResponse(response);
|
|
1073
|
-
if (response.status() === 204) {
|
|
1080
|
+
if (response.status() === 204 && request.request.isNavigationRequest()) {
|
|
1074
1081
|
this._onLoadingFailed(session, {
|
|
1075
1082
|
requestId: event.requestId,
|
|
1076
1083
|
errorText: 'Aborted: 204 No Content',
|