@checkly/playwright-core 1.48.22 → 1.51.11-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/ThirdPartyNotices.txt +60 -48
  2. package/bin/reinstall_chrome_beta_linux.sh +10 -8
  3. package/bin/reinstall_chrome_stable_linux.sh +10 -8
  4. package/bin/reinstall_msedge_beta_linux.sh +17 -9
  5. package/bin/reinstall_msedge_dev_linux.sh +17 -9
  6. package/bin/reinstall_msedge_stable_linux.sh +17 -9
  7. package/browsers.json +33 -12
  8. package/index.js +0 -1
  9. package/lib/androidServerImpl.js +5 -5
  10. package/lib/browserServerImpl.js +18 -9
  11. package/lib/checkly/secretsFilter.js +1 -1
  12. package/lib/cli/driver.js +6 -6
  13. package/lib/cli/program.js +38 -43
  14. package/lib/cli/programWithTestStub.js +2 -1
  15. package/lib/client/android.js +37 -58
  16. package/lib/client/artifact.js +4 -7
  17. package/lib/client/browser.js +10 -15
  18. package/lib/client/browserContext.js +69 -62
  19. package/lib/client/browserType.js +30 -64
  20. package/lib/client/channelOwner.js +53 -68
  21. package/lib/client/clientHelper.js +4 -6
  22. package/lib/client/clientInstrumentation.js +2 -0
  23. package/lib/client/clientStackTrace.js +65 -0
  24. package/lib/client/connection.js +48 -41
  25. package/lib/client/consoleMessage.js +4 -7
  26. package/lib/client/electron.js +10 -10
  27. package/lib/client/elementHandle.js +32 -33
  28. package/lib/client/errors.js +2 -2
  29. package/lib/client/eventEmitter.js +5 -8
  30. package/lib/client/fetch.js +61 -62
  31. package/lib/client/fileUtils.js +31 -0
  32. package/lib/client/frame.js +22 -23
  33. package/lib/client/harRouter.js +7 -9
  34. package/lib/client/jsHandle.js +3 -4
  35. package/lib/client/localUtils.js +24 -0
  36. package/lib/client/locator.js +27 -13
  37. package/lib/client/network.js +44 -37
  38. package/lib/client/page.js +50 -41
  39. package/lib/client/platform.js +71 -0
  40. package/lib/client/playwright.js +21 -1
  41. package/lib/client/selectors.js +8 -2
  42. package/lib/client/stream.js +2 -21
  43. package/lib/client/timeoutSettings.js +65 -0
  44. package/lib/client/tracing.js +29 -7
  45. package/lib/client/video.js +2 -2
  46. package/lib/client/waiter.js +19 -16
  47. package/lib/client/webSocket.js +106 -0
  48. package/lib/client/worker.js +4 -4
  49. package/lib/client/writableStream.js +2 -21
  50. package/lib/generated/consoleApiSource.js +1 -1
  51. package/lib/generated/injectedScriptSource.js +1 -1
  52. package/lib/generated/pollingRecorderSource.js +1 -1
  53. package/lib/generated/recorderSource.js +7 -0
  54. package/lib/generated/webSocketMockSource.js +1 -1
  55. package/lib/inProcessFactory.js +8 -3
  56. package/lib/outofprocess.js +12 -8
  57. package/lib/protocol/debug.js +1 -1
  58. package/lib/protocol/validator.js +77 -11
  59. package/lib/protocol/validatorPrimitives.js +1 -2
  60. package/lib/remote/playwrightConnection.js +21 -12
  61. package/lib/remote/playwrightServer.js +22 -8
  62. package/lib/server/android/android.js +17 -14
  63. package/lib/server/android/backendAdb.js +14 -14
  64. package/lib/server/artifact.js +3 -3
  65. package/lib/server/bidi/bidiBrowser.js +11 -8
  66. package/lib/server/bidi/bidiChromium.js +5 -4
  67. package/lib/server/bidi/bidiConnection.js +1 -3
  68. package/lib/server/bidi/bidiExecutionContext.js +71 -25
  69. package/lib/server/bidi/bidiFirefox.js +4 -3
  70. package/lib/server/bidi/bidiInput.js +11 -12
  71. package/lib/server/bidi/bidiNetworkManager.js +11 -12
  72. package/lib/server/bidi/bidiOverCdp.js +2 -2
  73. package/lib/server/bidi/bidiPage.js +39 -66
  74. package/lib/server/bidi/third_party/bidiKeyboard.js +9 -7
  75. package/lib/server/bidi/third_party/firefoxPrefs.js +19 -3
  76. package/lib/server/browser.js +2 -2
  77. package/lib/server/browserContext.js +60 -55
  78. package/lib/server/browserType.js +22 -18
  79. package/lib/server/callLog.js +79 -0
  80. package/lib/server/chromium/chromium.js +20 -16
  81. package/lib/server/chromium/chromiumSwitches.js +32 -9
  82. package/lib/server/chromium/crBrowser.js +25 -24
  83. package/lib/server/chromium/crConnection.js +2 -2
  84. package/lib/server/chromium/crCoverage.js +1 -1
  85. package/lib/server/chromium/crDevTools.js +1 -1
  86. package/lib/server/chromium/crDragDrop.js +1 -1
  87. package/lib/server/chromium/crExecutionContext.js +26 -35
  88. package/lib/server/chromium/crInput.js +17 -6
  89. package/lib/server/chromium/crNetworkManager.js +3 -3
  90. package/lib/server/chromium/crPage.js +43 -55
  91. package/lib/server/chromium/crPdf.js +1 -1
  92. package/lib/server/chromium/crProtocolHelper.js +3 -3
  93. package/lib/server/chromium/crServiceWorker.js +2 -2
  94. package/lib/server/chromium/videoRecorder.js +2 -2
  95. package/lib/server/clock.js +1 -1
  96. package/lib/server/codegen/csharp.js +21 -16
  97. package/lib/server/codegen/java.js +17 -9
  98. package/lib/server/codegen/javascript.js +37 -7
  99. package/lib/server/codegen/jsonl.js +1 -1
  100. package/lib/server/codegen/languages.js +2 -2
  101. package/lib/server/codegen/python.js +14 -17
  102. package/lib/server/debugController.js +23 -45
  103. package/lib/server/debugger.js +1 -1
  104. package/lib/server/deviceDescriptors.js +1 -1
  105. package/lib/server/deviceDescriptorsSource.json +131 -131
  106. package/lib/server/dispatchers/androidDispatcher.js +14 -3
  107. package/lib/server/dispatchers/artifactDispatcher.js +3 -3
  108. package/lib/server/dispatchers/browserContextDispatcher.js +21 -32
  109. package/lib/server/dispatchers/browserTypeDispatcher.js +1 -1
  110. package/lib/server/dispatchers/cdpSessionDispatcher.js +1 -1
  111. package/lib/server/dispatchers/debugControllerDispatcher.js +5 -3
  112. package/lib/server/dispatchers/dispatcher.js +27 -25
  113. package/lib/server/dispatchers/electronDispatcher.js +3 -3
  114. package/lib/server/dispatchers/elementHandlerDispatcher.js +7 -2
  115. package/lib/server/dispatchers/frameDispatcher.js +9 -3
  116. package/lib/server/dispatchers/jsonPipeDispatcher.js +2 -2
  117. package/lib/server/dispatchers/localUtilsDispatcher.js +25 -291
  118. package/lib/server/dispatchers/networkDispatchers.js +3 -3
  119. package/lib/server/dispatchers/pageDispatcher.js +10 -8
  120. package/lib/server/dispatchers/playwrightDispatcher.js +5 -5
  121. package/lib/server/dispatchers/streamDispatcher.js +4 -3
  122. package/lib/server/dispatchers/tracingDispatcher.js +10 -0
  123. package/lib/server/dispatchers/webSocketRouteDispatcher.js +18 -18
  124. package/lib/server/dispatchers/writableStreamDispatcher.js +5 -6
  125. package/lib/server/dom.js +102 -48
  126. package/lib/server/download.js +1 -1
  127. package/lib/server/electron/electron.js +17 -16
  128. package/lib/server/errors.js +1 -1
  129. package/lib/server/fetch.js +49 -33
  130. package/lib/server/fileUploadUtils.js +7 -4
  131. package/lib/server/firefox/ffBrowser.js +17 -9
  132. package/lib/server/firefox/ffConnection.js +1 -1
  133. package/lib/server/firefox/ffExecutionContext.js +25 -29
  134. package/lib/server/firefox/ffInput.js +15 -4
  135. package/lib/server/firefox/ffNetworkManager.js +3 -3
  136. package/lib/server/firefox/ffPage.js +29 -50
  137. package/lib/server/firefox/firefox.js +7 -9
  138. package/lib/server/frameSelectors.js +1 -1
  139. package/lib/server/frames.js +65 -55
  140. package/lib/server/har/harRecorder.js +4 -4
  141. package/lib/server/har/harTracer.js +8 -9
  142. package/lib/server/harBackend.js +157 -0
  143. package/lib/server/helper.js +2 -2
  144. package/lib/server/index.js +1 -14
  145. package/lib/server/input.js +3 -4
  146. package/lib/server/instrumentation.js +2 -2
  147. package/lib/server/isomorphic/utilityScriptSerializers.js +3 -0
  148. package/lib/server/javascript.js +26 -33
  149. package/lib/server/launchApp.js +7 -7
  150. package/lib/server/localUtils.js +203 -0
  151. package/lib/server/network.js +5 -5
  152. package/lib/server/page.js +76 -37
  153. package/lib/server/pipeTransport.js +1 -1
  154. package/lib/server/playwright.js +5 -5
  155. package/lib/server/progress.js +1 -4
  156. package/lib/server/protocolError.js +1 -1
  157. package/lib/server/recorder/chat.js +177 -0
  158. package/lib/server/recorder/codeGenerator.js +154 -0
  159. package/lib/server/recorder/contextRecorder.js +9 -18
  160. package/lib/server/recorder/csharp.js +311 -0
  161. package/lib/server/recorder/java.js +249 -0
  162. package/lib/server/recorder/javascript.js +230 -0
  163. package/lib/server/recorder/jsonl.js +48 -0
  164. package/lib/server/recorder/language.js +45 -0
  165. package/lib/server/recorder/python.js +276 -0
  166. package/lib/server/recorder/recorderActions.js +6 -0
  167. package/lib/server/recorder/recorderApp.js +25 -28
  168. package/lib/server/recorder/recorderCollection.js +9 -21
  169. package/lib/server/recorder/recorderInTraceViewer.js +1 -1
  170. package/lib/server/recorder/recorderRunner.js +7 -3
  171. package/lib/server/recorder/recorderUtils.js +5 -28
  172. package/lib/server/recorder/throttledFile.js +3 -4
  173. package/lib/server/recorder/utils.js +46 -0
  174. package/lib/server/recorder.js +83 -43
  175. package/lib/server/registry/browserFetcher.js +10 -8
  176. package/lib/server/registry/dependencies.js +20 -20
  177. package/lib/server/registry/index.js +215 -61
  178. package/lib/server/registry/nativeDeps.js +10 -4
  179. package/lib/server/registry/oopDownloadBrowserMain.js +3 -3
  180. package/lib/server/screenshotter.js +1 -1
  181. package/lib/server/selectors.js +3 -3
  182. package/lib/server/socksClientCertificatesInterceptor.js +8 -8
  183. package/lib/server/socksInterceptor.js +8 -5
  184. package/lib/server/storageScript.js +160 -0
  185. package/lib/server/timeoutSettings.js +74 -0
  186. package/lib/server/trace/recorder/snapshotter.js +10 -20
  187. package/lib/server/trace/recorder/snapshotterInjected.js +26 -1
  188. package/lib/server/trace/recorder/tracing.js +108 -45
  189. package/lib/server/trace/test/inMemorySnapshotter.js +6 -6
  190. package/lib/server/trace/viewer/traceViewer.js +21 -7
  191. package/lib/server/transport.js +3 -2
  192. package/lib/server/utils/ascii.js +31 -0
  193. package/lib/server/utils/comparators.js +159 -0
  194. package/lib/server/utils/crypto.js +171 -0
  195. package/lib/server/utils/debug.js +38 -0
  196. package/lib/server/utils/debugLogger.js +93 -0
  197. package/lib/server/utils/env.js +53 -0
  198. package/lib/server/utils/eventsHelper.js +38 -0
  199. package/lib/server/utils/expectUtils.js +33 -0
  200. package/lib/server/utils/fileUtils.js +204 -0
  201. package/lib/server/utils/happyEyeballs.js +207 -0
  202. package/lib/server/utils/hostPlatform.js +145 -0
  203. package/lib/server/utils/httpServer.js +233 -0
  204. package/lib/server/utils/image_tools/colorUtils.js +98 -0
  205. package/lib/server/utils/image_tools/compare.js +108 -0
  206. package/lib/server/utils/image_tools/imageChannel.js +70 -0
  207. package/lib/server/utils/image_tools/stats.js +102 -0
  208. package/lib/server/utils/linuxUtils.js +58 -0
  209. package/lib/server/utils/network.js +160 -0
  210. package/lib/server/utils/nodePlatform.js +140 -0
  211. package/lib/server/utils/pipeTransport.js +82 -0
  212. package/lib/server/utils/processLauncher.js +248 -0
  213. package/lib/server/utils/profiler.js +52 -0
  214. package/lib/server/utils/socksProxy.js +570 -0
  215. package/lib/server/utils/spawnAsync.js +45 -0
  216. package/lib/server/utils/task.js +58 -0
  217. package/lib/server/utils/userAgent.js +91 -0
  218. package/lib/server/utils/wsServer.js +128 -0
  219. package/lib/server/utils/zipFile.js +75 -0
  220. package/lib/server/utils/zones.js +54 -0
  221. package/lib/server/webkit/webkit.js +4 -4
  222. package/lib/server/webkit/wkBrowser.js +10 -10
  223. package/lib/server/webkit/wkConnection.js +1 -1
  224. package/lib/server/webkit/wkExecutionContext.js +26 -30
  225. package/lib/server/webkit/wkInput.js +17 -7
  226. package/lib/server/webkit/wkInterceptableRequest.js +2 -2
  227. package/lib/server/webkit/wkPage.js +80 -66
  228. package/lib/server/webkit/wkProvisionalPage.js +1 -1
  229. package/lib/server/webkit/wkWorkers.js +2 -2
  230. package/lib/utils/fileUtils.js +1 -1
  231. package/lib/utils/glob.js +84 -0
  232. package/lib/utils/isomorphic/ariaSnapshot.js +392 -0
  233. package/lib/utils/isomorphic/assert.js +25 -0
  234. package/lib/utils/isomorphic/colors.js +65 -0
  235. package/lib/utils/isomorphic/cssParser.js +5 -5
  236. package/lib/utils/isomorphic/headers.js +52 -0
  237. package/lib/utils/isomorphic/locatorGenerators.js +38 -8
  238. package/lib/utils/isomorphic/locatorParser.js +19 -13
  239. package/lib/utils/isomorphic/manualPromise.js +107 -0
  240. package/lib/utils/isomorphic/mimeType.js +11 -3
  241. package/lib/utils/isomorphic/multimap.js +73 -0
  242. package/lib/utils/isomorphic/rtti.js +41 -0
  243. package/lib/utils/isomorphic/semaphore.js +51 -0
  244. package/lib/utils/isomorphic/stackTrace.js +169 -0
  245. package/lib/utils/isomorphic/stringUtils.js +31 -1
  246. package/lib/utils/isomorphic/time.js +25 -0
  247. package/lib/utils/isomorphic/timeoutRunner.js +66 -0
  248. package/lib/utils/isomorphic/traceUtils.js +23 -0
  249. package/lib/utils/isomorphic/types.js +5 -0
  250. package/lib/utils/isomorphic/urlMatch.js +7 -5
  251. package/lib/utils/mimeType.js +30 -0
  252. package/lib/utils/stackTrace.js +1 -1
  253. package/lib/utils.js +447 -0
  254. package/lib/utilsBundle.js +4 -29
  255. package/lib/utilsBundleImpl/index.js +188 -33
  256. package/lib/vite/htmlReport/index.html +20 -17
  257. package/lib/vite/recorder/assets/codeMirrorModule-B9YMkrwa.js +24 -0
  258. package/lib/vite/recorder/assets/index-ELPgmkwA.js +184 -0
  259. package/lib/vite/recorder/assets/{index-BW-aOBcL.css → index-eHBmevrY.css} +1 -1
  260. package/lib/vite/recorder/index.html +2 -2
  261. package/lib/vite/traceViewer/assets/codeMirrorModule-gU1OOCQO.js +24 -0
  262. package/lib/vite/traceViewer/assets/defaultSettingsView-B5n_FjMx.js +1 -0
  263. package/lib/vite/traceViewer/assets/inspectorTab-6Tru8Mn_.js +235 -0
  264. package/lib/vite/traceViewer/assets/workbench-B_Nj4NA2.js +25 -0
  265. package/lib/vite/traceViewer/assets/{xtermModule-BeNbaIVa.js → xtermModule-BoAIEibi.js} +7 -7
  266. package/lib/vite/traceViewer/defaultSettingsView.CO3FR0CX.css +1 -0
  267. package/lib/vite/traceViewer/{embedded.BkvOrz5Z.js → embedded.DpNPH6mk.js} +2 -2
  268. package/lib/vite/traceViewer/embedded.html +6 -6
  269. package/lib/vite/traceViewer/index.CuE3SYGw.js +2 -0
  270. package/lib/vite/traceViewer/index.html +27 -9
  271. package/lib/vite/traceViewer/inspectorTab.CXDulcFG.css +1 -0
  272. package/lib/vite/traceViewer/{recorder.DNMfnSiu.js → recorder.BD-uZJs7.js} +2 -2
  273. package/lib/vite/traceViewer/recorder.html +4 -4
  274. package/lib/vite/traceViewer/sw.bundle.js +3 -3
  275. package/lib/vite/traceViewer/{uiMode.CAYqod-m.css → uiMode.BatfzHMG.css} +1 -1
  276. package/lib/vite/traceViewer/uiMode.DHrNgddz.js +5 -0
  277. package/lib/vite/traceViewer/uiMode.html +8 -7
  278. package/lib/vite/traceViewer/workbench.B9vIAzH9.css +1 -0
  279. package/lib/zipBundleImpl.js +4 -4
  280. package/package.json +7 -7
  281. package/types/protocol.d.ts +820 -153
  282. package/types/types.d.ts +285 -82
  283. package/bin/PrintDeps.exe +0 -0
  284. package/bin/README.md +0 -2
  285. package/lib/vite/recorder/assets/codeMirrorModule-d0KhC1qL.js +0 -24
  286. package/lib/vite/recorder/assets/index-Bxxcmxlu.js +0 -42
  287. package/lib/vite/traceViewer/assets/codeMirrorModule-pBPtArIT.js +0 -24
  288. package/lib/vite/traceViewer/assets/codeMirrorModule-tzBrK1V4.js +0 -24
  289. package/lib/vite/traceViewer/assets/inspectorTab-BuJ3wAX_.js +0 -64
  290. package/lib/vite/traceViewer/assets/inspectorTab-Soeeuvzv.js +0 -64
  291. package/lib/vite/traceViewer/assets/testServerConnection-DeE2kSzz.js +0 -1
  292. package/lib/vite/traceViewer/assets/workbench-DdmJ9AJV.js +0 -9
  293. package/lib/vite/traceViewer/assets/workbench-lypYlf00.js +0 -9
  294. package/lib/vite/traceViewer/embedded.DInvAijy.js +0 -2
  295. package/lib/vite/traceViewer/index.Dha3cgqs.js +0 -2
  296. package/lib/vite/traceViewer/index._Iolt-uE.js +0 -2
  297. package/lib/vite/traceViewer/inspectorTab.DLjBDrQR.css +0 -1
  298. package/lib/vite/traceViewer/recorder.DTSaNaly.js +0 -2
  299. package/lib/vite/traceViewer/uiMode.BM7yhjzl.js +0 -5
  300. package/lib/vite/traceViewer/uiMode.Cr1tvTWS.js +0 -5
  301. package/lib/vite/traceViewer/workbench.DlsCx8k5.css +0 -1
  302. /package/lib/vite/recorder/assets/{codeMirrorModule-ez37Vkbh.css → codeMirrorModule-C3UTv-Ge.css} +0 -0
  303. /package/lib/vite/traceViewer/{codeMirrorModule.ez37Vkbh.css → codeMirrorModule.C3UTv-Ge.css} +0 -0
  304. /package/lib/vite/traceViewer/{embedded.w7WN2u1R.css → embedded.mLhjB5IF.css} +0 -0
  305. /package/lib/vite/traceViewer/{index.CrbWWHbf.css → index.CFOW-Ezb.css} +0 -0
  306. /package/lib/vite/traceViewer/{recorder.B_SY1GJM.css → recorder.tn0RQdqM.css} +0 -0
  307. /package/lib/vite/traceViewer/{xtermModule.DSXBckUd.css → xtermModule.Beg8tuEN.css} +0 -0
@@ -4,11 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Page = exports.BindingCall = void 0;
7
- var _fs = _interopRequireDefault(require("fs"));
8
- var _path = _interopRequireDefault(require("path"));
9
- var _errors = require("./errors");
10
- var _timeoutSettings = require("../common/timeoutSettings");
11
- var _utils = require("../utils");
12
7
  var _accessibility = require("./accessibility");
13
8
  var _artifact = require("./artifact");
14
9
  var _channelOwner = require("./channelOwner");
@@ -16,17 +11,25 @@ var _clientHelper = require("./clientHelper");
16
11
  var _coverage = require("./coverage");
17
12
  var _download = require("./download");
18
13
  var _elementHandle = require("./elementHandle");
14
+ var _errors = require("./errors");
19
15
  var _events = require("./events");
20
16
  var _fileChooser = require("./fileChooser");
21
17
  var _frame = require("./frame");
18
+ var _harRouter = require("./harRouter");
22
19
  var _input = require("./input");
23
20
  var _jsHandle = require("./jsHandle");
24
21
  var _network = require("./network");
25
22
  var _video = require("./video");
26
23
  var _waiter = require("./waiter");
27
24
  var _worker = require("./worker");
28
- var _harRouter = require("./harRouter");
29
- let _Symbol$asyncDispose;
25
+ var _timeoutSettings = require("./timeoutSettings");
26
+ var _assert = require("../utils/isomorphic/assert");
27
+ var _fileUtils = require("./fileUtils");
28
+ var _headers = require("../utils/isomorphic/headers");
29
+ var _stringUtils = require("../utils/isomorphic/stringUtils");
30
+ var _urlMatch = require("../utils/isomorphic/urlMatch");
31
+ var _manualPromise = require("../utils/isomorphic/manualPromise");
32
+ var _rtti = require("../utils/isomorphic/rtti");
30
33
  /**
31
34
  * Copyright 2017 Google Inc. All rights reserved.
32
35
  * Modifications copyright (c) Microsoft Corporation.
@@ -43,8 +46,7 @@ let _Symbol$asyncDispose;
43
46
  * See the License for the specific language governing permissions and
44
47
  * limitations under the License.
45
48
  */
46
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
47
- _Symbol$asyncDispose = Symbol.asyncDispose;
49
+
48
50
  class Page extends _channelOwner.ChannelOwner {
49
51
  static from(page) {
50
52
  return page._object;
@@ -60,7 +62,7 @@ class Page extends _channelOwner.ChannelOwner {
60
62
  this._frames = new Set();
61
63
  this._workers = new Set();
62
64
  this._closed = false;
63
- this._closedOrCrashedScope = new _utils.LongStandingScope();
65
+ this._closedOrCrashedScope = new _manualPromise.LongStandingScope();
64
66
  this._viewportSize = void 0;
65
67
  this._routes = [];
66
68
  this._webSocketRoutes = [];
@@ -80,7 +82,7 @@ class Page extends _channelOwner.ChannelOwner {
80
82
  this._harRouters = [];
81
83
  this._locatorHandlers = new Map();
82
84
  this._browserContext = parent;
83
- this._timeoutSettings = new _timeoutSettings.TimeoutSettings(this._browserContext._timeoutSettings);
85
+ this._timeoutSettings = new _timeoutSettings.TimeoutSettings(this._platform, this._browserContext._timeoutSettings);
84
86
  this.accessibility = new _accessibility.Accessibility(this._channel);
85
87
  this.keyboard = new _input.Keyboard(this);
86
88
  this.mouse = new _input.Mouse(this);
@@ -208,12 +210,12 @@ class Page extends _channelOwner.ChannelOwner {
208
210
  return this._mainFrame;
209
211
  }
210
212
  frame(frameSelector) {
211
- const name = (0, _utils.isString)(frameSelector) ? frameSelector : frameSelector.name;
212
- const url = (0, _utils.isObject)(frameSelector) ? frameSelector.url : undefined;
213
- (0, _utils.assert)(name || url, 'Either name or url matcher should be specified');
213
+ const name = (0, _rtti.isString)(frameSelector) ? frameSelector : frameSelector.name;
214
+ const url = (0, _rtti.isObject)(frameSelector) ? frameSelector.url : undefined;
215
+ (0, _assert.assert)(name || url, 'Either name or url matcher should be specified');
214
216
  return this.frames().find(f => {
215
217
  if (name) return f.name() === name;
216
- return (0, _utils.urlMatches)(this._browserContext._options.baseURL, f.url(), url);
218
+ return (0, _urlMatch.urlMatches)(this._browserContext._options.baseURL, f.url(), url);
217
219
  }) || null;
218
220
  }
219
221
  frames() {
@@ -222,18 +224,18 @@ class Page extends _channelOwner.ChannelOwner {
222
224
  setDefaultNavigationTimeout(timeout) {
223
225
  this._timeoutSettings.setDefaultNavigationTimeout(timeout);
224
226
  this._wrapApiCall(async () => {
225
- this._channel.setDefaultNavigationTimeoutNoReply({
227
+ await this._channel.setDefaultNavigationTimeoutNoReply({
226
228
  timeout
227
- }).catch(() => {});
228
- }, true);
229
+ });
230
+ }, true).catch(() => {});
229
231
  }
230
232
  setDefaultTimeout(timeout) {
231
233
  this._timeoutSettings.setDefaultTimeout(timeout);
232
234
  this._wrapApiCall(async () => {
233
- this._channel.setDefaultTimeoutNoReply({
235
+ await this._channel.setDefaultTimeoutNoReply({
234
236
  timeout
235
- }).catch(() => {});
236
- }, true);
237
+ });
238
+ }, true).catch(() => {});
237
239
  }
238
240
  _forceVideo() {
239
241
  if (!this._video) this._video = new _video.Video(this, this._connection);
@@ -293,7 +295,7 @@ class Page extends _channelOwner.ChannelOwner {
293
295
  async setExtraHTTPHeaders(headers) {
294
296
  (0, _network.validateHeaders)(headers);
295
297
  await this._channel.setExtraHTTPHeaders({
296
- headers: (0, _utils.headersObjectToArray)(headers)
298
+ headers: (0, _headers.headersObjectToArray)(headers)
297
299
  });
298
300
  }
299
301
  url() {
@@ -368,7 +370,7 @@ class Page extends _channelOwner.ChannelOwner {
368
370
  }
369
371
  async waitForRequest(urlOrPredicate, options = {}) {
370
372
  const predicate = async request => {
371
- if ((0, _utils.isString)(urlOrPredicate) || (0, _utils.isRegExp)(urlOrPredicate)) return (0, _utils.urlMatches)(this._browserContext._options.baseURL, request.url(), urlOrPredicate);
373
+ if ((0, _rtti.isString)(urlOrPredicate) || (0, _rtti.isRegExp)(urlOrPredicate)) return (0, _urlMatch.urlMatches)(this._browserContext._options.baseURL, request.url(), urlOrPredicate);
372
374
  return await urlOrPredicate(request);
373
375
  };
374
376
  const trimmedUrl = trimUrl(urlOrPredicate);
@@ -380,7 +382,7 @@ class Page extends _channelOwner.ChannelOwner {
380
382
  }
381
383
  async waitForResponse(urlOrPredicate, options = {}) {
382
384
  const predicate = async response => {
383
- if ((0, _utils.isString)(urlOrPredicate) || (0, _utils.isRegExp)(urlOrPredicate)) return (0, _utils.urlMatches)(this._browserContext._options.baseURL, response.url(), urlOrPredicate);
385
+ if ((0, _rtti.isString)(urlOrPredicate) || (0, _rtti.isRegExp)(urlOrPredicate)) return (0, _urlMatch.urlMatches)(this._browserContext._options.baseURL, response.url(), urlOrPredicate);
384
386
  return await urlOrPredicate(response);
385
387
  };
386
388
  const trimmedUrl = trimUrl(urlOrPredicate);
@@ -432,7 +434,8 @@ class Page extends _channelOwner.ChannelOwner {
432
434
  media: options.media === null ? 'no-override' : options.media,
433
435
  colorScheme: options.colorScheme === null ? 'no-override' : options.colorScheme,
434
436
  reducedMotion: options.reducedMotion === null ? 'no-override' : options.reducedMotion,
435
- forcedColors: options.forcedColors === null ? 'no-override' : options.forcedColors
437
+ forcedColors: options.forcedColors === null ? 'no-override' : options.forcedColors,
438
+ contrast: options.contrast === null ? 'no-override' : options.contrast
436
439
  });
437
440
  }
438
441
  async setViewportSize(viewportSize) {
@@ -449,21 +452,23 @@ class Page extends _channelOwner.ChannelOwner {
449
452
  return await this._mainFrame.evaluate(pageFunction, arg);
450
453
  }
451
454
  async addInitScript(script, arg) {
452
- const source = await (0, _clientHelper.evaluationScript)(script, arg);
455
+ const source = await (0, _clientHelper.evaluationScript)(this._platform, script, arg);
453
456
  await this._channel.addInitScript({
454
457
  source
455
458
  });
456
459
  }
457
460
  async route(url, handler, options = {}) {
458
- this._routes.unshift(new _network.RouteHandler(this._browserContext._options.baseURL, url, handler, options.times));
461
+ this._routes.unshift(new _network.RouteHandler(this._platform, this._browserContext._options.baseURL, url, handler, options.times));
459
462
  await this._updateInterceptionPatterns();
460
463
  }
461
464
  async routeFromHAR(har, options = {}) {
465
+ const localUtils = this._connection.localUtils();
466
+ if (!localUtils) throw new Error('Route from har is not supported in thin clients');
462
467
  if (options.update) {
463
468
  await this._browserContext._recordIntoHAR(har, this, options);
464
469
  return;
465
470
  }
466
- const harRouter = await _harRouter.HarRouter.create(this._connection.localUtils(), har, options.notFound || 'abort', {
471
+ const harRouter = await _harRouter.HarRouter.create(localUtils, har, options.notFound || 'abort', {
467
472
  urlMatch: options.url
468
473
  });
469
474
  this._harRouters.push(harRouter);
@@ -485,7 +490,7 @@ class Page extends _channelOwner.ChannelOwner {
485
490
  const removed = [];
486
491
  const remaining = [];
487
492
  for (const route of this._routes) {
488
- if ((0, _utils.urlMatchesEqual)(route.url, url) && (!handler || route.handler === handler)) removed.push(route);else remaining.push(route);
493
+ if ((0, _urlMatch.urlMatchesEqual)(route.url, url) && (!handler || route.handler === handler)) removed.push(route);else remaining.push(route);
489
494
  }
490
495
  await this._unrouteInternal(removed, remaining, 'default');
491
496
  }
@@ -509,21 +514,22 @@ class Page extends _channelOwner.ChannelOwner {
509
514
  });
510
515
  }
511
516
  async screenshot(options = {}) {
517
+ const mask = options.mask;
512
518
  const copy = {
513
519
  ...options,
514
520
  mask: undefined
515
521
  };
516
522
  if (!copy.type) copy.type = (0, _elementHandle.determineScreenshotType)(options);
517
- if (options.mask) {
518
- copy.mask = options.mask.map(locator => ({
523
+ if (mask) {
524
+ copy.mask = mask.map(locator => ({
519
525
  frame: locator._frame._channel,
520
526
  selector: locator._selector
521
527
  }));
522
528
  }
523
529
  const result = await this._channel.screenshot(copy);
524
530
  if (options.path) {
525
- await (0, _utils.mkdirIfNeeded)(options.path);
526
- await _fs.default.promises.writeFile(options.path, result.binary);
531
+ await (0, _fileUtils.mkdirIfNeeded)(this._platform, options.path);
532
+ await this._platform.fs().promises.writeFile(options.path, result.binary);
527
533
  }
528
534
  return result.binary;
529
535
  }
@@ -549,7 +555,7 @@ class Page extends _channelOwner.ChannelOwner {
549
555
  async bringToFront() {
550
556
  await this._channel.bringToFront();
551
557
  }
552
- async [_Symbol$asyncDispose]() {
558
+ async [Symbol.asyncDispose]() {
553
559
  await this.close();
554
560
  }
555
561
  async close(options = {}) {
@@ -676,14 +682,16 @@ class Page extends _channelOwner.ChannelOwner {
676
682
  workers() {
677
683
  return [...this._workers];
678
684
  }
679
- async pause() {
685
+ async pause(_options) {
680
686
  var _this$_instrumentatio;
681
- if (require('inspector').url()) return;
687
+ if (this._platform.isJSDebuggerAttached()) return;
682
688
  const defaultNavigationTimeout = this._browserContext._timeoutSettings.defaultNavigationTimeout();
683
689
  const defaultTimeout = this._browserContext._timeoutSettings.defaultTimeout();
684
690
  this._browserContext.setDefaultNavigationTimeout(0);
685
691
  this._browserContext.setDefaultTimeout(0);
686
- (_this$_instrumentatio = this._instrumentation) === null || _this$_instrumentatio === void 0 || _this$_instrumentatio.onWillPause();
692
+ (_this$_instrumentatio = this._instrumentation) === null || _this$_instrumentatio === void 0 || _this$_instrumentatio.onWillPause({
693
+ keepTestTimeout: !!(_options !== null && _options !== void 0 && _options.__testHookKeepTestTimeout)
694
+ });
687
695
  await this._closedOrCrashedScope.safeRace(this.context()._channel.pause());
688
696
  this._browserContext.setDefaultNavigationTimeout(defaultNavigationTimeout);
689
697
  this._browserContext.setDefaultTimeout(defaultTimeout);
@@ -703,10 +711,11 @@ class Page extends _channelOwner.ChannelOwner {
703
711
  }
704
712
  const result = await this._channel.pdf(transportOptions);
705
713
  if (options.path) {
706
- await _fs.default.promises.mkdir(_path.default.dirname(options.path), {
714
+ const platform = this._platform;
715
+ await platform.fs().promises.mkdir(platform.path().dirname(options.path), {
707
716
  recursive: true
708
717
  });
709
- await _fs.default.promises.writeFile(options.path, result.pdf);
718
+ await platform.fs().promises.writeFile(options.path, result.pdf);
710
719
  }
711
720
  return result.pdf;
712
721
  }
@@ -741,6 +750,6 @@ class BindingCall extends _channelOwner.ChannelOwner {
741
750
  }
742
751
  exports.BindingCall = BindingCall;
743
752
  function trimUrl(param) {
744
- if ((0, _utils.isRegExp)(param)) return `/${(0, _utils.trimStringWithEllipsis)(param.source, 50)}/${param.flags}`;
745
- if ((0, _utils.isString)(param)) return `"${(0, _utils.trimStringWithEllipsis)(param, 50)}"`;
753
+ if ((0, _rtti.isRegExp)(param)) return `/${(0, _stringUtils.trimStringWithEllipsis)(param.source, 50)}/${param.flags}`;
754
+ if ((0, _rtti.isString)(param)) return `"${(0, _stringUtils.trimStringWithEllipsis)(param, 50)}"`;
746
755
  }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.emptyPlatform = void 0;
7
+ var _colors = require("../utils/isomorphic/colors");
8
+ /**
9
+ * Copyright (c) Microsoft Corporation.
10
+ *
11
+ * Licensed under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License.
13
+ * You may obtain a copy of the License at
14
+ *
15
+ * http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software
18
+ * distributed under the License is distributed on an "AS IS" BASIS,
19
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ * See the License for the specific language governing permissions and
21
+ * limitations under the License.
22
+ */
23
+
24
+ const noopZone = {
25
+ push: () => noopZone,
26
+ pop: () => noopZone,
27
+ run: func => func(),
28
+ data: () => undefined
29
+ };
30
+ const emptyPlatform = exports.emptyPlatform = {
31
+ name: 'empty',
32
+ boxedStackPrefixes: () => [],
33
+ calculateSha1: async () => {
34
+ throw new Error('Not implemented');
35
+ },
36
+ colors: _colors.webColors,
37
+ createGuid: () => {
38
+ throw new Error('Not implemented');
39
+ },
40
+ defaultMaxListeners: () => 10,
41
+ env: {},
42
+ fs: () => {
43
+ throw new Error('Not implemented');
44
+ },
45
+ inspectCustom: undefined,
46
+ isDebugMode: () => false,
47
+ isJSDebuggerAttached: () => false,
48
+ isLogEnabled(name) {
49
+ return false;
50
+ },
51
+ isUnderTest: () => false,
52
+ log(name, message) {},
53
+ path: () => {
54
+ throw new Error('Function not implemented.');
55
+ },
56
+ pathSeparator: '/',
57
+ showInternalStackFrames: () => false,
58
+ streamFile(path, writable) {
59
+ throw new Error('Streams are not available');
60
+ },
61
+ streamReadable: channel => {
62
+ throw new Error('Streams are not available');
63
+ },
64
+ streamWritable: channel => {
65
+ throw new Error('Streams are not available');
66
+ },
67
+ zones: {
68
+ empty: noopZone,
69
+ current: () => noopZone
70
+ }
71
+ };
@@ -4,11 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Playwright = void 0;
7
- var _errors = require("./errors");
8
7
  var _android = require("./android");
8
+ var _browser = require("./browser");
9
9
  var _browserType = require("./browserType");
10
10
  var _channelOwner = require("./channelOwner");
11
11
  var _electron = require("./electron");
12
+ var _errors = require("./errors");
12
13
  var _fetch = require("./fetch");
13
14
  var _selectors = require("./selectors");
14
15
  /**
@@ -42,6 +43,11 @@ class Playwright extends _channelOwner.ChannelOwner {
42
43
  this.selectors = void 0;
43
44
  this.request = void 0;
44
45
  this.errors = void 0;
46
+ // Instrumentation.
47
+ this._defaultLaunchOptions = void 0;
48
+ this._defaultContextOptions = void 0;
49
+ this._defaultContextTimeout = void 0;
50
+ this._defaultContextNavigationTimeout = void 0;
45
51
  this.request = new _fetch.APIRequest(this);
46
52
  this.chromium = _browserType.BrowserType.from(initializer.chromium);
47
53
  this.chromium._playwright = this;
@@ -76,5 +82,19 @@ class Playwright extends _channelOwner.ChannelOwner {
76
82
  static from(channel) {
77
83
  return channel._object;
78
84
  }
85
+ _browserTypes() {
86
+ return [this.chromium, this.firefox, this.webkit, this._bidiChromium, this._bidiFirefox];
87
+ }
88
+ _preLaunchedBrowser() {
89
+ const browser = _browser.Browser.from(this._initializer.preLaunchedBrowser);
90
+ browser._browserType = this[browser._name];
91
+ return browser;
92
+ }
93
+ _allContexts() {
94
+ return this._browserTypes().flatMap(type => [...type._contexts]);
95
+ }
96
+ _allPages() {
97
+ return this._allContexts().flatMap(context => context.pages());
98
+ }
79
99
  }
80
100
  exports.Playwright = Playwright;
@@ -4,9 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.SelectorsOwner = exports.Selectors = void 0;
7
- var _clientHelper = require("./clientHelper");
7
+ exports.setPlatformForSelectors = setPlatformForSelectors;
8
8
  var _channelOwner = require("./channelOwner");
9
+ var _clientHelper = require("./clientHelper");
9
10
  var _locator = require("./locator");
11
+ var _platform = require("./platform");
10
12
  /**
11
13
  * Copyright (c) Microsoft Corporation.
12
14
  *
@@ -23,13 +25,17 @@ var _locator = require("./locator");
23
25
  * limitations under the License.
24
26
  */
25
27
 
28
+ let platform = _platform.emptyPlatform;
29
+ function setPlatformForSelectors(p) {
30
+ platform = p;
31
+ }
26
32
  class Selectors {
27
33
  constructor() {
28
34
  this._channels = new Set();
29
35
  this._registrations = [];
30
36
  }
31
37
  async register(name, script, options = {}) {
32
- const source = await (0, _clientHelper.evaluationScript)(script, undefined, false);
38
+ const source = await (0, _clientHelper.evaluationScript)(platform, script, undefined, false);
33
39
  const params = {
34
40
  ...options,
35
41
  name,
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Stream = void 0;
7
- var _stream = require("stream");
8
7
  var _channelOwner = require("./channelOwner");
9
8
  /**
10
9
  * Copyright (c) Microsoft Corporation.
@@ -30,25 +29,7 @@ class Stream extends _channelOwner.ChannelOwner {
30
29
  super(parent, type, guid, initializer);
31
30
  }
32
31
  stream() {
33
- return new StreamImpl(this._channel);
32
+ return this._platform.streamReadable(this._channel);
34
33
  }
35
34
  }
36
- exports.Stream = Stream;
37
- class StreamImpl extends _stream.Readable {
38
- constructor(channel) {
39
- super();
40
- this._channel = void 0;
41
- this._channel = channel;
42
- }
43
- async _read() {
44
- const result = await this._channel.read({
45
- size: 1024 * 1024
46
- });
47
- if (result.binary.byteLength) this.push(result.binary);else this.push(null);
48
- }
49
- _destroy(error, callback) {
50
- // Stream might be destroyed after the connection was closed.
51
- this._channel.close().catch(e => null);
52
- super._destroy(error, callback);
53
- }
54
- }
35
+ exports.Stream = Stream;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TimeoutSettings = exports.DEFAULT_TIMEOUT = exports.DEFAULT_LAUNCH_TIMEOUT = void 0;
7
+ /**
8
+ * Copyright 2019 Google Inc. All rights reserved.
9
+ * Modifications copyright (c) Microsoft Corporation.
10
+ *
11
+ * Licensed under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License.
13
+ * You may obtain a copy of the License at
14
+ *
15
+ * http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software
18
+ * distributed under the License is distributed on an "AS IS" BASIS,
19
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ * See the License for the specific language governing permissions and
21
+ * limitations under the License.
22
+ */
23
+
24
+ // Keep in sync with server.
25
+ const DEFAULT_TIMEOUT = exports.DEFAULT_TIMEOUT = 30000;
26
+ const DEFAULT_LAUNCH_TIMEOUT = exports.DEFAULT_LAUNCH_TIMEOUT = 3 * 60 * 1000; // 3 minutes
27
+
28
+ class TimeoutSettings {
29
+ constructor(platform, parent) {
30
+ this._parent = void 0;
31
+ this._defaultTimeout = void 0;
32
+ this._defaultNavigationTimeout = void 0;
33
+ this._platform = void 0;
34
+ this._parent = parent;
35
+ this._platform = platform;
36
+ }
37
+ setDefaultTimeout(timeout) {
38
+ this._defaultTimeout = timeout;
39
+ }
40
+ setDefaultNavigationTimeout(timeout) {
41
+ this._defaultNavigationTimeout = timeout;
42
+ }
43
+ defaultNavigationTimeout() {
44
+ return this._defaultNavigationTimeout;
45
+ }
46
+ defaultTimeout() {
47
+ return this._defaultTimeout;
48
+ }
49
+ navigationTimeout(options) {
50
+ if (typeof options.timeout === 'number') return options.timeout;
51
+ if (this._defaultNavigationTimeout !== undefined) return this._defaultNavigationTimeout;
52
+ if (this._platform.isDebugMode()) return 0;
53
+ if (this._defaultTimeout !== undefined) return this._defaultTimeout;
54
+ if (this._parent) return this._parent.navigationTimeout(options);
55
+ return DEFAULT_TIMEOUT;
56
+ }
57
+ timeout(options) {
58
+ if (typeof options.timeout === 'number') return options.timeout;
59
+ if (this._platform.isDebugMode()) return 0;
60
+ if (this._defaultTimeout !== undefined) return this._defaultTimeout;
61
+ if (this._parent) return this._parent.timeout(options);
62
+ return DEFAULT_TIMEOUT;
63
+ }
64
+ }
65
+ exports.TimeoutSettings = TimeoutSettings;
@@ -56,16 +56,30 @@ class Tracing extends _channelOwner.ChannelOwner {
56
56
  } = await this._channel.tracingStartChunk(options);
57
57
  await this._startCollectingStacks(traceName);
58
58
  }
59
+ async group(name, options = {}) {
60
+ await this._wrapApiCall(async () => {
61
+ await this._channel.tracingGroup({
62
+ name,
63
+ location: options.location
64
+ });
65
+ }, false);
66
+ }
67
+ async groupEnd() {
68
+ await this._wrapApiCall(async () => {
69
+ await this._channel.tracingGroupEnd();
70
+ }, false);
71
+ }
59
72
  async _startCollectingStacks(traceName) {
73
+ var _this$_connection$loc;
60
74
  if (!this._isTracing) {
61
75
  this._isTracing = true;
62
76
  this._connection.setIsTracing(true);
63
77
  }
64
- const result = await this._connection.localUtils()._channel.tracingStarted({
78
+ const result = await ((_this$_connection$loc = this._connection.localUtils()) === null || _this$_connection$loc === void 0 ? void 0 : _this$_connection$loc.tracingStarted({
65
79
  tracesDir: this._tracesDir,
66
80
  traceName
67
- });
68
- this._stacksId = result.stacksId;
81
+ }));
82
+ this._stacksId = result === null || result === void 0 ? void 0 : result.stacksId;
69
83
  }
70
84
  async stopChunk(options = {}) {
71
85
  await this._doStopChunk(options.path);
@@ -81,17 +95,19 @@ class Tracing extends _channelOwner.ChannelOwner {
81
95
  await this._channel.tracingStopChunk({
82
96
  mode: 'discard'
83
97
  });
84
- if (this._stacksId) await this._connection.localUtils()._channel.traceDiscarded({
98
+ if (this._stacksId) await this._connection.localUtils().traceDiscarded({
85
99
  stacksId: this._stacksId
86
100
  });
87
101
  return;
88
102
  }
103
+ const localUtils = this._connection.localUtils();
104
+ if (!localUtils) throw new Error('Cannot save trace in thin clients');
89
105
  const isLocal = !this._connection.isRemote();
90
106
  if (isLocal) {
91
107
  const result = await this._channel.tracingStopChunk({
92
108
  mode: 'entries'
93
109
  });
94
- await this._connection.localUtils()._channel.zip({
110
+ await localUtils.zip({
95
111
  zipFile: filePath,
96
112
  entries: result.entries,
97
113
  mode: 'write',
@@ -106,7 +122,7 @@ class Tracing extends _channelOwner.ChannelOwner {
106
122
 
107
123
  // The artifact may be missing if the browser closed while stopping tracing.
108
124
  if (!result.artifact) {
109
- if (this._stacksId) await this._connection.localUtils()._channel.traceDiscarded({
125
+ if (this._stacksId) await localUtils.traceDiscarded({
110
126
  stacksId: this._stacksId
111
127
  });
112
128
  return;
@@ -116,7 +132,7 @@ class Tracing extends _channelOwner.ChannelOwner {
116
132
  const artifact = _artifact.Artifact.from(result.artifact);
117
133
  await artifact.saveAs(filePath);
118
134
  await artifact.delete();
119
- await this._connection.localUtils()._channel.zip({
135
+ await localUtils.zip({
120
136
  zipFile: filePath,
121
137
  entries: [],
122
138
  mode: 'append',
@@ -130,5 +146,11 @@ class Tracing extends _channelOwner.ChannelOwner {
130
146
  this._connection.setIsTracing(false);
131
147
  }
132
148
  }
149
+ _resetStackCounter() {
150
+ if (this._isTracing) {
151
+ this._isTracing = false;
152
+ this._connection.setIsTracing(false);
153
+ }
154
+ }
133
155
  }
134
156
  exports.Tracing = Tracing;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Video = void 0;
7
- var _utils = require("../utils");
7
+ var _manualPromise = require("../utils/isomorphic/manualPromise");
8
8
  /**
9
9
  * Copyright (c) Microsoft Corporation.
10
10
  *
@@ -24,7 +24,7 @@ var _utils = require("../utils");
24
24
  class Video {
25
25
  constructor(page, connection) {
26
26
  this._artifact = null;
27
- this._artifactReadyPromise = new _utils.ManualPromise();
27
+ this._artifactReadyPromise = new _manualPromise.ManualPromise();
28
28
  this._isRemote = false;
29
29
  this._isRemote = connection.isRemote();
30
30
  this._artifact = page._closedOrCrashedScope.safeRace(this._artifactReadyPromise);