patchright-core 1.52.5 → 1.55.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 (218) hide show
  1. package/ThirdPartyNotices.txt +65 -123
  2. package/bin/reinstall_chrome_beta_mac.sh +1 -1
  3. package/bin/reinstall_chrome_stable_mac.sh +1 -1
  4. package/bin/reinstall_msedge_beta_mac.sh +1 -1
  5. package/bin/reinstall_msedge_dev_mac.sh +1 -1
  6. package/bin/reinstall_msedge_stable_mac.sh +1 -1
  7. package/browsers.json +14 -14
  8. package/index.js +1 -1
  9. package/lib/androidServerImpl.js +4 -2
  10. package/lib/browserServerImpl.js +47 -12
  11. package/lib/cli/program.js +116 -50
  12. package/lib/cli/programWithTestStub.js +1 -1
  13. package/lib/client/android.js +30 -34
  14. package/lib/client/browser.js +54 -17
  15. package/lib/client/browserContext.js +67 -71
  16. package/lib/client/browserType.js +25 -34
  17. package/lib/client/channelOwner.js +20 -24
  18. package/lib/client/connection.js +6 -10
  19. package/lib/client/electron.js +8 -3
  20. package/lib/client/elementHandle.js +18 -21
  21. package/lib/client/fetch.js +5 -3
  22. package/lib/client/frame.js +54 -32
  23. package/lib/client/input.js +3 -1
  24. package/lib/client/jsHandle.js +4 -0
  25. package/lib/client/localUtils.js +0 -1
  26. package/lib/client/locator.js +30 -26
  27. package/lib/client/network.js +5 -12
  28. package/lib/client/page.js +32 -32
  29. package/lib/client/playwright.js +6 -16
  30. package/lib/client/selectors.js +18 -38
  31. package/lib/client/timeoutSettings.js +12 -8
  32. package/lib/client/tracing.js +24 -20
  33. package/lib/client/waiter.js +2 -2
  34. package/lib/client/webSocket.js +4 -22
  35. package/lib/generated/bindingsControllerSource.js +28 -0
  36. package/lib/generated/clockSource.js +1 -1
  37. package/lib/generated/injectedScriptSource.js +1 -1
  38. package/lib/generated/pollingRecorderSource.js +1 -1
  39. package/lib/generated/storageScriptSource.js +28 -0
  40. package/lib/generated/utilityScriptSource.js +1 -1
  41. package/lib/generated/webSocketMockSource.js +12 -50
  42. package/lib/inProcessFactory.js +9 -6
  43. package/lib/outofprocess.js +0 -2
  44. package/lib/protocol/validator.js +421 -345
  45. package/lib/protocol/validatorPrimitives.js +18 -4
  46. package/lib/remote/playwrightConnection.js +29 -166
  47. package/lib/remote/playwrightServer.js +233 -35
  48. package/lib/server/android/android.js +97 -83
  49. package/lib/server/android/backendAdb.js +0 -2
  50. package/lib/server/bidi/bidiBrowser.js +139 -73
  51. package/lib/server/bidi/bidiChromium.js +23 -22
  52. package/lib/server/bidi/bidiExecutionContext.js +2 -1
  53. package/lib/server/bidi/bidiFirefox.js +17 -14
  54. package/lib/server/bidi/bidiInput.js +22 -22
  55. package/lib/server/bidi/bidiNetworkManager.js +8 -11
  56. package/lib/server/bidi/bidiPage.js +42 -86
  57. package/lib/server/bidi/third_party/bidiProtocol.js +5 -133
  58. package/lib/server/bidi/third_party/bidiProtocolCore.js +179 -0
  59. package/lib/server/{dispatchers/selectorsDispatcher.js → bidi/third_party/bidiProtocolPermissions.js} +20 -18
  60. package/lib/server/browser.js +30 -21
  61. package/lib/server/browserContext.js +203 -165
  62. package/lib/server/browserType.js +109 -107
  63. package/lib/server/chromium/chromium.js +84 -69
  64. package/lib/server/chromium/chromiumSwitches.js +13 -20
  65. package/lib/server/chromium/crBrowser.js +74 -40
  66. package/lib/server/chromium/crConnection.js +8 -9
  67. package/lib/server/chromium/crCoverage.js +11 -8
  68. package/lib/server/chromium/crDragDrop.js +25 -20
  69. package/lib/server/chromium/crExecutionContext.js +2 -1
  70. package/lib/server/chromium/crInput.js +32 -29
  71. package/lib/server/chromium/crNetworkManager.js +43 -31
  72. package/lib/server/chromium/crPage.js +98 -72
  73. package/lib/server/chromium/crServiceWorker.js +13 -18
  74. package/lib/server/chromium/videoRecorder.js +10 -18
  75. package/lib/server/clock.js +51 -39
  76. package/lib/server/codegen/csharp.js +10 -5
  77. package/lib/server/codegen/java.js +1 -1
  78. package/lib/server/codegen/javascript.js +1 -1
  79. package/lib/server/codegen/jsonl.js +2 -1
  80. package/lib/server/codegen/language.js +22 -1
  81. package/lib/server/codegen/languages.js +4 -4
  82. package/lib/server/codegen/python.js +1 -1
  83. package/lib/server/cookieStore.js +3 -1
  84. package/lib/server/debugController.js +105 -71
  85. package/lib/server/debugger.js +6 -23
  86. package/lib/server/deviceDescriptorsSource.json +237 -127
  87. package/lib/server/dialog.js +50 -6
  88. package/lib/server/dispatchers/androidDispatcher.js +77 -62
  89. package/lib/server/dispatchers/artifactDispatcher.js +18 -18
  90. package/lib/server/dispatchers/browserContextDispatcher.js +141 -91
  91. package/lib/server/dispatchers/browserDispatcher.js +55 -88
  92. package/lib/server/dispatchers/browserTypeDispatcher.js +18 -9
  93. package/lib/server/dispatchers/cdpSessionDispatcher.js +4 -4
  94. package/lib/server/dispatchers/debugControllerDispatcher.js +12 -21
  95. package/lib/server/dispatchers/dialogDispatcher.js +4 -4
  96. package/lib/server/dispatchers/dispatcher.js +78 -53
  97. package/lib/server/dispatchers/electronDispatcher.js +19 -20
  98. package/lib/server/dispatchers/elementHandlerDispatcher.js +83 -93
  99. package/lib/server/dispatchers/frameDispatcher.js +98 -101
  100. package/lib/server/dispatchers/jsHandleDispatcher.js +21 -16
  101. package/lib/server/dispatchers/jsonPipeDispatcher.js +4 -4
  102. package/lib/server/dispatchers/localUtilsDispatcher.js +53 -59
  103. package/lib/server/dispatchers/networkDispatchers.js +41 -35
  104. package/lib/server/dispatchers/pageDispatcher.js +156 -107
  105. package/lib/server/dispatchers/playwrightDispatcher.js +37 -25
  106. package/lib/server/dispatchers/streamDispatcher.js +15 -8
  107. package/lib/server/dispatchers/tracingDispatcher.js +22 -13
  108. package/lib/server/dispatchers/webSocketRouteDispatcher.js +46 -35
  109. package/lib/server/dispatchers/writableStreamDispatcher.js +16 -10
  110. package/lib/server/dom.js +198 -266
  111. package/lib/server/download.js +3 -3
  112. package/lib/server/electron/electron.js +96 -103
  113. package/lib/server/electron/loader.js +1 -1
  114. package/lib/server/fetch.js +22 -41
  115. package/lib/server/fileUploadUtils.js +1 -1
  116. package/lib/server/firefox/ffBrowser.js +79 -55
  117. package/lib/server/firefox/ffExecutionContext.js +2 -1
  118. package/lib/server/firefox/ffInput.js +23 -23
  119. package/lib/server/firefox/ffNetworkManager.js +8 -6
  120. package/lib/server/firefox/ffPage.js +39 -36
  121. package/lib/server/firefox/firefox.js +9 -10
  122. package/lib/server/frameSelectors.js +63 -20
  123. package/lib/server/frames.js +495 -555
  124. package/lib/server/har/harRecorder.js +1 -1
  125. package/lib/server/har/harTracer.js +4 -2
  126. package/lib/server/helper.js +3 -7
  127. package/lib/server/index.js +0 -3
  128. package/lib/server/input.js +47 -54
  129. package/lib/server/instrumentation.js +8 -14
  130. package/lib/server/javascript.js +8 -16
  131. package/lib/server/launchApp.js +48 -30
  132. package/lib/server/localUtils.js +45 -38
  133. package/lib/server/network.js +44 -10
  134. package/lib/server/page.js +232 -177
  135. package/lib/server/pageBinding.js +6 -7
  136. package/lib/server/playwright.js +4 -14
  137. package/lib/server/progress.js +57 -49
  138. package/lib/server/recorder/recorderApp.js +298 -95
  139. package/lib/server/recorder/recorderRunner.js +23 -24
  140. package/lib/server/recorder/recorderSignalProcessor.js +83 -0
  141. package/lib/server/recorder/recorderUtils.js +67 -10
  142. package/lib/server/recorder.js +284 -146
  143. package/lib/server/registry/index.js +83 -48
  144. package/lib/server/registry/nativeDeps.js +175 -0
  145. package/lib/server/registry/oopDownloadBrowserMain.js +1 -1
  146. package/lib/server/screenshotter.js +84 -83
  147. package/lib/server/selectors.js +12 -12
  148. package/lib/server/socksClientCertificatesInterceptor.js +198 -136
  149. package/lib/server/trace/recorder/snapshotter.js +12 -19
  150. package/lib/server/trace/recorder/tracing.js +36 -27
  151. package/lib/server/trace/viewer/traceViewer.js +11 -20
  152. package/lib/server/transport.js +20 -22
  153. package/lib/server/utils/comparators.js +2 -2
  154. package/lib/server/utils/debug.js +3 -8
  155. package/lib/server/utils/debugLogger.js +8 -0
  156. package/lib/server/utils/hostPlatform.js +3 -1
  157. package/lib/server/utils/network.js +35 -25
  158. package/lib/server/utils/nodePlatform.js +1 -1
  159. package/lib/server/utils/processLauncher.js +4 -1
  160. package/lib/server/utils/wsServer.js +11 -17
  161. package/lib/server/webkit/webkit.js +5 -2
  162. package/lib/server/webkit/wkBrowser.js +51 -28
  163. package/lib/server/webkit/wkExecutionContext.js +2 -1
  164. package/lib/server/webkit/wkInput.js +25 -25
  165. package/lib/server/webkit/wkInterceptableRequest.js +1 -1
  166. package/lib/server/webkit/wkPage.js +80 -59
  167. package/lib/server/webkit/wkProvisionalPage.js +1 -1
  168. package/lib/server/webkit/wkWorkers.js +7 -7
  169. package/lib/utils/isomorphic/ariaSnapshot.js +13 -7
  170. package/lib/utils/isomorphic/cssParser.js +1 -2
  171. package/lib/utils/isomorphic/locatorGenerators.js +18 -0
  172. package/lib/utils/isomorphic/manualPromise.js +1 -2
  173. package/lib/utils/isomorphic/mimeType.js +1 -2
  174. package/lib/utils/isomorphic/multimap.js +1 -2
  175. package/lib/utils/isomorphic/oldUtilityScriptSerializers.js +248 -0
  176. package/lib/utils/isomorphic/protocolFormatter.js +78 -0
  177. package/lib/utils/isomorphic/protocolMetainfo.js +318 -0
  178. package/lib/utils/isomorphic/selectorParser.js +3 -4
  179. package/lib/utils/isomorphic/stringUtils.js +3 -24
  180. package/lib/utils/isomorphic/time.js +9 -4
  181. package/lib/utils/isomorphic/timeoutRunner.js +3 -4
  182. package/lib/utils/isomorphic/traceUtils.js +2 -3
  183. package/lib/utils/isomorphic/urlMatch.js +21 -7
  184. package/lib/utils/isomorphic/utilityScriptSerializers.js +208 -205
  185. package/lib/utils.js +8 -2
  186. package/lib/utilsBundleImpl/index.js +160 -150
  187. package/lib/vite/htmlReport/index.html +17 -17
  188. package/lib/vite/recorder/assets/{codeMirrorModule-CXVeovup.js → codeMirrorModule-DzQ0k89p.js} +1 -1
  189. package/lib/vite/recorder/assets/{index-eHBmevrY.css → index-CI4HQ-Zb.css} +1 -1
  190. package/lib/vite/recorder/assets/index-D7C7daHH.js +184 -0
  191. package/lib/vite/recorder/index.html +3 -3
  192. package/lib/vite/traceViewer/assets/{codeMirrorModule-_GLjJL-7.js → codeMirrorModule-Di48jgWx.js} +1 -1
  193. package/lib/vite/traceViewer/assets/defaultSettingsView-szBn8781.js +256 -0
  194. package/lib/vite/traceViewer/defaultSettingsView.DVJHpiGt.css +1 -0
  195. package/lib/vite/traceViewer/index.BFsek2M6.css +1 -0
  196. package/lib/vite/traceViewer/index.DQvXoPLL.js +2 -0
  197. package/lib/vite/traceViewer/index.html +6 -6
  198. package/lib/vite/traceViewer/sw.bundle.js +3 -3
  199. package/lib/vite/traceViewer/uiMode.dBV3oN9h.js +5 -0
  200. package/lib/vite/traceViewer/uiMode.html +4 -4
  201. package/lib/zipBundleImpl.js +4 -4
  202. package/package.json +1 -1
  203. package/types/protocol.d.ts +712 -107
  204. package/types/types.d.ts +128 -17
  205. package/lib/generated/consoleApiSource.js +0 -28
  206. package/lib/protocol/debug.js +0 -211
  207. package/lib/server/recorder/contextRecorder.js +0 -286
  208. package/lib/server/recorder/recorderCollection.js +0 -116
  209. package/lib/server/recorder/recorderFrontend.js +0 -16
  210. package/lib/server/storageScript.js +0 -154
  211. package/lib/server/timeoutSettings.js +0 -89
  212. package/lib/utils/isomorphic/builtins.js +0 -86
  213. package/lib/vite/recorder/assets/index-BsWQsSGl.js +0 -184
  214. package/lib/vite/traceViewer/assets/defaultSettingsView-DtCQiGHe.js +0 -265
  215. package/lib/vite/traceViewer/defaultSettingsView.QdHITyLI.css +0 -1
  216. package/lib/vite/traceViewer/index.CFOW-Ezb.css +0 -1
  217. package/lib/vite/traceViewer/index.cFZzK9RN.js +0 -2
  218. package/lib/vite/traceViewer/uiMode.XVPIqBeS.js +0 -5
@@ -40,6 +40,7 @@ class ElementHandle extends import_jsHandle.JSHandle {
40
40
  }
41
41
  constructor(parent, type, guid, initializer) {
42
42
  super(parent, type, guid, initializer);
43
+ this._frame = parent;
43
44
  this._elementChannel = this._channel;
44
45
  }
45
46
  asElement() {
@@ -51,10 +52,6 @@ class ElementHandle extends import_jsHandle.JSHandle {
51
52
  async contentFrame() {
52
53
  return import_frame.Frame.fromNullable((await this._elementChannel.contentFrame()).frame);
53
54
  }
54
- async _generateLocatorString() {
55
- const value = (await this._elementChannel.generateLocatorString()).value;
56
- return value === void 0 ? null : value;
57
- }
58
55
  async getAttribute(name) {
59
56
  const value = (await this._elementChannel.getAttribute({ name })).value;
60
57
  return value === void 0 ? null : value;
@@ -94,51 +91,51 @@ class ElementHandle extends import_jsHandle.JSHandle {
94
91
  await this._elementChannel.dispatchEvent({ type, eventInit: (0, import_jsHandle.serializeArgument)(eventInit) });
95
92
  }
96
93
  async scrollIntoViewIfNeeded(options = {}) {
97
- await this._elementChannel.scrollIntoViewIfNeeded(options);
94
+ await this._elementChannel.scrollIntoViewIfNeeded({ ...options, timeout: this._frame._timeout(options) });
98
95
  }
99
96
  async hover(options = {}) {
100
- await this._elementChannel.hover(options);
97
+ await this._elementChannel.hover({ ...options, timeout: this._frame._timeout(options) });
101
98
  }
102
99
  async click(options = {}) {
103
- return await this._elementChannel.click(options);
100
+ return await this._elementChannel.click({ ...options, timeout: this._frame._timeout(options) });
104
101
  }
105
102
  async dblclick(options = {}) {
106
- return await this._elementChannel.dblclick(options);
103
+ return await this._elementChannel.dblclick({ ...options, timeout: this._frame._timeout(options) });
107
104
  }
108
105
  async tap(options = {}) {
109
- return await this._elementChannel.tap(options);
106
+ return await this._elementChannel.tap({ ...options, timeout: this._frame._timeout(options) });
110
107
  }
111
108
  async selectOption(values, options = {}) {
112
- const result = await this._elementChannel.selectOption({ ...convertSelectOptionValues(values), ...options });
109
+ const result = await this._elementChannel.selectOption({ ...convertSelectOptionValues(values), ...options, timeout: this._frame._timeout(options) });
113
110
  return result.values;
114
111
  }
115
112
  async fill(value, options = {}) {
116
- return await this._elementChannel.fill({ value, ...options });
113
+ return await this._elementChannel.fill({ value, ...options, timeout: this._frame._timeout(options) });
117
114
  }
118
115
  async selectText(options = {}) {
119
- await this._elementChannel.selectText(options);
116
+ await this._elementChannel.selectText({ ...options, timeout: this._frame._timeout(options) });
120
117
  }
121
118
  async setInputFiles(files, options = {}) {
122
119
  const frame = await this.ownerFrame();
123
120
  if (!frame)
124
121
  throw new Error("Cannot set input files to detached element");
125
122
  const converted = await convertInputFiles(this._platform, files, frame.page().context());
126
- await this._elementChannel.setInputFiles({ ...converted, ...options });
123
+ await this._elementChannel.setInputFiles({ ...converted, ...options, timeout: this._frame._timeout(options) });
127
124
  }
128
125
  async focus() {
129
126
  await this._elementChannel.focus();
130
127
  }
131
128
  async type(text, options = {}) {
132
- await this._elementChannel.type({ text, ...options });
129
+ await this._elementChannel.type({ text, ...options, timeout: this._frame._timeout(options) });
133
130
  }
134
131
  async press(key, options = {}) {
135
- await this._elementChannel.press({ key, ...options });
132
+ await this._elementChannel.press({ key, ...options, timeout: this._frame._timeout(options) });
136
133
  }
137
134
  async check(options = {}) {
138
- return await this._elementChannel.check(options);
135
+ return await this._elementChannel.check({ ...options, timeout: this._frame._timeout(options) });
139
136
  }
140
137
  async uncheck(options = {}) {
141
- return await this._elementChannel.uncheck(options);
138
+ return await this._elementChannel.uncheck({ ...options, timeout: this._frame._timeout(options) });
142
139
  }
143
140
  async setChecked(checked, options) {
144
141
  if (checked)
@@ -152,7 +149,7 @@ class ElementHandle extends import_jsHandle.JSHandle {
152
149
  }
153
150
  async screenshot(options = {}) {
154
151
  const mask = options.mask;
155
- const copy = { ...options, mask: void 0 };
152
+ const copy = { ...options, mask: void 0, timeout: this._frame._timeout(options) };
156
153
  if (!copy.type)
157
154
  copy.type = determineScreenshotType(options);
158
155
  if (mask) {
@@ -184,10 +181,10 @@ class ElementHandle extends import_jsHandle.JSHandle {
184
181
  return (0, import_jsHandle.parseResult)(result.value);
185
182
  }
186
183
  async waitForElementState(state, options = {}) {
187
- return await this._elementChannel.waitForElementState({ state, ...options });
184
+ return await this._elementChannel.waitForElementState({ state, ...options, timeout: this._frame._timeout(options) });
188
185
  }
189
186
  async waitForSelector(selector, options = {}) {
190
- const result = await this._elementChannel.waitForSelector({ selector, ...options });
187
+ const result = await this._elementChannel.waitForSelector({ selector, ...options, timeout: this._frame._timeout(options) });
191
188
  return ElementHandle.fromNullable(result.element);
192
189
  }
193
190
  }
@@ -244,7 +241,7 @@ async function convertInputFiles(platform, files, context) {
244
241
  lastModifiedMs
245
242
  };
246
243
  }))
247
- }), true);
244
+ }), { internal: true });
248
245
  for (let i = 0; i < files2.length; i++) {
249
246
  const writable = import_writableStream.WritableStream.from(writableStreams[i]);
250
247
  await platform.streamFile(files2[i], writable.stream());
@@ -32,6 +32,7 @@ var import_assert = require("../utils/isomorphic/assert");
32
32
  var import_fileUtils = require("./fileUtils");
33
33
  var import_headers = require("../utils/isomorphic/headers");
34
34
  var import_rtti = require("../utils/isomorphic/rtti");
35
+ var import_timeoutSettings = require("./timeoutSettings");
35
36
  class APIRequest {
36
37
  constructor(playwright) {
37
38
  this._contexts = /* @__PURE__ */ new Set();
@@ -40,7 +41,6 @@ class APIRequest {
40
41
  async newContext(options = {}) {
41
42
  options = {
42
43
  ...this._playwright._defaultContextOptions,
43
- timeout: this._playwright._defaultContextTimeout,
44
44
  ...options
45
45
  };
46
46
  const storageState = typeof options.storageState === "string" ? JSON.parse(await this._playwright._platform.fs().promises.readFile(options.storageState, "utf8")) : options.storageState;
@@ -54,6 +54,7 @@ class APIRequest {
54
54
  })).request);
55
55
  this._contexts.add(context);
56
56
  context._request = this;
57
+ context._timeoutSettings.setDefaultTimeout(options.timeout ?? this._playwright._defaultContextTimeout);
57
58
  context._tracing._tracesDir = this._playwright._defaultLaunchOptions?.tracesDir;
58
59
  await context._instrumentation.runAfterCreateRequestContext(context);
59
60
  return context;
@@ -66,6 +67,7 @@ class APIRequestContext extends import_channelOwner.ChannelOwner {
66
67
  constructor(parent, type, guid, initializer) {
67
68
  super(parent, type, guid, initializer);
68
69
  this._tracing = import_tracing.Tracing.from(initializer.tracing);
70
+ this._timeoutSettings = new import_timeoutSettings.TimeoutSettings(this._platform);
69
71
  }
70
72
  async [Symbol.asyncDispose]() {
71
73
  await this.dispose();
@@ -205,7 +207,7 @@ class APIRequestContext extends import_channelOwner.ChannelOwner {
205
207
  jsonData,
206
208
  formData,
207
209
  multipartData,
208
- timeout: options.timeout,
210
+ timeout: this._timeoutSettings.timeout(options),
209
211
  failOnStatusCode: options.failOnStatusCode,
210
212
  ignoreHTTPSErrors: options.ignoreHTTPSErrors,
211
213
  maxRedirects: options.maxRedirects,
@@ -288,7 +290,7 @@ class APIResponse {
288
290
  throw new Error("Response has been disposed");
289
291
  throw e;
290
292
  }
291
- }, true);
293
+ }, { internal: true });
292
294
  }
293
295
  async text() {
294
296
  const content = await this.body();
@@ -45,6 +45,7 @@ var import_waiter = require("./waiter");
45
45
  var import_assert = require("../utils/isomorphic/assert");
46
46
  var import_locatorUtils = require("../utils/isomorphic/locatorUtils");
47
47
  var import_urlMatch = require("../utils/isomorphic/urlMatch");
48
+ var import_timeoutSettings = require("./timeoutSettings");
48
49
  class Frame extends import_channelOwner.ChannelOwner {
49
50
  constructor(parent, type, guid, initializer) {
50
51
  super(parent, type, guid, initializer);
@@ -90,9 +91,17 @@ class Frame extends import_channelOwner.ChannelOwner {
90
91
  page() {
91
92
  return this._page;
92
93
  }
94
+ _timeout(options) {
95
+ const timeoutSettings = this._page?._timeoutSettings || new import_timeoutSettings.TimeoutSettings(this._platform);
96
+ return timeoutSettings.timeout(options || {});
97
+ }
98
+ _navigationTimeout(options) {
99
+ const timeoutSettings = this._page?._timeoutSettings || new import_timeoutSettings.TimeoutSettings(this._platform);
100
+ return timeoutSettings.navigationTimeout(options || {});
101
+ }
93
102
  async goto(url, options = {}) {
94
103
  const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
95
- return network.Response.fromNullable((await this._channel.goto({ url, ...options, waitUntil })).response);
104
+ return network.Response.fromNullable((await this._channel.goto({ url, ...options, waitUntil, timeout: this._navigationTimeout(options) })).response);
96
105
  }
97
106
  _setupNavigationWaiter(options) {
98
107
  const waiter = new import_waiter.Waiter(this._page, "");
@@ -132,7 +141,7 @@ class Frame extends import_channelOwner.ChannelOwner {
132
141
  const response = request ? await waiter.waitForPromise(request._finalRequest()._internalResponse()) : null;
133
142
  waiter.dispose();
134
143
  return response;
135
- });
144
+ }, { title: "Wait for navigation" });
136
145
  }
137
146
  async waitForLoadState(state = "load", options = {}) {
138
147
  state = verifyLoadState("state", state);
@@ -147,7 +156,7 @@ class Frame extends import_channelOwner.ChannelOwner {
147
156
  });
148
157
  }
149
158
  waiter.dispose();
150
- });
159
+ }, { title: `Wait for load state "${state}"` });
151
160
  }
152
161
  async waitForURL(url, options = {}) {
153
162
  if ((0, import_urlMatch.urlMatches)(this._page?.context()._options.baseURL, this.url(), url))
@@ -167,6 +176,10 @@ class Frame extends import_channelOwner.ChannelOwner {
167
176
  const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg), isolatedContext });
168
177
  return (0, import_jsHandle.parseResult)(result.value);
169
178
  }
179
+ async _evaluateFunction(functionDeclaration) {
180
+ const result = await this._channel.evaluateExpression({ expression: functionDeclaration, isFunction: true, arg: (0, import_jsHandle.serializeArgument)(void 0) });
181
+ return (0, import_jsHandle.parseResult)(result.value);
182
+ }
170
183
  async _evaluateExposeUtilityScript(pageFunction, arg) {
171
184
  (0, import_jsHandle.assertMaxArguments)(arguments.length, 2);
172
185
  const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
@@ -181,11 +194,11 @@ class Frame extends import_channelOwner.ChannelOwner {
181
194
  throw new Error("options.visibility is not supported, did you mean options.state?");
182
195
  if (options.waitFor && options.waitFor !== "visible")
183
196
  throw new Error("options.waitFor is not supported, did you mean options.state?");
184
- const result = await this._channel.waitForSelector({ selector, ...options });
197
+ const result = await this._channel.waitForSelector({ selector, ...options, timeout: this._timeout(options) });
185
198
  return import_elementHandle.ElementHandle.fromNullable(result.element);
186
199
  }
187
200
  async dispatchEvent(selector, type, eventInit, options = {}) {
188
- await this._channel.dispatchEvent({ selector, type, eventInit: (0, import_jsHandle.serializeArgument)(eventInit), ...options });
201
+ await this._channel.dispatchEvent({ selector, type, eventInit: (0, import_jsHandle.serializeArgument)(eventInit), ...options, timeout: this._timeout(options) });
189
202
  }
190
203
  async $eval(selector, pageFunction, arg) {
191
204
  (0, import_jsHandle.assertMaxArguments)(arguments.length, 3);
@@ -201,15 +214,15 @@ class Frame extends import_channelOwner.ChannelOwner {
201
214
  const result = await this._channel.querySelectorAll({ selector });
202
215
  return result.elements.map((e) => import_elementHandle.ElementHandle.from(e));
203
216
  }
204
- async _queryCount(selector) {
205
- return (await this._channel.queryCount({ selector })).value;
217
+ async _queryCount(selector, options) {
218
+ return (await this._channel.queryCount({ selector, ...options })).value;
206
219
  }
207
220
  async content() {
208
221
  return (await this._channel.content()).value;
209
222
  }
210
223
  async setContent(html, options = {}) {
211
224
  const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
212
- await this._channel.setContent({ html, ...options, waitUntil });
225
+ await this._channel.setContent({ html, ...options, waitUntil, timeout: this._navigationTimeout(options) });
213
226
  }
214
227
  name() {
215
228
  return this._name || "";
@@ -243,19 +256,19 @@ class Frame extends import_channelOwner.ChannelOwner {
243
256
  return import_elementHandle.ElementHandle.from((await this._channel.addStyleTag({ ...copy })).element);
244
257
  }
245
258
  async click(selector, options = {}) {
246
- return await this._channel.click({ selector, ...options });
259
+ return await this._channel.click({ selector, ...options, timeout: this._timeout(options) });
247
260
  }
248
261
  async dblclick(selector, options = {}) {
249
- return await this._channel.dblclick({ selector, ...options });
262
+ return await this._channel.dblclick({ selector, ...options, timeout: this._timeout(options) });
250
263
  }
251
264
  async dragAndDrop(source, target, options = {}) {
252
- return await this._channel.dragAndDrop({ source, target, ...options });
265
+ return await this._channel.dragAndDrop({ source, target, ...options, timeout: this._timeout(options) });
253
266
  }
254
267
  async tap(selector, options = {}) {
255
- return await this._channel.tap({ selector, ...options });
268
+ return await this._channel.tap({ selector, ...options, timeout: this._timeout(options) });
256
269
  }
257
270
  async fill(selector, value, options = {}) {
258
- return await this._channel.fill({ selector, value, ...options });
271
+ return await this._channel.fill({ selector, value, ...options, timeout: this._timeout(options) });
259
272
  }
260
273
  async _highlight(selector) {
261
274
  return await this._channel.highlight({ selector });
@@ -288,36 +301,36 @@ class Frame extends import_channelOwner.ChannelOwner {
288
301
  return new import_locator.FrameLocator(this, selector);
289
302
  }
290
303
  async focus(selector, options = {}) {
291
- await this._channel.focus({ selector, ...options });
304
+ await this._channel.focus({ selector, ...options, timeout: this._timeout(options) });
292
305
  }
293
306
  async textContent(selector, options = {}) {
294
- const value = (await this._channel.textContent({ selector, ...options })).value;
307
+ const value = (await this._channel.textContent({ selector, ...options, timeout: this._timeout(options) })).value;
295
308
  return value === void 0 ? null : value;
296
309
  }
297
310
  async innerText(selector, options = {}) {
298
- return (await this._channel.innerText({ selector, ...options })).value;
311
+ return (await this._channel.innerText({ selector, ...options, timeout: this._timeout(options) })).value;
299
312
  }
300
313
  async innerHTML(selector, options = {}) {
301
- return (await this._channel.innerHTML({ selector, ...options })).value;
314
+ return (await this._channel.innerHTML({ selector, ...options, timeout: this._timeout(options) })).value;
302
315
  }
303
316
  async getAttribute(selector, name, options = {}) {
304
- const value = (await this._channel.getAttribute({ selector, name, ...options })).value;
317
+ const value = (await this._channel.getAttribute({ selector, name, ...options, timeout: this._timeout(options) })).value;
305
318
  return value === void 0 ? null : value;
306
319
  }
307
320
  async inputValue(selector, options = {}) {
308
- return (await this._channel.inputValue({ selector, ...options })).value;
321
+ return (await this._channel.inputValue({ selector, ...options, timeout: this._timeout(options) })).value;
309
322
  }
310
323
  async isChecked(selector, options = {}) {
311
- return (await this._channel.isChecked({ selector, ...options })).value;
324
+ return (await this._channel.isChecked({ selector, ...options, timeout: this._timeout(options) })).value;
312
325
  }
313
326
  async isDisabled(selector, options = {}) {
314
- return (await this._channel.isDisabled({ selector, ...options })).value;
327
+ return (await this._channel.isDisabled({ selector, ...options, timeout: this._timeout(options) })).value;
315
328
  }
316
329
  async isEditable(selector, options = {}) {
317
- return (await this._channel.isEditable({ selector, ...options })).value;
330
+ return (await this._channel.isEditable({ selector, ...options, timeout: this._timeout(options) })).value;
318
331
  }
319
332
  async isEnabled(selector, options = {}) {
320
- return (await this._channel.isEnabled({ selector, ...options })).value;
333
+ return (await this._channel.isEnabled({ selector, ...options, timeout: this._timeout(options) })).value;
321
334
  }
322
335
  async isHidden(selector, options = {}) {
323
336
  return (await this._channel.isHidden({ selector, ...options })).value;
@@ -326,26 +339,26 @@ class Frame extends import_channelOwner.ChannelOwner {
326
339
  return (await this._channel.isVisible({ selector, ...options })).value;
327
340
  }
328
341
  async hover(selector, options = {}) {
329
- await this._channel.hover({ selector, ...options });
342
+ await this._channel.hover({ selector, ...options, timeout: this._timeout(options) });
330
343
  }
331
344
  async selectOption(selector, values, options = {}) {
332
- return (await this._channel.selectOption({ selector, ...(0, import_elementHandle.convertSelectOptionValues)(values), ...options })).values;
345
+ return (await this._channel.selectOption({ selector, ...(0, import_elementHandle.convertSelectOptionValues)(values), ...options, timeout: this._timeout(options) })).values;
333
346
  }
334
347
  async setInputFiles(selector, files, options = {}) {
335
348
  const converted = await (0, import_elementHandle.convertInputFiles)(this._platform, files, this.page().context());
336
- await this._channel.setInputFiles({ selector, ...converted, ...options });
349
+ await this._channel.setInputFiles({ selector, ...converted, ...options, timeout: this._timeout(options) });
337
350
  }
338
351
  async type(selector, text, options = {}) {
339
- await this._channel.type({ selector, text, ...options });
352
+ await this._channel.type({ selector, text, ...options, timeout: this._timeout(options) });
340
353
  }
341
354
  async press(selector, key, options = {}) {
342
- await this._channel.press({ selector, key, ...options });
355
+ await this._channel.press({ selector, key, ...options, timeout: this._timeout(options) });
343
356
  }
344
357
  async check(selector, options = {}) {
345
- await this._channel.check({ selector, ...options });
358
+ await this._channel.check({ selector, ...options, timeout: this._timeout(options) });
346
359
  }
347
360
  async uncheck(selector, options = {}) {
348
- await this._channel.uncheck({ selector, ...options });
361
+ await this._channel.uncheck({ selector, ...options, timeout: this._timeout(options) });
349
362
  }
350
363
  async setChecked(selector, checked, options) {
351
364
  if (checked)
@@ -354,7 +367,7 @@ class Frame extends import_channelOwner.ChannelOwner {
354
367
  await this.uncheck(selector, options);
355
368
  }
356
369
  async waitForTimeout(timeout) {
357
- await this._channel.waitForTimeout({ timeout });
370
+ await this._channel.waitForTimeout({ waitTimeout: timeout });
358
371
  }
359
372
  async waitForFunction(pageFunction, arg, options = {}) {
360
373
  if (typeof options.polling === "string")
@@ -364,13 +377,22 @@ class Frame extends import_channelOwner.ChannelOwner {
364
377
  pollingInterval: options.polling === "raf" ? void 0 : options.polling,
365
378
  expression: String(pageFunction),
366
379
  isFunction: typeof pageFunction === "function",
367
- arg: (0, import_jsHandle.serializeArgument)(arg)
380
+ arg: (0, import_jsHandle.serializeArgument)(arg),
381
+ timeout: this._timeout(options)
368
382
  });
369
383
  return import_jsHandle.JSHandle.from(result.handle);
370
384
  }
371
385
  async title() {
372
386
  return (await this._channel.title()).value;
373
387
  }
388
+ async _expect(expression, options) {
389
+ const params = { expression, ...options, isNot: !!options.isNot };
390
+ params.expectedValue = (0, import_jsHandle.serializeArgument)(options.expectedValue);
391
+ const result = await this._channel.expect(params);
392
+ if (result.received !== void 0)
393
+ result.received = (0, import_jsHandle.parseResult)(result.received);
394
+ return result;
395
+ }
374
396
  }
375
397
  function verifyLoadState(name, waitUntil) {
376
398
  if (waitUntil === "networkidle0")
@@ -60,7 +60,9 @@ class Mouse {
60
60
  await this._page._channel.mouseClick({ x, y, ...options });
61
61
  }
62
62
  async dblclick(x, y, options = {}) {
63
- await this.click(x, y, { ...options, clickCount: 2 });
63
+ await this._page._wrapApiCall(async () => {
64
+ await this.click(x, y, { ...options, clickCount: 2 });
65
+ }, { title: "Double click" });
64
66
  }
65
67
  async wheel(deltaX, deltaY) {
66
68
  await this._page._channel.mouseWheel({ deltaX, deltaY });
@@ -40,6 +40,10 @@ class JSHandle extends import_channelOwner.ChannelOwner {
40
40
  const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg), isolatedContext });
41
41
  return parseResult(result.value);
42
42
  }
43
+ async _evaluateFunction(functionDeclaration) {
44
+ const result = await this._channel.evaluateExpression({ expression: functionDeclaration, isFunction: true, arg: serializeArgument(void 0) });
45
+ return parseResult(result.value);
46
+ }
43
47
  async evaluateHandle(pageFunction, arg, isolatedContext = true) {
44
48
  const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg), isolatedContext });
45
49
  return JSHandle.from(result.handle);
@@ -25,7 +25,6 @@ var import_channelOwner = require("./channelOwner");
25
25
  class LocalUtils extends import_channelOwner.ChannelOwner {
26
26
  constructor(parent, type, guid, initializer) {
27
27
  super(parent, type, guid, initializer);
28
- this.markAsInternalType();
29
28
  this.devices = {};
30
29
  for (const { name, descriptor } of initializer.deviceDescriptors)
31
30
  this.devices[name] = descriptor;
@@ -26,7 +26,6 @@ __export(locator_exports, {
26
26
  module.exports = __toCommonJS(locator_exports);
27
27
  var import_jsHandle = require("./jsHandle");
28
28
  var import_elementHandle = require("./elementHandle");
29
- var import_jsHandle2 = require("./jsHandle");
30
29
  var import_locatorGenerators = require("../utils/isomorphic/locatorGenerators");
31
30
  var import_locatorUtils = require("../utils/isomorphic/locatorUtils");
32
31
  var import_stringUtils = require("../utils/isomorphic/stringUtils");
@@ -57,8 +56,8 @@ class Locator {
57
56
  if (this._frame._platform.inspectCustom)
58
57
  this[this._frame._platform.inspectCustom] = () => this._inspect();
59
58
  }
60
- async _withElement(task, timeout) {
61
- timeout = this._frame.page()._timeoutSettings.timeout({ timeout });
59
+ async _withElement(task, options) {
60
+ const timeout = this._frame._timeout({ timeout: options.timeout });
62
61
  const deadline = timeout ? (0, import_time.monotonicTime)() + timeout : 0;
63
62
  return await this._frame._wrapApiCall(async () => {
64
63
  const result = await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, state: "attached", timeout });
@@ -70,7 +69,7 @@ class Locator {
70
69
  } finally {
71
70
  await handle.dispose();
72
71
  }
73
- });
72
+ }, { title: options.title, internal: options.internal });
74
73
  }
75
74
  _equals(locator) {
76
75
  return this._frame === locator._frame && this._selector === locator._selector;
@@ -79,7 +78,7 @@ class Locator {
79
78
  return this._frame.page();
80
79
  }
81
80
  async boundingBox(options) {
82
- return await this._withElement((h) => h.boundingBox(), options?.timeout);
81
+ return await this._withElement((h) => h.boundingBox(), { title: "Bounding box", timeout: options?.timeout });
83
82
  }
84
83
  async check(options = {}) {
85
84
  return await this._frame.check(this._selector, { strict: true, ...options });
@@ -88,7 +87,7 @@ class Locator {
88
87
  return await this._frame.click(this._selector, { strict: true, ...options });
89
88
  }
90
89
  async dblclick(options = {}) {
91
- return await this._frame.dblclick(this._selector, { strict: true, ...options });
90
+ await this._frame.dblclick(this._selector, { strict: true, ...options });
92
91
  }
93
92
  async dispatchEvent(type, eventInit = {}, options) {
94
93
  return await this._frame.dispatchEvent(this._selector, type, eventInit, { strict: true, ...options });
@@ -101,17 +100,20 @@ class Locator {
101
100
  }
102
101
  async evaluate(pageFunction, arg, options, isolatedContext = true) {
103
102
  return await this._withElement(
104
- async (h) => (0, import_jsHandle2.parseResult)(
103
+ async (h) => parseResult(
105
104
  (await h._channel.evaluateExpression({
106
105
  expression: String(pageFunction),
107
106
  isFunction: typeof pageFunction === "function",
108
- arg: (0, import_jsHandle2.serializeArgument)(arg),
107
+ arg: serializeArgument(arg),
109
108
  isolatedContext
110
109
  })).value
111
110
  ),
112
111
  options?.timeout
113
112
  );
114
113
  }
114
+ async _evaluateFunction(functionDeclaration, options) {
115
+ return await this._withElement((h) => h._evaluateFunction(functionDeclaration), { title: "Evaluate", timeout: options?.timeout });
116
+ }
115
117
  async evaluateAll(pageFunction, arg, isolatedContext = true) {
116
118
  return await this._frame.$$eval(this._selector, pageFunction, arg, isolatedContext);
117
119
  }
@@ -121,7 +123,7 @@ class Locator {
121
123
  (await h._channel.evaluateExpressionHandle({
122
124
  expression: String(pageFunction),
123
125
  isFunction: typeof pageFunction === "function",
124
- arg: (0, import_jsHandle2.serializeArgument)(arg),
126
+ arg: serializeArgument(arg),
125
127
  isolatedContext
126
128
  })).handle
127
129
  ),
@@ -132,7 +134,7 @@ class Locator {
132
134
  return await this._frame.fill(this._selector, value, { strict: true, ...options });
133
135
  }
134
136
  async clear(options = {}) {
135
- return await this.fill("", options);
137
+ await this._frame._wrapApiCall(() => this.fill("", options), { title: "Clear" });
136
138
  }
137
139
  async _highlight() {
138
140
  return await this._frame._highlight(this._selector);
@@ -183,6 +185,9 @@ class Locator {
183
185
  contentFrame() {
184
186
  return new FrameLocator(this._frame, this._selector);
185
187
  }
188
+ describe(description) {
189
+ return new Locator(this._frame, this._selector + " >> internal:describe=" + JSON.stringify(description));
190
+ }
186
191
  first() {
187
192
  return new Locator(this._frame, this._selector + " >> nth=0");
188
193
  }
@@ -206,13 +211,14 @@ class Locator {
206
211
  return await this._frame.focus(this._selector, { strict: true, ...options });
207
212
  }
208
213
  async blur(options) {
209
- await this._frame._channel.blur({ selector: this._selector, strict: true, ...options });
214
+ await this._frame._channel.blur({ selector: this._selector, strict: true, ...options, timeout: this._frame._timeout(options) });
210
215
  }
211
- async count() {
212
- return await this._frame._queryCount(this._selector);
216
+ // options are only here for testing
217
+ async count(_options) {
218
+ return await this._frame._queryCount(this._selector, _options);
213
219
  }
214
- async _generateLocatorString() {
215
- return await this._withElement((h) => h._generateLocatorString());
220
+ async _resolveSelector() {
221
+ return await this._frame._channel.resolveSelector({ selector: this._selector });
216
222
  }
217
223
  async getAttribute(name, options) {
218
224
  return await this._frame.getAttribute(this._selector, name, { strict: true, ...options });
@@ -252,20 +258,20 @@ class Locator {
252
258
  }
253
259
  async screenshot(options = {}) {
254
260
  const mask = options.mask;
255
- return await this._withElement((h, timeout) => h.screenshot({ ...options, mask, timeout }), options.timeout);
261
+ return await this._withElement((h, timeout) => h.screenshot({ ...options, mask, timeout }), { title: "Screenshot", timeout: options.timeout });
256
262
  }
257
263
  async ariaSnapshot(options) {
258
- const result = await this._frame._channel.ariaSnapshot({ ...options, mode: options?._mode, selector: this._selector });
264
+ const result = await this._frame._channel.ariaSnapshot({ ...options, selector: this._selector, timeout: this._frame._timeout(options) });
259
265
  return result.snapshot;
260
266
  }
261
267
  async scrollIntoViewIfNeeded(options = {}) {
262
- return await this._withElement((h, timeout) => h.scrollIntoViewIfNeeded({ ...options, timeout }), options.timeout);
268
+ return await this._withElement((h, timeout) => h.scrollIntoViewIfNeeded({ ...options, timeout }), { title: "Scroll into view", timeout: options.timeout });
263
269
  }
264
270
  async selectOption(values, options = {}) {
265
271
  return await this._frame.selectOption(this._selector, values, { strict: true, ...options });
266
272
  }
267
273
  async selectText(options = {}) {
268
- return await this._withElement((h, timeout) => h.selectText({ ...options, timeout }), options.timeout);
274
+ return await this._withElement((h, timeout) => h.selectText({ ...options, timeout }), { title: "Select text", timeout: options.timeout });
269
275
  }
270
276
  async setChecked(checked, options) {
271
277
  if (checked)
@@ -301,15 +307,13 @@ class Locator {
301
307
  return await this._frame.$$eval(this._selector, (ee) => ee.map((e) => e.textContent || ""));
302
308
  }
303
309
  async waitFor(options) {
304
- await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, omitReturnValue: true, ...options });
310
+ await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, omitReturnValue: true, ...options, timeout: this._frame._timeout(options) });
305
311
  }
306
312
  async _expect(expression, options) {
307
- const params = { selector: this._selector, expression, ...options, isNot: !!options.isNot };
308
- params.expectedValue = (0, import_jsHandle2.serializeArgument)(options.expectedValue);
309
- const result = await this._frame._channel.expect(params);
310
- if (result.received !== void 0)
311
- result.received = (0, import_jsHandle2.parseResult)(result.received);
312
- return result;
313
+ return this._frame._expect(expression, {
314
+ ...options,
315
+ selector: this._selector
316
+ });
313
317
  }
314
318
  _inspect() {
315
319
  return this.toString();
@@ -51,7 +51,6 @@ class Request extends import_channelOwner.ChannelOwner {
51
51
  this._redirectedTo = null;
52
52
  this._failureText = null;
53
53
  this._fallbackOverrides = {};
54
- this.markAsInternalType();
55
54
  this._redirectedFrom = Request.fromNullable(initializer.redirectedFrom);
56
55
  if (this._redirectedFrom)
57
56
  this._redirectedFrom._redirectedTo = this;
@@ -121,7 +120,7 @@ class Request extends import_channelOwner.ChannelOwner {
121
120
  if (!this._actualHeadersPromise) {
122
121
  this._actualHeadersPromise = this._wrapApiCall(async () => {
123
122
  return new RawHeaders((await this._channel.rawRequestHeaders()).headers);
124
- });
123
+ }, { internal: true });
125
124
  }
126
125
  return await this._actualHeadersPromise;
127
126
  }
@@ -138,9 +137,7 @@ class Request extends import_channelOwner.ChannelOwner {
138
137
  return Response.fromNullable((await this._channel.response()).response);
139
138
  }
140
139
  async _internalResponse() {
141
- return await this._wrapApiCall(async () => {
142
- return Response.fromNullable((await this._channel.response()).response);
143
- }, true);
140
+ return Response.fromNullable((await this._channel.response()).response);
144
141
  }
145
142
  frame() {
146
143
  if (!this._initializer.frame) {
@@ -222,7 +219,6 @@ class Route extends import_channelOwner.ChannelOwner {
222
219
  super(parent, type, guid, initializer);
223
220
  this._handlingPromise = null;
224
221
  this._didThrow = false;
225
- this.markAsInternalType();
226
222
  }
227
223
  static from(route) {
228
224
  return route._object;
@@ -259,9 +255,7 @@ class Route extends import_channelOwner.ChannelOwner {
259
255
  }
260
256
  async fulfill(options = {}) {
261
257
  await this._handleRoute(async () => {
262
- await this._wrapApiCall(async () => {
263
- await this._innerFulfill(options);
264
- });
258
+ await this._innerFulfill(options);
265
259
  });
266
260
  }
267
261
  async _handleRoute(callback) {
@@ -358,7 +352,6 @@ class WebSocketRoute extends import_channelOwner.ChannelOwner {
358
352
  constructor(parent, type, guid, initializer) {
359
353
  super(parent, type, guid, initializer);
360
354
  this._connected = false;
361
- this.markAsInternalType();
362
355
  this._server = {
363
356
  onMessage: (handler) => {
364
357
  this._onServerMessage = handler;
@@ -455,7 +448,8 @@ class WebSocketRoute extends import_channelOwner.ChannelOwner {
455
448
  async _afterHandle() {
456
449
  if (this._connected)
457
450
  return;
458
- await this._channel.ensureOpened();
451
+ await this._channel.ensureOpened().catch(() => {
452
+ });
459
453
  }
460
454
  }
461
455
  class WebSocketRouteHandler {
@@ -492,7 +486,6 @@ class Response extends import_channelOwner.ChannelOwner {
492
486
  constructor(parent, type, guid, initializer) {
493
487
  super(parent, type, guid, initializer);
494
488
  this._finishedPromise = new import_manualPromise.ManualPromise();
495
- this.markAsInternalType();
496
489
  this._provisionalHeaders = new RawHeaders(initializer.headers);
497
490
  this._request = Request.from(this._initializer.request);
498
491
  Object.assign(this._request._timing, this._initializer.timing);