@checkly/playwright-core 1.41.2-beta.6 → 1.41.23
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/lib/browserServerImpl.js +1 -1
- package/lib/cli/driver.js +11 -3
- package/lib/cli/program.js +13 -5
- package/lib/client/android.js +1 -1
- package/lib/client/artifact.js +2 -2
- package/lib/client/browserContext.js +5 -5
- package/lib/client/browserType.js +1 -1
- package/lib/client/channelOwner.js +3 -3
- package/lib/client/clientHelper.js +5 -1
- package/lib/client/connection.js +2 -2
- package/lib/client/consoleMessage.js +3 -3
- package/lib/client/electron.js +3 -0
- package/lib/client/events.js +1 -0
- package/lib/client/fetch.js +3 -3
- package/lib/client/frame.js +4 -3
- package/lib/client/harRouter.js +7 -1
- package/lib/client/locator.js +2 -2
- package/lib/client/page.js +26 -7
- package/lib/common/socksProxy.js +12 -17
- package/lib/generated/consoleApiSource.js +1 -1
- package/lib/generated/injectedScriptSource.js +1 -1
- package/lib/generated/recorderSource.js +1 -1
- package/lib/outofprocess.js +3 -3
- package/lib/protocol/validator.js +46 -29
- package/lib/remote/playwrightConnection.js +2 -2
- package/lib/remote/playwrightServer.js +72 -166
- package/lib/server/android/android.js +2 -2
- package/lib/server/android/backendAdb.js +2 -2
- package/lib/server/browser.js +2 -2
- package/lib/server/browserContext.js +8 -9
- package/lib/server/browserType.js +5 -5
- package/lib/server/chromium/chromium.js +5 -4
- package/lib/server/chromium/crBrowser.js +2 -3
- package/lib/server/chromium/crConnection.js +2 -2
- package/lib/server/chromium/crExecutionContext.js +2 -2
- package/lib/server/chromium/crInput.js +2 -2
- package/lib/server/chromium/crNetworkManager.js +10 -11
- package/lib/server/chromium/crPage.js +48 -7
- package/lib/server/chromium/crServiceWorker.js +2 -3
- package/lib/server/console.js +1 -3
- package/lib/server/debugController.js +0 -3
- package/lib/server/deviceDescriptorsSource.json +50 -50
- package/lib/server/dispatchers/browserContextDispatcher.js +7 -6
- package/lib/server/dispatchers/dispatcher.js +19 -20
- package/lib/server/dispatchers/electronDispatcher.js +13 -0
- package/lib/server/dispatchers/frameDispatcher.js +0 -6
- package/lib/server/dispatchers/localUtilsDispatcher.js +4 -4
- package/lib/server/dispatchers/pageDispatcher.js +14 -10
- package/lib/server/dispatchers/playwrightDispatcher.js +5 -5
- package/lib/server/dispatchers/writableStreamDispatcher.js +2 -2
- package/lib/server/dom.js +133 -170
- package/lib/server/electron/electron.js +40 -14
- package/lib/server/electron/loader.js +4 -2
- package/lib/server/fetch.js +4 -4
- package/lib/server/firefox/ffAccessibility.js +2 -1
- package/lib/server/firefox/ffBrowser.js +3 -3
- package/lib/server/firefox/ffConnection.js +1 -1
- package/lib/server/firefox/ffExecutionContext.js +2 -2
- package/lib/server/firefox/ffNetworkManager.js +7 -7
- package/lib/server/firefox/ffPage.js +3 -5
- package/lib/server/firefox/firefox.js +2 -2
- package/lib/server/frames.js +42 -23
- package/lib/server/har/harTracer.js +6 -6
- package/lib/server/helper.js +1 -1
- package/lib/server/input.js +2 -2
- package/lib/server/isomorphic/utilityScriptSerializers.js +0 -1
- package/lib/server/javascript.js +2 -2
- package/lib/server/page.js +51 -7
- package/lib/server/pipeTransport.js +1 -1
- package/lib/server/playwright.js +1 -1
- package/lib/server/progress.js +5 -14
- package/lib/server/recorder/csharp.js +1 -1
- package/lib/server/recorder/recorderUtils.js +2 -2
- package/lib/server/recorder.js +14 -14
- package/lib/server/registry/browserFetcher.js +1 -2
- package/lib/server/registry/dependencies.js +7 -6
- package/lib/server/registry/index.js +50 -33
- package/lib/server/registry/nativeDeps.js +0 -94
- package/lib/server/registry/oopDownloadBrowserMain.js +2 -2
- package/lib/server/screenshotter.js +0 -1
- package/lib/server/socksInterceptor.js +2 -2
- package/lib/server/trace/recorder/snapshotter.js +2 -2
- package/lib/server/trace/recorder/tracing.js +12 -11
- package/lib/server/trace/test/inMemorySnapshotter.js +1 -1
- package/lib/server/trace/viewer/traceViewer.js +2 -2
- package/lib/server/transport.js +15 -13
- package/lib/server/webkit/wkBrowser.js +3 -3
- package/lib/server/webkit/wkConnection.js +1 -1
- package/lib/server/webkit/wkExecutionContext.js +2 -2
- package/lib/server/webkit/wkInput.js +2 -2
- package/lib/server/webkit/wkInterceptableRequest.js +2 -2
- package/lib/server/webkit/wkPage.js +10 -12
- package/lib/utils/comparators.js +4 -4
- package/lib/utils/fileUtils.js +4 -0
- package/lib/utils/happy-eyeballs.js +5 -4
- package/lib/utils/hostPlatform.js +1 -1
- package/lib/utils/index.js +11 -0
- package/lib/utils/isomorphic/cssParser.js +2 -2
- package/lib/utils/isomorphic/locatorParser.js +6 -4
- package/lib/utils/isomorphic/selectorParser.js +0 -1
- package/lib/utils/network.js +33 -0
- package/lib/utils/processLauncher.js +9 -2
- package/lib/utils/profiler.js +2 -2
- package/lib/utils/zipFile.js +1 -1
- package/lib/vite/htmlReport/index.html +12 -13
- package/lib/vite/recorder/assets/codeMirrorModule-Hs9-1ZG4.css +1 -0
- package/lib/vite/recorder/assets/codeMirrorModule-I9ks4y7D.js +24 -0
- package/lib/vite/recorder/assets/{index-64ce22d5.css → index-ljsTwXtJ.css} +1 -1
- package/lib/vite/recorder/assets/index-yg8ypzl6.js +47 -0
- package/lib/vite/recorder/index.html +2 -3
- package/lib/vite/traceViewer/assets/codeMirrorModule-A2_PGeGB.js +24 -0
- package/lib/vite/{recorder/assets/codeMirrorModule-85487eb6.js → traceViewer/assets/codeMirrorModule-aUzO-LID.js} +1 -1
- package/lib/vite/traceViewer/assets/wsPort-L8WBvZfK.js +69 -0
- package/lib/vite/traceViewer/assets/wsPort-uVqol1LI.js +69 -0
- package/lib/vite/traceViewer/index.4xhUWj1f.js +2 -0
- package/lib/vite/traceViewer/index.html +4 -5
- package/lib/vite/traceViewer/index.o6j3Cv4u.js +2 -0
- package/lib/vite/traceViewer/sw.bundle.js +4 -4
- package/lib/vite/traceViewer/uiMode.PlLkrJDI.js +10 -0
- package/lib/vite/traceViewer/uiMode.html +4 -5
- package/lib/vite/traceViewer/uiMode.qpn6w4df.js +10 -0
- package/lib/vite/traceViewer/wsPort.zR1WIy9-.css +1 -0
- package/package.json +1 -1
- package/lib/vite/recorder/assets/codeMirrorModule-5d0f417c.css +0 -1
- package/lib/vite/recorder/assets/index-b14c63fe.js +0 -41
- /package/lib/vite/recorder/assets/{codicon-79f233d0.ttf → codicon-zGuYmc9o.ttf} +0 -0
|
@@ -21,7 +21,6 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
21
21
|
var util = _interopRequireWildcard(require("util"));
|
|
22
22
|
var fs = _interopRequireWildcard(require("fs"));
|
|
23
23
|
var _utilsBundle = require("../../utilsBundle");
|
|
24
|
-
var _linuxUtils = require("../../utils/linuxUtils");
|
|
25
24
|
var _network = require("../../utils/network");
|
|
26
25
|
var _userAgent = require("../../utils/userAgent");
|
|
27
26
|
var _utils = require("../../utils");
|
|
@@ -30,9 +29,10 @@ var _hostPlatform = require("../../utils/hostPlatform");
|
|
|
30
29
|
var _spawnAsync = require("../../utils/spawnAsync");
|
|
31
30
|
var _dependencies = require("./dependencies");
|
|
32
31
|
var _browserFetcher = require("./browserFetcher");
|
|
32
|
+
var _debugLogger = require("../../utils/debugLogger");
|
|
33
33
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
34
|
-
function _getRequireWildcardCache(
|
|
35
|
-
function _interopRequireWildcard(
|
|
34
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
35
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
36
36
|
/**
|
|
37
37
|
* Copyright 2017 Google Inc. All rights reserved.
|
|
38
38
|
* Modifications copyright (c) Microsoft Corporation.
|
|
@@ -84,10 +84,10 @@ const EXECUTABLE_PATHS = {
|
|
|
84
84
|
const DOWNLOAD_PATHS = {
|
|
85
85
|
'chromium': {
|
|
86
86
|
'<unknown>': undefined,
|
|
87
|
-
'ubuntu18.04-x64':
|
|
87
|
+
'ubuntu18.04-x64': undefined,
|
|
88
88
|
'ubuntu20.04-x64': 'builds/chromium/%s/chromium-linux.zip',
|
|
89
89
|
'ubuntu22.04-x64': 'builds/chromium/%s/chromium-linux.zip',
|
|
90
|
-
'ubuntu18.04-arm64':
|
|
90
|
+
'ubuntu18.04-arm64': undefined,
|
|
91
91
|
'ubuntu20.04-arm64': 'builds/chromium/%s/chromium-linux-arm64.zip',
|
|
92
92
|
'ubuntu22.04-arm64': 'builds/chromium/%s/chromium-linux-arm64.zip',
|
|
93
93
|
'debian11-x64': 'builds/chromium/%s/chromium-linux.zip',
|
|
@@ -107,10 +107,10 @@ const DOWNLOAD_PATHS = {
|
|
|
107
107
|
},
|
|
108
108
|
'chromium-tip-of-tree': {
|
|
109
109
|
'<unknown>': undefined,
|
|
110
|
-
'ubuntu18.04-x64':
|
|
110
|
+
'ubuntu18.04-x64': undefined,
|
|
111
111
|
'ubuntu20.04-x64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip',
|
|
112
112
|
'ubuntu22.04-x64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip',
|
|
113
|
-
'ubuntu18.04-arm64':
|
|
113
|
+
'ubuntu18.04-arm64': undefined,
|
|
114
114
|
'ubuntu20.04-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip',
|
|
115
115
|
'ubuntu22.04-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip',
|
|
116
116
|
'debian11-x64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip',
|
|
@@ -130,10 +130,10 @@ const DOWNLOAD_PATHS = {
|
|
|
130
130
|
},
|
|
131
131
|
'chromium-with-symbols': {
|
|
132
132
|
'<unknown>': undefined,
|
|
133
|
-
'ubuntu18.04-x64':
|
|
133
|
+
'ubuntu18.04-x64': undefined,
|
|
134
134
|
'ubuntu20.04-x64': 'builds/chromium/%s/chromium-with-symbols-linux.zip',
|
|
135
135
|
'ubuntu22.04-x64': 'builds/chromium/%s/chromium-with-symbols-linux.zip',
|
|
136
|
-
'ubuntu18.04-arm64':
|
|
136
|
+
'ubuntu18.04-arm64': undefined,
|
|
137
137
|
'ubuntu20.04-arm64': 'builds/chromium/%s/chromium-with-symbols-linux-arm64.zip',
|
|
138
138
|
'ubuntu22.04-arm64': 'builds/chromium/%s/chromium-with-symbols-linux-arm64.zip',
|
|
139
139
|
'debian11-x64': 'builds/chromium/%s/chromium-with-symbols-linux.zip',
|
|
@@ -153,7 +153,7 @@ const DOWNLOAD_PATHS = {
|
|
|
153
153
|
},
|
|
154
154
|
'firefox': {
|
|
155
155
|
'<unknown>': undefined,
|
|
156
|
-
'ubuntu18.04-x64':
|
|
156
|
+
'ubuntu18.04-x64': undefined,
|
|
157
157
|
'ubuntu20.04-x64': 'builds/firefox/%s/firefox-ubuntu-20.04.zip',
|
|
158
158
|
'ubuntu22.04-x64': 'builds/firefox/%s/firefox-ubuntu-22.04.zip',
|
|
159
159
|
'ubuntu18.04-arm64': undefined,
|
|
@@ -176,7 +176,7 @@ const DOWNLOAD_PATHS = {
|
|
|
176
176
|
},
|
|
177
177
|
'firefox-beta': {
|
|
178
178
|
'<unknown>': undefined,
|
|
179
|
-
'ubuntu18.04-x64':
|
|
179
|
+
'ubuntu18.04-x64': undefined,
|
|
180
180
|
'ubuntu20.04-x64': 'builds/firefox-beta/%s/firefox-beta-ubuntu-20.04.zip',
|
|
181
181
|
'ubuntu22.04-x64': 'builds/firefox-beta/%s/firefox-beta-ubuntu-22.04.zip',
|
|
182
182
|
'ubuntu18.04-arm64': undefined,
|
|
@@ -222,7 +222,7 @@ const DOWNLOAD_PATHS = {
|
|
|
222
222
|
},
|
|
223
223
|
'webkit': {
|
|
224
224
|
'<unknown>': undefined,
|
|
225
|
-
'ubuntu18.04-x64':
|
|
225
|
+
'ubuntu18.04-x64': undefined,
|
|
226
226
|
'ubuntu20.04-x64': 'builds/webkit/%s/webkit-ubuntu-20.04.zip',
|
|
227
227
|
'ubuntu22.04-x64': 'builds/webkit/%s/webkit-ubuntu-22.04.zip',
|
|
228
228
|
'ubuntu18.04-arm64': undefined,
|
|
@@ -245,10 +245,10 @@ const DOWNLOAD_PATHS = {
|
|
|
245
245
|
},
|
|
246
246
|
'ffmpeg': {
|
|
247
247
|
'<unknown>': undefined,
|
|
248
|
-
'ubuntu18.04-x64':
|
|
248
|
+
'ubuntu18.04-x64': undefined,
|
|
249
249
|
'ubuntu20.04-x64': 'builds/ffmpeg/%s/ffmpeg-linux.zip',
|
|
250
250
|
'ubuntu22.04-x64': 'builds/ffmpeg/%s/ffmpeg-linux.zip',
|
|
251
|
-
'ubuntu18.04-arm64':
|
|
251
|
+
'ubuntu18.04-arm64': undefined,
|
|
252
252
|
'ubuntu20.04-arm64': 'builds/ffmpeg/%s/ffmpeg-linux-arm64.zip',
|
|
253
253
|
'ubuntu22.04-arm64': 'builds/ffmpeg/%s/ffmpeg-linux-arm64.zip',
|
|
254
254
|
'debian11-x64': 'builds/ffmpeg/%s/ffmpeg-linux.zip',
|
|
@@ -268,10 +268,10 @@ const DOWNLOAD_PATHS = {
|
|
|
268
268
|
},
|
|
269
269
|
'android': {
|
|
270
270
|
'<unknown>': 'builds/android/%s/android.zip',
|
|
271
|
-
'ubuntu18.04-x64':
|
|
271
|
+
'ubuntu18.04-x64': undefined,
|
|
272
272
|
'ubuntu20.04-x64': 'builds/android/%s/android.zip',
|
|
273
273
|
'ubuntu22.04-x64': 'builds/android/%s/android.zip',
|
|
274
|
-
'ubuntu18.04-arm64':
|
|
274
|
+
'ubuntu18.04-arm64': undefined,
|
|
275
275
|
'ubuntu20.04-arm64': 'builds/android/%s/android.zip',
|
|
276
276
|
'ubuntu22.04-arm64': 'builds/android/%s/android.zip',
|
|
277
277
|
'debian11-x64': 'builds/android/%s/android.zip',
|
|
@@ -374,7 +374,7 @@ class Registry {
|
|
|
374
374
|
executablePath: () => chromiumExecutable,
|
|
375
375
|
executablePathOrDie: sdkLanguage => executablePathOrDie('chromium', chromiumExecutable, chromium.installByDefault, sdkLanguage),
|
|
376
376
|
installType: chromium.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
377
|
-
|
|
377
|
+
_validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'chromium', chromium.dir, ['chrome-linux'], [], ['chrome-win']),
|
|
378
378
|
downloadURLs: this._downloadURLs(chromium),
|
|
379
379
|
browserVersion: chromium.browserVersion,
|
|
380
380
|
_install: () => this._downloadExecutable(chromium, chromiumExecutable),
|
|
@@ -391,7 +391,7 @@ class Registry {
|
|
|
391
391
|
executablePath: () => chromiumWithSymbolsExecutable,
|
|
392
392
|
executablePathOrDie: sdkLanguage => executablePathOrDie('chromium-with-symbols', chromiumWithSymbolsExecutable, chromiumWithSymbols.installByDefault, sdkLanguage),
|
|
393
393
|
installType: chromiumWithSymbols.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
394
|
-
|
|
394
|
+
_validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'chromium', chromiumWithSymbols.dir, ['chrome-linux'], [], ['chrome-win']),
|
|
395
395
|
downloadURLs: this._downloadURLs(chromiumWithSymbols),
|
|
396
396
|
browserVersion: chromiumWithSymbols.browserVersion,
|
|
397
397
|
_install: () => this._downloadExecutable(chromiumWithSymbols, chromiumWithSymbolsExecutable),
|
|
@@ -408,7 +408,7 @@ class Registry {
|
|
|
408
408
|
executablePath: () => chromiumTipOfTreeExecutable,
|
|
409
409
|
executablePathOrDie: sdkLanguage => executablePathOrDie('chromium-tip-of-tree', chromiumTipOfTreeExecutable, chromiumTipOfTree.installByDefault, sdkLanguage),
|
|
410
410
|
installType: chromiumTipOfTree.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
411
|
-
|
|
411
|
+
_validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'chromium', chromiumTipOfTree.dir, ['chrome-linux'], [], ['chrome-win']),
|
|
412
412
|
downloadURLs: this._downloadURLs(chromiumTipOfTree),
|
|
413
413
|
browserVersion: chromiumTipOfTree.browserVersion,
|
|
414
414
|
_install: () => this._downloadExecutable(chromiumTipOfTree, chromiumTipOfTreeExecutable),
|
|
@@ -485,7 +485,7 @@ class Registry {
|
|
|
485
485
|
executablePath: () => firefoxExecutable,
|
|
486
486
|
executablePathOrDie: sdkLanguage => executablePathOrDie('firefox', firefoxExecutable, firefox.installByDefault, sdkLanguage),
|
|
487
487
|
installType: firefox.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
488
|
-
|
|
488
|
+
_validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'firefox', firefox.dir, ['firefox'], [], ['firefox']),
|
|
489
489
|
downloadURLs: this._downloadURLs(firefox),
|
|
490
490
|
browserVersion: firefox.browserVersion,
|
|
491
491
|
_install: () => this._downloadExecutable(firefox, firefoxExecutable),
|
|
@@ -502,7 +502,7 @@ class Registry {
|
|
|
502
502
|
executablePath: () => firefoxAsanExecutable,
|
|
503
503
|
executablePathOrDie: sdkLanguage => executablePathOrDie('firefox-asan', firefoxAsanExecutable, firefoxAsan.installByDefault, sdkLanguage),
|
|
504
504
|
installType: firefoxAsan.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
505
|
-
|
|
505
|
+
_validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'firefox', firefoxAsan.dir, ['firefox'], [], ['firefox']),
|
|
506
506
|
downloadURLs: this._downloadURLs(firefoxAsan),
|
|
507
507
|
browserVersion: firefoxAsan.browserVersion,
|
|
508
508
|
_install: () => this._downloadExecutable(firefoxAsan, firefoxAsanExecutable),
|
|
@@ -519,7 +519,7 @@ class Registry {
|
|
|
519
519
|
executablePath: () => firefoxBetaExecutable,
|
|
520
520
|
executablePathOrDie: sdkLanguage => executablePathOrDie('firefox-beta', firefoxBetaExecutable, firefoxBeta.installByDefault, sdkLanguage),
|
|
521
521
|
installType: firefoxBeta.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
522
|
-
|
|
522
|
+
_validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'firefox', firefoxBeta.dir, ['firefox'], [], ['firefox']),
|
|
523
523
|
downloadURLs: this._downloadURLs(firefoxBeta),
|
|
524
524
|
browserVersion: firefoxBeta.browserVersion,
|
|
525
525
|
_install: () => this._downloadExecutable(firefoxBeta, firefoxBetaExecutable),
|
|
@@ -537,7 +537,7 @@ class Registry {
|
|
|
537
537
|
executablePath: () => webkitExecutable,
|
|
538
538
|
executablePathOrDie: sdkLanguage => executablePathOrDie('webkit', webkitExecutable, webkit.installByDefault, sdkLanguage),
|
|
539
539
|
installType: webkit.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
540
|
-
|
|
540
|
+
_validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'webkit', webkit.dir, webkitLinuxLddDirectories, ['libGLESv2.so.2', 'libx264.so'], ['']),
|
|
541
541
|
downloadURLs: this._downloadURLs(webkit),
|
|
542
542
|
browserVersion: webkit.browserVersion,
|
|
543
543
|
_install: () => this._downloadExecutable(webkit, webkitExecutable),
|
|
@@ -554,7 +554,7 @@ class Registry {
|
|
|
554
554
|
executablePath: () => ffmpegExecutable,
|
|
555
555
|
executablePathOrDie: sdkLanguage => executablePathOrDie('ffmpeg', ffmpegExecutable, ffmpeg.installByDefault, sdkLanguage),
|
|
556
556
|
installType: ffmpeg.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
557
|
-
|
|
557
|
+
_validateHostRequirements: () => Promise.resolve(),
|
|
558
558
|
downloadURLs: this._downloadURLs(ffmpeg),
|
|
559
559
|
_install: () => this._downloadExecutable(ffmpeg, ffmpegExecutable),
|
|
560
560
|
_dependencyGroup: 'tools',
|
|
@@ -569,7 +569,7 @@ class Registry {
|
|
|
569
569
|
executablePath: () => undefined,
|
|
570
570
|
executablePathOrDie: () => '',
|
|
571
571
|
installType: 'download-on-demand',
|
|
572
|
-
|
|
572
|
+
_validateHostRequirements: () => Promise.resolve(),
|
|
573
573
|
downloadURLs: this._downloadURLs(android),
|
|
574
574
|
_install: () => this._downloadExecutable(android),
|
|
575
575
|
_dependencyGroup: 'tools',
|
|
@@ -601,7 +601,7 @@ class Registry {
|
|
|
601
601
|
executablePath: sdkLanguage => executablePath(sdkLanguage, false),
|
|
602
602
|
executablePathOrDie: sdkLanguage => executablePath(sdkLanguage, true),
|
|
603
603
|
installType: install ? 'install-script' : 'none',
|
|
604
|
-
|
|
604
|
+
_validateHostRequirements: () => Promise.resolve(),
|
|
605
605
|
_isHermeticInstallation: false,
|
|
606
606
|
_install: install
|
|
607
607
|
};
|
|
@@ -624,12 +624,6 @@ class Registry {
|
|
|
624
624
|
return Array.from(set);
|
|
625
625
|
}
|
|
626
626
|
async _validateHostRequirements(sdkLanguage, browserName, browserDirectory, linuxLddDirectories, dlOpenLibraries, windowsExeAndDllDirectories) {
|
|
627
|
-
if ((0, _utils.getAsBooleanFromENV)('PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS')) {
|
|
628
|
-
process.stderr.write('Skipping host requirements validation logic because `PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS` env variable is set.\n');
|
|
629
|
-
return;
|
|
630
|
-
}
|
|
631
|
-
const distributionInfo = await (0, _linuxUtils.getLinuxDistributionInfo)();
|
|
632
|
-
if (browserName === 'firefox' && (distributionInfo === null || distributionInfo === void 0 ? void 0 : distributionInfo.id) === 'ubuntu' && (distributionInfo === null || distributionInfo === void 0 ? void 0 : distributionInfo.version) === '16.04') throw new Error(`Cannot launch Firefox on Ubuntu 16.04! Minimum required Ubuntu version for Firefox browser is 20.04`);
|
|
633
627
|
if (os.platform() === 'linux') return await (0, _dependencies.validateDependenciesLinux)(sdkLanguage, linuxLddDirectories.map(d => _path.default.join(browserDirectory, d)), dlOpenLibraries);
|
|
634
628
|
if (os.platform() === 'win32' && os.arch() === 'x64') return await (0, _dependencies.validateDependenciesWindows)(windowsExeAndDllDirectories.map(d => _path.default.join(browserDirectory, d)));
|
|
635
629
|
}
|
|
@@ -712,6 +706,30 @@ class Registry {
|
|
|
712
706
|
numberOfBrowsersLeft: (await fs.promises.readdir(registryDirectory).catch(() => [])).filter(browserDirectory => isBrowserDirectory(browserDirectory)).length
|
|
713
707
|
};
|
|
714
708
|
}
|
|
709
|
+
async validateHostRequirementsForExecutablesIfNeeded(executables, sdkLanguage) {
|
|
710
|
+
if ((0, _utils.getAsBooleanFromENV)('PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS')) {
|
|
711
|
+
process.stderr.write('Skipping host requirements validation logic because `PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS` env variable is set.\n');
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
for (const executable of executables) await this._validateHostRequirementsForExecutableIfNeeded(executable, sdkLanguage);
|
|
715
|
+
}
|
|
716
|
+
async _validateHostRequirementsForExecutableIfNeeded(executable, sdkLanguage) {
|
|
717
|
+
const kMaximumReValidationPeriod = 30 * 24 * 60 * 60 * 1000; // 30 days
|
|
718
|
+
// Executable does not require validation.
|
|
719
|
+
if (!executable.directory) return;
|
|
720
|
+
const markerFile = _path.default.join(executable.directory, 'DEPENDENCIES_VALIDATED');
|
|
721
|
+
// Executable is already validated.
|
|
722
|
+
if (await fs.promises.stat(markerFile).then(stat => Date.now() - stat.mtime.getTime() < kMaximumReValidationPeriod).catch(() => false)) return;
|
|
723
|
+
_debugLogger.debugLogger.log('install', `validating host requirements for "${executable.name}"`);
|
|
724
|
+
try {
|
|
725
|
+
await executable._validateHostRequirements(sdkLanguage);
|
|
726
|
+
_debugLogger.debugLogger.log('install', `validation passed for ${executable.name}`);
|
|
727
|
+
} catch (error) {
|
|
728
|
+
_debugLogger.debugLogger.log('install', `validation failed for ${executable.name}`);
|
|
729
|
+
throw error;
|
|
730
|
+
}
|
|
731
|
+
await fs.promises.writeFile(markerFile, '').catch(() => {});
|
|
732
|
+
}
|
|
715
733
|
_downloadURLs(descriptor) {
|
|
716
734
|
const paths = DOWNLOAD_PATHS[descriptor.name];
|
|
717
735
|
const downloadPathTemplate = paths[_hostPlatform.hostPlatform] || paths['<unknown>'];
|
|
@@ -879,7 +897,6 @@ async function installBrowsersForNpmInstall(browsers) {
|
|
|
879
897
|
}
|
|
880
898
|
await registry.install(executables, false /* forceReinstall */);
|
|
881
899
|
}
|
|
882
|
-
|
|
883
900
|
function findChromiumChannel(sdkLanguage) {
|
|
884
901
|
// Fall back to the stable channels of popular vendors to work out of the box.
|
|
885
902
|
// Null means no installation and no channels found.
|
|
@@ -25,100 +25,6 @@ exports.deps = void 0;
|
|
|
25
25
|
// ./utils/linux-browser-dependencies/run.sh ubuntu:20.04
|
|
26
26
|
|
|
27
27
|
const deps = exports.deps = {
|
|
28
|
-
'ubuntu18.04-x64': {
|
|
29
|
-
tools: ['xvfb', 'fonts-noto-color-emoji', 'ttf-unifont', 'libfontconfig', 'libfreetype6', 'xfonts-cyrillic', 'xfonts-scalable', 'fonts-liberation', 'fonts-ipafont-gothic', 'fonts-wqy-zenhei', 'fonts-tlwg-loma-otf', 'ttf-ubuntu-font-family'],
|
|
30
|
-
chromium: ['fonts-liberation', 'libasound2', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libatspi2.0-0', 'libcairo2', 'libcups2', 'libdbus-1-3', 'libdrm2', 'libegl1', 'libgbm1', 'libglib2.0-0', 'libgtk-3-0', 'libnspr4', 'libnss3', 'libpango-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb1', 'libxcomposite1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxrandr2', 'libxshmfence1'],
|
|
31
|
-
firefox: ['ffmpeg', 'libatk1.0-0', 'libcairo-gobject2', 'libcairo2', 'libdbus-1-3', 'libdbus-glib-1-2', 'libfontconfig1', 'libfreetype6', 'libgdk-pixbuf2.0-0', 'libglib2.0-0', 'libgtk-3-0', 'libpango-1.0-0', 'libpangocairo-1.0-0', 'libpangoft2-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb-shm0', 'libxcb1', 'libxcomposite1', 'libxcursor1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxi6', 'libxrender1', 'libxt6', 'libxtst6'],
|
|
32
|
-
webkit: [],
|
|
33
|
-
lib2package: {
|
|
34
|
-
'libasound.so.2': 'libasound2',
|
|
35
|
-
'libatk-1.0.so.0': 'libatk1.0-0',
|
|
36
|
-
'libatk-bridge-2.0.so.0': 'libatk-bridge2.0-0',
|
|
37
|
-
'libatspi.so.0': 'libatspi2.0-0',
|
|
38
|
-
'libbrotlidec.so.1': 'libbrotli1',
|
|
39
|
-
'libcairo-gobject.so.2': 'libcairo-gobject2',
|
|
40
|
-
'libcairo.so.2': 'libcairo2',
|
|
41
|
-
'libcups.so.2': 'libcups2',
|
|
42
|
-
'libdbus-1.so.3': 'libdbus-1-3',
|
|
43
|
-
'libdbus-glib-1.so.2': 'libdbus-glib-1-2',
|
|
44
|
-
'libdrm.so.2': 'libdrm2',
|
|
45
|
-
'libEGL.so.1': 'libegl1',
|
|
46
|
-
'libenchant.so.1': 'libenchant1c2a',
|
|
47
|
-
'libepoxy.so.0': 'libepoxy0',
|
|
48
|
-
'libevent-2.1.so.6': 'libevent-2.1-6',
|
|
49
|
-
'libevdev.so.2': 'libevdev2',
|
|
50
|
-
'libfontconfig.so.1': 'libfontconfig1',
|
|
51
|
-
'libfreetype.so.6': 'libfreetype6',
|
|
52
|
-
'libgbm.so.1': 'libgbm1',
|
|
53
|
-
'libgdk_pixbuf-2.0.so.0': 'libgdk-pixbuf2.0-0',
|
|
54
|
-
'libgdk-3.so.0': 'libgtk-3-0',
|
|
55
|
-
'libgdk-x11-2.0.so.0': 'libgtk2.0-0',
|
|
56
|
-
'libgio-2.0.so.0': 'libglib2.0-0',
|
|
57
|
-
'libGL.so.1': 'libgl1',
|
|
58
|
-
'libGLESv2.so.2': 'libgles2',
|
|
59
|
-
'libglib-2.0.so.0': 'libglib2.0-0',
|
|
60
|
-
'libgmodule-2.0.so.0': 'libglib2.0-0',
|
|
61
|
-
'libgobject-2.0.so.0': 'libglib2.0-0',
|
|
62
|
-
'libgstapp-1.0.so.0': 'gstreamer1.0-plugins-base',
|
|
63
|
-
'libgstaudio-1.0.so.0': 'gstreamer1.0-plugins-base',
|
|
64
|
-
'libgstbase-1.0.so.0': 'libgstreamer1.0-0',
|
|
65
|
-
'libgstcodecparsers-1.0.so.0': 'gstreamer1.0-plugins-bad',
|
|
66
|
-
'libgstfft-1.0.so.0': 'gstreamer1.0-plugins-base',
|
|
67
|
-
'libgstgl-1.0.so.0': 'libgstreamer-gl1.0-0',
|
|
68
|
-
'libgstpbutils-1.0.so.0': 'gstreamer1.0-plugins-base',
|
|
69
|
-
'libgstreamer-1.0.so.0': 'libgstreamer1.0-0',
|
|
70
|
-
'libgsttag-1.0.so.0': 'gstreamer1.0-plugins-base',
|
|
71
|
-
'libgstvideo-1.0.so.0': 'gstreamer1.0-plugins-base',
|
|
72
|
-
'libgthread-2.0.so.0': 'libglib2.0-0',
|
|
73
|
-
'libgtk-3.so.0': 'libgtk-3-0',
|
|
74
|
-
'libgtk-x11-2.0.so.0': 'libgtk2.0-0',
|
|
75
|
-
'libharfbuzz-icu.so.0': 'libharfbuzz-icu0',
|
|
76
|
-
'libharfbuzz.so.0': 'libharfbuzz0b',
|
|
77
|
-
'libhyphen.so.0': 'libhyphen0',
|
|
78
|
-
'libicudata.so.60': 'libicu60',
|
|
79
|
-
'libicui18n.so.60': 'libicu60',
|
|
80
|
-
'libicuuc.so.60': 'libicu60',
|
|
81
|
-
'libjpeg.so.8': 'libjpeg-turbo8',
|
|
82
|
-
'libnotify.so.4': 'libnotify4',
|
|
83
|
-
'libnspr4.so': 'libnspr4',
|
|
84
|
-
'libnss3.so': 'libnss3',
|
|
85
|
-
'libnssutil3.so': 'libnss3',
|
|
86
|
-
'libopenjp2.so.7': 'libopenjp2-7',
|
|
87
|
-
'libopus.so.0': 'libopus0',
|
|
88
|
-
'libpango-1.0.so.0': 'libpango-1.0-0',
|
|
89
|
-
'libpangocairo-1.0.so.0': 'libpangocairo-1.0-0',
|
|
90
|
-
'libpangoft2-1.0.so.0': 'libpangoft2-1.0-0',
|
|
91
|
-
'libpng16.so.16': 'libpng16-16',
|
|
92
|
-
'libsecret-1.so.0': 'libsecret-1-0',
|
|
93
|
-
'libsmime3.so': 'libnss3',
|
|
94
|
-
'libvpx.so.5': 'libvpx5',
|
|
95
|
-
'libwayland-client.so.0': 'libwayland-client0',
|
|
96
|
-
'libwayland-egl.so.1': 'libwayland-egl1',
|
|
97
|
-
'libwayland-server.so.0': 'libwayland-server0',
|
|
98
|
-
'libwebp.so.6': 'libwebp6',
|
|
99
|
-
'libwebpdemux.so.2': 'libwebpdemux2',
|
|
100
|
-
'libwoff2dec.so.1.0.2': 'libwoff1',
|
|
101
|
-
'libX11-xcb.so.1': 'libx11-xcb1',
|
|
102
|
-
'libX11.so.6': 'libx11-6',
|
|
103
|
-
'libxcb-dri3.so.0': 'libxcb-dri3-0',
|
|
104
|
-
'libxcb-shm.so.0': 'libxcb-shm0',
|
|
105
|
-
'libxcb.so.1': 'libxcb1',
|
|
106
|
-
'libXcomposite.so.1': 'libxcomposite1',
|
|
107
|
-
'libXcursor.so.1': 'libxcursor1',
|
|
108
|
-
'libXdamage.so.1': 'libxdamage1',
|
|
109
|
-
'libXext.so.6': 'libxext6',
|
|
110
|
-
'libXfixes.so.3': 'libxfixes3',
|
|
111
|
-
'libXi.so.6': 'libxi6',
|
|
112
|
-
'libxkbcommon.so.0': 'libxkbcommon0',
|
|
113
|
-
'libxml2.so.2': 'libxml2',
|
|
114
|
-
'libXrandr.so.2': 'libxrandr2',
|
|
115
|
-
'libXrender.so.1': 'libxrender1',
|
|
116
|
-
'libxslt.so.1': 'libxslt1.1',
|
|
117
|
-
'libXt.so.6': 'libxt6',
|
|
118
|
-
'libXtst.so.6': 'libxtst6',
|
|
119
|
-
'libevent-2.1-6': 'libevent-2.1-6'
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
28
|
'ubuntu20.04-x64': {
|
|
123
29
|
tools: ['xvfb', 'fonts-noto-color-emoji', 'ttf-unifont', 'libfontconfig', 'libfreetype6', 'xfonts-cyrillic', 'xfonts-scalable', 'fonts-liberation', 'fonts-ipafont-gothic', 'fonts-wqy-zenhei', 'fonts-tlwg-loma-otf', 'ttf-ubuntu-font-family'],
|
|
124
30
|
chromium: ['fonts-liberation', 'libasound2', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libatspi2.0-0', 'libcairo2', 'libcups2', 'libdbus-1-3', 'libdrm2', 'libegl1', 'libgbm1', 'libglib2.0-0', 'libgtk-3-0', 'libnspr4', 'libnss3', 'libpango-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb1', 'libxcomposite1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxrandr2', 'libxshmfence1'],
|
|
@@ -24,7 +24,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
24
24
|
|
|
25
25
|
function log(message) {
|
|
26
26
|
var _process$send, _process;
|
|
27
|
-
(_process$send = (_process = process).send) === null || _process$send === void 0
|
|
27
|
+
(_process$send = (_process = process).send) === null || _process$send === void 0 || _process$send.call(_process, {
|
|
28
28
|
method: 'log',
|
|
29
29
|
params: {
|
|
30
30
|
message
|
|
@@ -33,7 +33,7 @@ function log(message) {
|
|
|
33
33
|
}
|
|
34
34
|
function progress(done, total) {
|
|
35
35
|
var _process$send2, _process2;
|
|
36
|
-
(_process$send2 = (_process2 = process).send) === null || _process$send2 === void 0
|
|
36
|
+
(_process$send2 = (_process2 = process).send) === null || _process$send2 === void 0 || _process$send2.call(_process2, {
|
|
37
37
|
method: 'progress',
|
|
38
38
|
params: {
|
|
39
39
|
done,
|
|
@@ -200,7 +200,6 @@ class Screenshotter {
|
|
|
200
200
|
progress.throwIfAborted(); // Do not do extra work.
|
|
201
201
|
|
|
202
202
|
await handle._waitAndScrollIntoViewIfNeeded(progress, true /* waitForVisible */);
|
|
203
|
-
|
|
204
203
|
progress.throwIfAborted(); // Do not do extra work.
|
|
205
204
|
const boundingBox = await handle.boundingBox();
|
|
206
205
|
(0, _utils.assert)(boundingBox, 'Node is either not visible or not an HTMLElement');
|
|
@@ -8,8 +8,8 @@ var socks = _interopRequireWildcard(require("../common/socksProxy"));
|
|
|
8
8
|
var _events = _interopRequireDefault(require("events"));
|
|
9
9
|
var _validator = require("../protocol/validator");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
/**
|
|
14
14
|
* Copyright (c) Microsoft Corporation.
|
|
15
15
|
*
|
|
@@ -7,7 +7,7 @@ exports.Snapshotter = void 0;
|
|
|
7
7
|
var _browserContext = require("../../browserContext");
|
|
8
8
|
var _page = require("../../page");
|
|
9
9
|
var _eventsHelper = require("../../../utils/eventsHelper");
|
|
10
|
-
var _debugLogger = require("../../../
|
|
10
|
+
var _debugLogger = require("../../../utils/debugLogger");
|
|
11
11
|
var _snapshotterInjected = require("./snapshotterInjected");
|
|
12
12
|
var _utils = require("../../../utils");
|
|
13
13
|
var _utilsBundle = require("../../../utilsBundle");
|
|
@@ -83,7 +83,7 @@ class Snapshotter {
|
|
|
83
83
|
const expression = `window["${this._snapshotStreamer}"].captureSnapshot(${JSON.stringify(snapshotName)})`;
|
|
84
84
|
|
|
85
85
|
// In a best-effort manner, without waiting for it, mark target element.
|
|
86
|
-
element === null || element === void 0
|
|
86
|
+
element === null || element === void 0 || element.callFunctionNoReply((element, callId) => {
|
|
87
87
|
const customEvent = new CustomEvent('__playwright_target__', {
|
|
88
88
|
bubbles: true,
|
|
89
89
|
cancelable: true,
|
|
@@ -20,6 +20,7 @@ var _page = require("../../page");
|
|
|
20
20
|
var _harTracer = require("../../har/harTracer");
|
|
21
21
|
var _snapshotter = require("./snapshotter");
|
|
22
22
|
var _zipBundle = require("../../../zipBundle");
|
|
23
|
+
var _dispatcher = require("../../dispatchers/dispatcher");
|
|
23
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
25
|
/**
|
|
25
26
|
* Copyright (c) Microsoft Corporation.
|
|
@@ -94,7 +95,7 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
94
95
|
mode: 'discard'
|
|
95
96
|
}).catch(() => {});
|
|
96
97
|
await this.stop();
|
|
97
|
-
(_this$_snapshotter = this._snapshotter) === null || _this$_snapshotter === void 0
|
|
98
|
+
(_this$_snapshotter = this._snapshotter) === null || _this$_snapshotter === void 0 || _this$_snapshotter.resetForReuse();
|
|
98
99
|
}
|
|
99
100
|
async start(options) {
|
|
100
101
|
if (this._isStopping) throw new Error('Cannot start tracing while stopping');
|
|
@@ -198,7 +199,7 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
198
199
|
}
|
|
199
200
|
abort() {
|
|
200
201
|
var _this$_snapshotter3;
|
|
201
|
-
(_this$_snapshotter3 = this._snapshotter) === null || _this$_snapshotter3 === void 0
|
|
202
|
+
(_this$_snapshotter3 = this._snapshotter) === null || _this$_snapshotter3 === void 0 || _this$_snapshotter3.dispose();
|
|
202
203
|
this._harTracer.stop();
|
|
203
204
|
}
|
|
204
205
|
async flush() {
|
|
@@ -286,9 +287,9 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
286
287
|
// IMPORTANT: no awaits before this._appendTraceEvent in this method.
|
|
287
288
|
const event = createBeforeActionTraceEvent(metadata);
|
|
288
289
|
if (!event) return Promise.resolve();
|
|
289
|
-
(_sdkObject$attributio = sdkObject.attribution.page) === null || _sdkObject$attributio === void 0
|
|
290
|
+
(_sdkObject$attributio = sdkObject.attribution.page) === null || _sdkObject$attributio === void 0 || _sdkObject$attributio.temporarilyDisableTracingScreencastThrottling();
|
|
290
291
|
event.beforeSnapshot = `before@${metadata.id}`;
|
|
291
|
-
(_this$_state = this._state) === null || _this$_state === void 0
|
|
292
|
+
(_this$_state = this._state) === null || _this$_state === void 0 || _this$_state.callIds.add(metadata.id);
|
|
292
293
|
this._appendTraceEvent(event);
|
|
293
294
|
return this._captureSnapshot(event.beforeSnapshot, sdkObject, metadata);
|
|
294
295
|
}
|
|
@@ -298,7 +299,7 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
298
299
|
// IMPORTANT: no awaits before this._appendTraceEvent in this method.
|
|
299
300
|
const event = createInputActionTraceEvent(metadata);
|
|
300
301
|
if (!event) return Promise.resolve();
|
|
301
|
-
(_sdkObject$attributio2 = sdkObject.attribution.page) === null || _sdkObject$attributio2 === void 0
|
|
302
|
+
(_sdkObject$attributio2 = sdkObject.attribution.page) === null || _sdkObject$attributio2 === void 0 || _sdkObject$attributio2.temporarilyDisableTracingScreencastThrottling();
|
|
302
303
|
event.inputSnapshot = `input@${metadata.id}`;
|
|
303
304
|
this._appendTraceEvent(event);
|
|
304
305
|
return this._captureSnapshot(event.inputSnapshot, sdkObject, metadata, element);
|
|
@@ -312,10 +313,10 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
312
313
|
async onAfterCall(sdkObject, metadata) {
|
|
313
314
|
var _this$_state3, _this$_state4, _sdkObject$attributio3;
|
|
314
315
|
if (!((_this$_state3 = this._state) !== null && _this$_state3 !== void 0 && _this$_state3.callIds.has(metadata.id))) return;
|
|
315
|
-
(_this$_state4 = this._state) === null || _this$_state4 === void 0
|
|
316
|
+
(_this$_state4 = this._state) === null || _this$_state4 === void 0 || _this$_state4.callIds.delete(metadata.id);
|
|
316
317
|
const event = createAfterActionTraceEvent(metadata);
|
|
317
318
|
if (!event) return;
|
|
318
|
-
(_sdkObject$attributio3 = sdkObject.attribution.page) === null || _sdkObject$attributio3 === void 0
|
|
319
|
+
(_sdkObject$attributio3 = sdkObject.attribution.page) === null || _sdkObject$attributio3 === void 0 || _sdkObject$attributio3.temporarilyDisableTracingScreencastThrottling();
|
|
319
320
|
event.afterSnapshot = `after@${metadata.id}`;
|
|
320
321
|
this._appendTraceEvent(event);
|
|
321
322
|
return this._captureSnapshot(event.afterSnapshot, sdkObject, metadata);
|
|
@@ -340,7 +341,6 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
340
341
|
const visited = visitTraceEvent(event, this._state.networkSha1s);
|
|
341
342
|
this._fs.appendFile(this._state.networkFile, JSON.stringify(visited) + '\n', true /* flush */);
|
|
342
343
|
}
|
|
343
|
-
|
|
344
344
|
flushHarEntries() {
|
|
345
345
|
const harLines = [];
|
|
346
346
|
for (const entry of this._pendingHarEntries) {
|
|
@@ -354,7 +354,6 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
354
354
|
this._pendingHarEntries.clear();
|
|
355
355
|
if (harLines.length) this._fs.appendFile(this._state.networkFile, harLines.join('\n') + '\n', true /* flush */);
|
|
356
356
|
}
|
|
357
|
-
|
|
358
357
|
onContentBlob(sha1, buffer) {
|
|
359
358
|
this._appendResource(sha1, buffer);
|
|
360
359
|
}
|
|
@@ -368,6 +367,7 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
368
367
|
});
|
|
369
368
|
}
|
|
370
369
|
_onConsoleMessage(message) {
|
|
370
|
+
var _message$page;
|
|
371
371
|
const event = {
|
|
372
372
|
type: 'console',
|
|
373
373
|
messageType: message.type(),
|
|
@@ -378,7 +378,7 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
378
378
|
})),
|
|
379
379
|
location: message.location(),
|
|
380
380
|
time: (0, _utils.monotonicTime)(),
|
|
381
|
-
pageId: message.page().guid
|
|
381
|
+
pageId: (_message$page = message.page()) === null || _message$page === void 0 ? void 0 : _message$page.guid
|
|
382
382
|
};
|
|
383
383
|
this._appendTraceEvent(event);
|
|
384
384
|
}
|
|
@@ -417,7 +417,8 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
417
417
|
exports.Tracing = Tracing;
|
|
418
418
|
function visitTraceEvent(object, sha1s) {
|
|
419
419
|
if (Array.isArray(object)) return object.map(o => visitTraceEvent(o, sha1s));
|
|
420
|
-
if (object instanceof
|
|
420
|
+
if (object instanceof _dispatcher.Dispatcher) return `<${object._type}>`;
|
|
421
|
+
if (object instanceof Buffer) return `<Buffer>`;
|
|
421
422
|
if (object instanceof Date) return object;
|
|
422
423
|
if (typeof object === 'object') {
|
|
423
424
|
const result = {};
|
|
@@ -81,7 +81,7 @@ class InMemorySnapshotter {
|
|
|
81
81
|
var _this$_snapshotReadyP;
|
|
82
82
|
++this._snapshotCount;
|
|
83
83
|
const renderer = this._storage.addFrameSnapshot(snapshot);
|
|
84
|
-
(_this$_snapshotReadyP = this._snapshotReadyPromises.get(snapshot.snapshotName || '')) === null || _this$_snapshotReadyP === void 0
|
|
84
|
+
(_this$_snapshotReadyP = this._snapshotReadyPromises.get(snapshot.snapshotName || '')) === null || _this$_snapshotReadyP === void 0 || _this$_snapshotReadyP.resolve(renderer);
|
|
85
85
|
}
|
|
86
86
|
async resourceContentForTest(sha1) {
|
|
87
87
|
return this._blobs.get(sha1);
|
|
@@ -168,7 +168,7 @@ async function openTraceInBrowser(traceUrls, options) {
|
|
|
168
168
|
} = await startTraceViewerServer(traceUrls, options);
|
|
169
169
|
// eslint-disable-next-line no-console
|
|
170
170
|
console.log('\nListening on ' + url);
|
|
171
|
-
if (!(0, _utils.isUnderTest)()) await (0, _utilsBundle.open)(url).catch(() => {});
|
|
171
|
+
if (!(0, _utils.isUnderTest)()) await (0, _utilsBundle.open)(url.replace('0.0.0.0', 'localhost')).catch(() => {});
|
|
172
172
|
}
|
|
173
173
|
class StdinServer {
|
|
174
174
|
constructor() {
|
|
@@ -195,7 +195,7 @@ class StdinServer {
|
|
|
195
195
|
var _this$sendEvent;
|
|
196
196
|
this._traceUrl = url;
|
|
197
197
|
clearTimeout(this._pollTimer);
|
|
198
|
-
(_this$sendEvent = this.sendEvent) === null || _this$sendEvent === void 0
|
|
198
|
+
(_this$sendEvent = this.sendEvent) === null || _this$sendEvent === void 0 || _this$sendEvent.call(this, 'loadTrace', {
|
|
199
199
|
url
|
|
200
200
|
});
|
|
201
201
|
}
|