@browserless.io/browserless 2.0.0-beta-5 → 2.0.0-beta-7

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 (246) hide show
  1. package/LICENSE +2 -0
  2. package/README.md +11 -11
  3. package/bin/browserless.js +169 -11
  4. package/bin/scaffold/README.md +415 -0
  5. package/bin/scaffold/package.json +21 -0
  6. package/bin/scaffold/src/hello-world.http.ts +27 -0
  7. package/bin/scaffold/tsconfig.json +4 -0
  8. package/build/browserless.js +18 -15
  9. package/build/browsers/index.d.ts +2 -18
  10. package/build/browsers/index.js +43 -14
  11. package/build/file-system.d.ts +5 -0
  12. package/build/file-system.js +20 -5
  13. package/build/file-system.spec.d.ts +1 -0
  14. package/build/file-system.spec.js +44 -0
  15. package/build/http.d.ts +3 -3
  16. package/build/http.js +3 -3
  17. package/build/router.js +2 -4
  18. package/build/routes/chromium/http/content-post.body.json +8 -8
  19. package/build/routes/chromium/http/content-post.d.ts +15 -3
  20. package/build/routes/chromium/http/content-post.js +14 -15
  21. package/build/routes/chromium/http/download-post.d.ts +16 -3
  22. package/build/routes/chromium/http/download-post.js +17 -22
  23. package/build/routes/chromium/http/function-post.d.ts +16 -3
  24. package/build/routes/chromium/http/function-post.js +17 -22
  25. package/build/routes/chromium/http/pdf-post.body.json +8 -8
  26. package/build/routes/chromium/http/pdf-post.d.ts +15 -3
  27. package/build/routes/chromium/http/pdf-post.js +19 -15
  28. package/build/routes/chromium/http/performance.d.ts +15 -3
  29. package/build/routes/chromium/http/performance.js +15 -23
  30. package/build/routes/chromium/http/scrape-post.body.json +8 -8
  31. package/build/routes/chromium/http/scrape-post.d.ts +15 -3
  32. package/build/routes/chromium/http/scrape-post.js +15 -16
  33. package/build/routes/chromium/http/screenshot-post.body.json +8 -8
  34. package/build/routes/chromium/http/screenshot-post.d.ts +15 -3
  35. package/build/routes/chromium/http/screenshot-post.js +18 -15
  36. package/build/routes/chromium/tests/websocket.spec.js +20 -1
  37. package/build/routes/chromium/utils/function/handler.js +2 -2
  38. package/build/routes/chromium/ws/browser.d.ts +13 -3
  39. package/build/routes/chromium/ws/browser.js +10 -11
  40. package/build/routes/chromium/ws/cdp-chromium.d.ts +13 -3
  41. package/build/routes/chromium/ws/cdp-chromium.js +10 -11
  42. package/build/routes/chromium/ws/page.d.ts +13 -3
  43. package/build/routes/chromium/ws/page.js +10 -11
  44. package/build/routes/chromium/ws/playwright-chromium.d.ts +13 -3
  45. package/build/routes/chromium/ws/playwright-chromium.js +11 -12
  46. package/build/routes/firefox/ws/playwright-firefox.d.ts +13 -3
  47. package/build/routes/firefox/ws/playwright-firefox.js +11 -12
  48. package/build/routes/management/http/config-get.d.ts +15 -3
  49. package/build/routes/management/http/config-get.js +15 -20
  50. package/build/routes/management/http/metrics-get.d.ts +15 -3
  51. package/build/routes/management/http/metrics-get.js +16 -21
  52. package/build/routes/management/http/metrics-total-get.d.ts +15 -3
  53. package/build/routes/management/http/metrics-total-get.js +16 -21
  54. package/build/routes/management/http/sessions-get.d.ts +15 -3
  55. package/build/routes/management/http/sessions-get.js +16 -20
  56. package/build/routes/management/http/static-get.d.ts +15 -3
  57. package/build/routes/management/http/static-get.js +15 -20
  58. package/build/routes/webkit/ws/playwright-webkit.d.ts +13 -3
  59. package/build/routes/webkit/ws/playwright-webkit.js +11 -12
  60. package/build/server.js +0 -1
  61. package/build/types.d.ts +48 -38
  62. package/build/types.js +135 -0
  63. package/extensions/ublock/1p-filters.html +0 -1
  64. package/extensions/ublock/3p-filters.html +0 -2
  65. package/extensions/ublock/_locales/bg/messages.json +6 -6
  66. package/extensions/ublock/_locales/br_FR/messages.json +14 -14
  67. package/extensions/ublock/_locales/bs/messages.json +8 -8
  68. package/extensions/ublock/_locales/ca/messages.json +1 -1
  69. package/extensions/ublock/_locales/da/messages.json +5 -5
  70. package/extensions/ublock/_locales/fa/messages.json +1 -1
  71. package/extensions/ublock/_locales/fi/messages.json +6 -6
  72. package/extensions/ublock/_locales/hr/messages.json +4 -4
  73. package/extensions/ublock/_locales/nb/messages.json +1 -1
  74. package/extensions/ublock/_locales/no/messages.json +1 -1
  75. package/extensions/ublock/_locales/ro/messages.json +2 -2
  76. package/extensions/ublock/_locales/ru/messages.json +1 -1
  77. package/extensions/ublock/_locales/sk/messages.json +1 -1
  78. package/extensions/ublock/_locales/sv/messages.json +2 -2
  79. package/extensions/ublock/_locales/te/messages.json +17 -17
  80. package/extensions/ublock/_locales/vi/messages.json +12 -12
  81. package/extensions/ublock/_locales/zh_TW/messages.json +13 -13
  82. package/extensions/ublock/assets/assets.json +3 -3
  83. package/extensions/ublock/assets/resources/scriptlets.js +218 -97
  84. package/extensions/ublock/assets/thirdparties/easylist/easylist.txt +3010 -2056
  85. package/extensions/ublock/assets/thirdparties/easylist/easyprivacy.txt +624 -433
  86. package/extensions/ublock/assets/thirdparties/pgl.yoyo.org/as/serverlist +93 -24
  87. package/extensions/ublock/assets/thirdparties/publicsuffix.org/list/effective_tld_names.dat +7 -15
  88. package/extensions/ublock/assets/thirdparties/urlhaus-filter/urlhaus-filter-online.txt +795 -777
  89. package/extensions/ublock/assets/ublock/badware.min.txt +138 -72
  90. package/extensions/ublock/assets/ublock/filters.min.txt +1929 -2735
  91. package/extensions/ublock/assets/ublock/privacy.min.txt +57 -26
  92. package/extensions/ublock/assets/ublock/quick-fixes.min.txt +125 -74
  93. package/extensions/ublock/assets/ublock/unbreak.min.txt +46 -53
  94. package/extensions/ublock/css/codemirror.css +8 -7
  95. package/extensions/ublock/css/dom-inspector.css +40 -0
  96. package/extensions/ublock/css/logger-ui-inspector.css +7 -1
  97. package/extensions/ublock/css/logger-ui.css +12 -5
  98. package/extensions/ublock/css/popup-fenix.css +1 -1
  99. package/extensions/ublock/devtools.html +1 -0
  100. package/extensions/ublock/js/1p-filters.js +4 -3
  101. package/extensions/ublock/js/3p-filters.js +25 -31
  102. package/extensions/ublock/js/about.js +1 -1
  103. package/extensions/ublock/js/advanced-settings.js +1 -1
  104. package/extensions/ublock/js/asset-viewer.js +1 -1
  105. package/extensions/ublock/js/assets.js +74 -44
  106. package/extensions/ublock/js/background.js +9 -3
  107. package/extensions/ublock/js/base64-custom.js +1 -1
  108. package/extensions/ublock/js/benchmarks.js +1 -1
  109. package/extensions/ublock/js/biditrie.js +1 -1
  110. package/extensions/ublock/js/broadcast.js +75 -0
  111. package/extensions/ublock/js/cachestorage.js +68 -45
  112. package/extensions/ublock/js/click2load.js +1 -1
  113. package/extensions/ublock/js/cloud-ui.js +1 -1
  114. package/extensions/ublock/js/code-viewer.js +1 -1
  115. package/extensions/ublock/js/codemirror/search-thread.js +1 -1
  116. package/extensions/ublock/js/codemirror/search.js +1 -1
  117. package/extensions/ublock/js/codemirror/ubo-dynamic-filtering.js +1 -1
  118. package/extensions/ublock/js/codemirror/ubo-static-filtering.js +98 -24
  119. package/extensions/ublock/js/commands.js +1 -1
  120. package/extensions/ublock/js/console.js +1 -1
  121. package/extensions/ublock/js/contentscript-extra.js +1 -1
  122. package/extensions/ublock/js/contentscript.js +1 -3
  123. package/extensions/ublock/js/contextmenu.js +1 -1
  124. package/extensions/ublock/js/cosmetic-filtering.js +4 -4
  125. package/extensions/ublock/js/dashboard-common.js +1 -1
  126. package/extensions/ublock/js/dashboard.js +1 -1
  127. package/extensions/ublock/js/devtools.js +23 -15
  128. package/extensions/ublock/js/diff-updater.js +3 -3
  129. package/extensions/ublock/js/document-blocked.js +1 -1
  130. package/extensions/ublock/js/dom-inspector.js +68 -0
  131. package/extensions/ublock/js/dom.js +1 -1
  132. package/extensions/ublock/js/dyna-rules.js +1 -1
  133. package/extensions/ublock/js/dynamic-net-filtering.js +1 -1
  134. package/extensions/ublock/js/epicker-ui.js +35 -59
  135. package/extensions/ublock/js/fa-icons.js +1 -1
  136. package/extensions/ublock/js/filtering-context.js +1 -1
  137. package/extensions/ublock/js/filtering-engines.js +1 -1
  138. package/extensions/ublock/js/hnswitches.js +1 -1
  139. package/extensions/ublock/js/hntrie.js +1 -1
  140. package/extensions/ublock/js/html-filtering.js +1 -1
  141. package/extensions/ublock/js/httpheader-filtering.js +1 -1
  142. package/extensions/ublock/js/i18n.js +1 -1
  143. package/extensions/ublock/js/is-webrtc-supported.js +1 -1
  144. package/extensions/ublock/js/logger-ui-inspector.js +203 -145
  145. package/extensions/ublock/js/logger-ui.js +21 -5
  146. package/extensions/ublock/js/logger.js +6 -2
  147. package/extensions/ublock/js/lz4.js +2 -2
  148. package/extensions/ublock/js/messaging.js +266 -166
  149. package/extensions/ublock/js/mrucache.js +58 -0
  150. package/extensions/ublock/js/pagestore.js +1 -1
  151. package/extensions/ublock/js/popup-fenix.js +2 -1
  152. package/extensions/ublock/js/redirect-engine.js +1 -1
  153. package/extensions/ublock/js/redirect-resources.js +1 -12
  154. package/extensions/ublock/js/reverselookup-worker.js +1 -1
  155. package/extensions/ublock/js/reverselookup.js +1 -1
  156. package/extensions/ublock/js/scriptlet-filtering-core.js +300 -0
  157. package/extensions/ublock/js/scriptlet-filtering.js +122 -350
  158. package/extensions/ublock/js/scriptlets/cosmetic-logger.js +36 -47
  159. package/extensions/ublock/js/scriptlets/cosmetic-off.js +1 -1
  160. package/extensions/ublock/js/scriptlets/cosmetic-on.js +1 -1
  161. package/extensions/ublock/js/scriptlets/cosmetic-report.js +1 -1
  162. package/extensions/ublock/js/scriptlets/dom-inspector.js +341 -323
  163. package/extensions/ublock/js/scriptlets/dom-survey-elements.js +1 -1
  164. package/extensions/ublock/js/scriptlets/dom-survey-scripts.js +1 -1
  165. package/extensions/ublock/js/scriptlets/epicker.js +80 -89
  166. package/extensions/ublock/js/scriptlets/load-3p-css.js +1 -1
  167. package/extensions/ublock/js/scriptlets/load-large-media-all.js +1 -1
  168. package/extensions/ublock/js/scriptlets/load-large-media-interactive.js +1 -1
  169. package/extensions/ublock/js/scriptlets/noscript-spoof.js +1 -1
  170. package/extensions/ublock/js/scriptlets/should-inject-contentscript.js +1 -1
  171. package/extensions/ublock/js/scriptlets/subscriber.js +1 -1
  172. package/extensions/ublock/js/scriptlets/updater.js +20 -3
  173. package/extensions/ublock/js/settings.js +1 -1
  174. package/extensions/ublock/js/start.js +19 -20
  175. package/extensions/ublock/js/static-dnr-filtering.js +1 -1
  176. package/extensions/ublock/js/static-ext-filtering-db.js +1 -1
  177. package/extensions/ublock/js/static-ext-filtering.js +1 -1
  178. package/extensions/ublock/js/static-filtering-io.js +1 -1
  179. package/extensions/ublock/js/static-filtering-parser.js +5 -3
  180. package/extensions/ublock/js/static-net-filtering.js +57 -37
  181. package/extensions/ublock/js/storage.js +49 -29
  182. package/extensions/ublock/js/support.js +4 -4
  183. package/extensions/ublock/js/tab.js +1 -1
  184. package/extensions/ublock/js/tasks.js +1 -1
  185. package/extensions/ublock/js/text-encode.js +1 -1
  186. package/extensions/ublock/js/text-utils.js +1 -1
  187. package/extensions/ublock/js/theme.js +1 -1
  188. package/extensions/ublock/js/traffic.js +2 -1
  189. package/extensions/ublock/js/ublock.js +15 -11
  190. package/extensions/ublock/js/uri-utils.js +1 -1
  191. package/extensions/ublock/js/url-net-filtering.js +1 -1
  192. package/extensions/ublock/js/utils.js +1 -73
  193. package/extensions/ublock/js/vapi-background-ext.js +1 -1
  194. package/extensions/ublock/js/vapi-background.js +92 -83
  195. package/extensions/ublock/js/vapi-client.js +4 -33
  196. package/extensions/ublock/js/vapi-common.js +16 -30
  197. package/extensions/ublock/js/vapi.js +1 -1
  198. package/extensions/ublock/js/wasm/biditrie.wat +1 -1
  199. package/extensions/ublock/js/wasm/hntrie.wat +1 -1
  200. package/extensions/ublock/js/webext.js +1 -1
  201. package/extensions/ublock/js/whitelist.js +1 -1
  202. package/extensions/ublock/logger-ui.html +2 -2
  203. package/extensions/ublock/manifest.json +1 -1
  204. package/extensions/ublock/support.html +0 -1
  205. package/extensions/ublock/web_accessible_resources/dom-inspector.html +25 -0
  206. package/extensions/ublock/web_accessible_resources/epicker-ui.html +0 -1
  207. package/extensions/ublock/web_accessible_resources/googletagservices_gpt.js +1 -0
  208. package/package.json +7 -19
  209. package/scripts/build-open-api.js +7 -4
  210. package/src/browserless.ts +42 -18
  211. package/src/browsers/index.ts +48 -20
  212. package/src/file-system.spec.ts +58 -0
  213. package/src/file-system.ts +36 -8
  214. package/src/http.ts +3 -3
  215. package/src/router.ts +2 -6
  216. package/src/routes/chromium/http/content-post.ts +13 -16
  217. package/src/routes/chromium/http/download-post.ts +16 -27
  218. package/src/routes/chromium/http/function-post.ts +16 -25
  219. package/src/routes/chromium/http/pdf-post.ts +19 -15
  220. package/src/routes/chromium/http/performance.ts +14 -26
  221. package/src/routes/chromium/http/scrape-post.ts +14 -16
  222. package/src/routes/chromium/http/screenshot-post.ts +18 -15
  223. package/src/routes/chromium/tests/websocket.spec.ts +28 -1
  224. package/src/routes/chromium/utils/function/handler.ts +2 -1
  225. package/src/routes/chromium/ws/browser.ts +10 -12
  226. package/src/routes/chromium/ws/cdp-chromium.ts +10 -12
  227. package/src/routes/chromium/ws/page.ts +10 -12
  228. package/src/routes/chromium/ws/playwright-chromium.ts +10 -12
  229. package/src/routes/firefox/ws/playwright-firefox.ts +10 -12
  230. package/src/routes/management/http/config-get.ts +14 -23
  231. package/src/routes/management/http/metrics-get.ts +15 -24
  232. package/src/routes/management/http/metrics-total-get.ts +15 -26
  233. package/src/routes/management/http/sessions-get.ts +15 -23
  234. package/src/routes/management/http/static-get.ts +14 -22
  235. package/src/routes/webkit/ws/playwright-webkit.ts +10 -12
  236. package/src/server.ts +0 -1
  237. package/src/types.ts +59 -45
  238. package/static/docs/browserless-logo-inline.svg +1 -0
  239. package/static/docs/index.html +27 -0
  240. package/static/docs/swagger.json +33 -33
  241. package/static/function/client.js +626 -78
  242. package/extensions/ublock/js/vapi-client-extra.js +0 -312
  243. package/extensions/ublock/web_accessible_resources/addthis_widget.js +0 -39
  244. package/extensions/ublock/web_accessible_resources/ligatus_angular-tag.js +0 -29
  245. package/extensions/ublock/web_accessible_resources/monkeybroker.js +0 -43
  246. package/extensions/ublock/web_accessible_resources/mxpnl_mixpanel.js +0 -51
@@ -3369,7 +3369,7 @@
3369
3369
  return error;
3370
3370
  }
3371
3371
  function createProtocolErrorMessage(object) {
3372
- let message = `${object.error.message}`;
3372
+ let message = object.error.message;
3373
3373
  if (object.error && typeof object.error === "object" && "data" in object.error) {
3374
3374
  message += ` ${object.error.data}`;
3375
3375
  }
@@ -17218,6 +17218,9 @@
17218
17218
  }
17219
17219
  function addPageBinding(type, name2) {
17220
17220
  const callCdp = globalThis[name2];
17221
+ if (callCdp[Symbol.toStringTag] === "PuppeteerBinding") {
17222
+ return;
17223
+ }
17221
17224
  Object.assign(globalThis, {
17222
17225
  [name2](...args) {
17223
17226
  const callPuppeteer = globalThis[name2];
@@ -17249,6 +17252,7 @@
17249
17252
  });
17250
17253
  }
17251
17254
  });
17255
+ globalThis[name2][Symbol.toStringTag] = "PuppeteerBinding";
17252
17256
  }
17253
17257
  function pageBindingInitString(type, name2) {
17254
17258
  return evaluationString(addPageBinding, type, name2);
@@ -17626,7 +17630,7 @@
17626
17630
  *
17627
17631
  * @param value - The resource to add. `null` and `undefined` will not be added,
17628
17632
  * but will be returned.
17629
- * @returns The provided {@link value}.
17633
+ * @returns The provided `value`.
17630
17634
  */
17631
17635
  use(value) {
17632
17636
  if (value) {
@@ -17640,7 +17644,7 @@
17640
17644
  * @param value - The value to add.
17641
17645
  * @param onDispose - The callback to use in place of a `[disposeSymbol]()`
17642
17646
  * method. Will be invoked with `value` as the first parameter.
17643
- * @returns The provided {@link value}.
17647
+ * @returns The provided `value`.
17644
17648
  */
17645
17649
  adopt(value, onDispose) {
17646
17650
  this.#stack.push({
@@ -18286,11 +18290,11 @@
18286
18290
  // Reduces initial buffering while analyzing input fps and other stats.
18287
18291
  [
18288
18292
  "-fpsprobesize",
18289
- `${0}`,
18293
+ "0",
18290
18294
  "-probesize",
18291
- `${32}`,
18295
+ "32",
18292
18296
  "-analyzeduration",
18293
- `${0}`,
18297
+ "0",
18294
18298
  "-fflags",
18295
18299
  "nobuffer"
18296
18300
  ],
@@ -18307,11 +18311,11 @@
18307
18311
  // Specifies the encoding and format we are using.
18308
18312
  this.#getFormatArgs(format5 ?? "webm"),
18309
18313
  // Disable bitrate.
18310
- ["-b:v", `${0}`],
18314
+ ["-b:v", "0"],
18311
18315
  // Filters to ensure the images are piped correctly.
18312
18316
  [
18313
18317
  "-vf",
18314
- `${speed ? `setpts=${1 / speed}*PTS,` : ""}crop='min(${width},iw):min(${height},ih):${0}:${0}',pad=${width}:${height}:${0}:${0}${crop ? `,crop=${crop.width}:${crop.height}:${crop.x}:${crop.y}` : ""}${scale ? `,scale=iw*${scale}:-1` : ""}`
18318
+ `${speed ? `setpts=${1 / speed}*PTS,` : ""}crop='min(${width},iw):min(${height},ih):0:0',pad=${width}:${height}:0:0${crop ? `,crop=${crop.width}:${crop.height}:${crop.x}:${crop.y}` : ""}${scale ? `,scale=iw*${scale}:-1` : ""}`
18315
18319
  ],
18316
18320
  "pipe:1"
18317
18321
  ].flat(),
@@ -18355,7 +18359,7 @@
18355
18359
  // Sets the quality. Lower the better.
18356
18360
  ["-crf", `${CRF_VALUE}`],
18357
18361
  // Sets the quality and how efficient the compression will be.
18358
- ["-deadline", "realtime", "-cpu-used", `${8}`]
18362
+ ["-deadline", "realtime", "-cpu-used", "8"]
18359
18363
  ].flat();
18360
18364
  case "gif":
18361
18365
  return [
@@ -18816,12 +18820,11 @@
18816
18820
  const parent = this.#connection?.session(this.#parentSessionId);
18817
18821
  return parent ?? void 0;
18818
18822
  }
18819
- send(method, ...paramArgs) {
18823
+ send(method, params, options) {
18820
18824
  if (!this.#connection) {
18821
18825
  return Promise.reject(new TargetCloseError(`Protocol error (${method}): Session closed. Most likely the ${this.#targetType} has been closed.`));
18822
18826
  }
18823
- const params = paramArgs.length ? paramArgs[0] : void 0;
18824
- return this.#connection._rawSend(this.#callbacks, method, params, this.#sessionId);
18827
+ return this.#connection._rawSend(this.#callbacks, method, params, this.#sessionId, options);
18825
18828
  }
18826
18829
  /**
18827
18830
  * @internal
@@ -20320,7 +20323,7 @@
20320
20323
  throw new Error(`\`crop.height\` and \`crop.width\` must be greater than or equal to 0.`);
20321
20324
  }
20322
20325
  const viewportWidth = width / devicePixelRatio;
20323
- const viewportHeight = width / devicePixelRatio;
20326
+ const viewportHeight = height / devicePixelRatio;
20324
20327
  if (x4 + cropWidth > viewportWidth) {
20325
20328
  throw new Error(`\`crop.width\` cannot be larger than the viewport width (${viewportWidth}).`);
20326
20329
  }
@@ -20837,10 +20840,11 @@
20837
20840
  return this.mainFrame().waitForXPath(xpath, options);
20838
20841
  }
20839
20842
  /**
20840
- * Waits for a function to finish evaluating in the page's context.
20843
+ * Waits for the provided function, `pageFunction`, to return a truthy value when
20844
+ * evaluated in the page's context.
20841
20845
  *
20842
20846
  * @example
20843
- * The {@link Page.waitForFunction} can be used to observe viewport size change:
20847
+ * {@link Page.waitForFunction} can be used to observe a viewport size change:
20844
20848
  *
20845
20849
  * ```ts
20846
20850
  * import puppeteer from 'puppeteer';
@@ -20855,8 +20859,7 @@
20855
20859
  * ```
20856
20860
  *
20857
20861
  * @example
20858
- * To pass arguments from node.js to the predicate of
20859
- * {@link Page.waitForFunction} function:
20862
+ * Arguments can be passed from Node.js to `pageFunction`:
20860
20863
  *
20861
20864
  * ```ts
20862
20865
  * const selector = '.foo';
@@ -20868,7 +20871,7 @@
20868
20871
  * ```
20869
20872
  *
20870
20873
  * @example
20871
- * The predicate of {@link Page.waitForFunction} can be asynchronous too:
20874
+ * The provided `pageFunction` can be asynchronous:
20872
20875
  *
20873
20876
  * ```ts
20874
20877
  * const username = 'github-username';
@@ -20890,7 +20893,8 @@
20890
20893
  * );
20891
20894
  * ```
20892
20895
  *
20893
- * @param pageFunction - Function to be evaluated in browser context
20896
+ * @param pageFunction - Function to be evaluated in browser context until it returns a
20897
+ * truthy value.
20894
20898
  * @param options - Options for configuring waiting behavior.
20895
20899
  */
20896
20900
  waitForFunction(pageFunction, options, ...args) {
@@ -21858,15 +21862,14 @@
21858
21862
  url() {
21859
21863
  return this.#url;
21860
21864
  }
21861
- send(method, ...paramArgs) {
21862
- const params = paramArgs.length ? paramArgs[0] : void 0;
21863
- return this._rawSend(this.#callbacks, method, params);
21865
+ send(method, params, options) {
21866
+ return this._rawSend(this.#callbacks, method, params, void 0, options);
21864
21867
  }
21865
21868
  /**
21866
21869
  * @internal
21867
21870
  */
21868
- _rawSend(callbacks, method, params, sessionId) {
21869
- return callbacks.create(method, this.#timeout, (id) => {
21871
+ _rawSend(callbacks, method, params, sessionId, options) {
21872
+ return callbacks.create(method, options?.timeout ?? this.#timeout, (id) => {
21870
21873
  const stringifiedMessage = JSON.stringify({
21871
21874
  method,
21872
21875
  params,
@@ -22830,7 +22833,7 @@
22830
22833
  // node_modules/puppeteer-core/lib/esm/puppeteer/generated/injected.js
22831
22834
  init_dirname();
22832
22835
  init_buffer2();
22833
- var source = '"use strict";var C=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var se=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var n in e)C(t,n,{get:e[n],enumerable:!0})},ie=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of oe(e))!se.call(t,o)&&o!==n&&C(t,o,{get:()=>e[o],enumerable:!(r=ne(e,o))||r.enumerable});return t};var le=t=>ie(C({},"__esModule",{value:!0}),t);var Oe={};u(Oe,{default:()=>Re});module.exports=le(Oe);var T=class extends Error{constructor(e){super(e),this.name=this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},S=class extends T{},I=class extends T{#e;#t="";set code(e){this.#e=e}get code(){return this.#e}set originalMessage(e){this.#t=e}get originalMessage(){return this.#t}};var qe=Object.freeze({TimeoutError:S,ProtocolError:I});var f=class t{#e=!1;#t=!1;#n;#r=()=>{};#o=new Promise(e=>{this.#r=e});#s;#i;constructor(e){e&&e.timeout>0&&(this.#i=new S(e.message),this.#s=setTimeout(()=>{this.reject(this.#i)},e.timeout))}#l(e){clearTimeout(this.#s),this.#n=e,this.#r()}resolve(e){this.#t||this.#e||(this.#e=!0,this.#l(e))}reject(e){this.#t||this.#e||(this.#t=!0,this.#l(e))}resolved(){return this.#e}finished(){return this.#e||this.#t}value(){return this.#n}async valueOrThrow(){if(await this.#o,this.#t)throw this.#n;return this.#n}static create(e){return new t(e)}static async race(e){let n=new Set;try{let r=e.map(o=>o instanceof t?(o.#s&&n.add(o),o.valueOrThrow()):o);return await Promise.race(r)}finally{for(let r of n)r.reject(new Error("Timeout cleared"))}}};var X=new Map,G=t=>{let e=X.get(t);return e||(e=new Function(`return ${t}`)(),X.set(t,e),e)};var R={};u(R,{ariaQuerySelector:()=>ae,ariaQuerySelectorAll:()=>k});var ae=(t,e)=>window.__ariaQuerySelector(t,e),k=async function*(t,e){yield*await window.__ariaQuerySelectorAll(t,e)};var q={};u(q,{customQuerySelectors:()=>M});var O=class{#e=new Map;register(e,n){if(!n.queryOne&&n.queryAll){let r=n.queryAll;n.queryOne=(o,i)=>{for(let s of r(o,i))return s;return null}}else if(n.queryOne&&!n.queryAll){let r=n.queryOne;n.queryAll=(o,i)=>{let s=r(o,i);return s?[s]:[]}}else if(!n.queryOne||!n.queryAll)throw new Error("At least one query method must be defined.");this.#e.set(e,{querySelector:n.queryOne,querySelectorAll:n.queryAll})}unregister(e){this.#e.delete(e)}get(e){return this.#e.get(e)}clear(){this.#e.clear()}},M=new O;var D={};u(D,{pierceQuerySelector:()=>ce,pierceQuerySelectorAll:()=>ue});var ce=(t,e)=>{let n=null,r=o=>{let i=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&r(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==o&&!n&&s.matches(e)&&(n=s)}while(!n&&i.nextNode())};return t instanceof Document&&(t=t.documentElement),r(t),n},ue=(t,e)=>{let n=[],r=o=>{let i=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&r(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==o&&s.matches(e)&&n.push(s)}while(i.nextNode())};return t instanceof Document&&(t=t.documentElement),r(t),n};var m=(t,e)=>{if(!t)throw new Error(e)};var E=class{#e;#t;#n;#r;constructor(e,n){this.#e=e,this.#t=n}async start(){let e=this.#r=f.create(),n=await this.#e();if(n){e.resolve(n);return}this.#n=new MutationObserver(async()=>{let r=await this.#e();r&&(e.resolve(r),await this.stop())}),this.#n.observe(this.#t,{childList:!0,subtree:!0,attributes:!0})}async stop(){m(this.#r,"Polling never started."),this.#r.finished()||this.#r.reject(new Error("Polling stopped")),this.#n&&(this.#n.disconnect(),this.#n=void 0)}result(){return m(this.#r,"Polling never started."),this.#r.valueOrThrow()}},P=class{#e;#t;constructor(e){this.#e=e}async start(){let e=this.#t=f.create(),n=await this.#e();if(n){e.resolve(n);return}let r=async()=>{if(e.finished())return;let o=await this.#e();if(!o){window.requestAnimationFrame(r);return}e.resolve(o),await this.stop()};window.requestAnimationFrame(r)}async stop(){m(this.#t,"Polling never started."),this.#t.finished()||this.#t.reject(new Error("Polling stopped"))}result(){return m(this.#t,"Polling never started."),this.#t.valueOrThrow()}},x=class{#e;#t;#n;#r;constructor(e,n){this.#e=e,this.#t=n}async start(){let e=this.#r=f.create(),n=await this.#e();if(n){e.resolve(n);return}this.#n=setInterval(async()=>{let r=await this.#e();r&&(e.resolve(r),await this.stop())},this.#t)}async stop(){m(this.#r,"Polling never started."),this.#r.finished()||this.#r.reject(new Error("Polling stopped")),this.#n&&(clearInterval(this.#n),this.#n=void 0)}result(){return m(this.#r,"Polling never started."),this.#r.valueOrThrow()}};var W={};u(W,{pQuerySelector:()=>Ie,pQuerySelectorAll:()=>re});var c=class{static async*map(e,n){for await(let r of e)yield await n(r)}static async*flatMap(e,n){for await(let r of e)yield*n(r)}static async collect(e){let n=[];for await(let r of e)n.push(r);return n}static async first(e){for await(let n of e)return n}};var p={attribute:/\\[\\s*(?:(?<namespace>\\*|[-\\w\\P{ASCII}]*)\\|)?(?<name>[-\\w\\P{ASCII}]+)\\s*(?:(?<operator>\\W?=)\\s*(?<value>.+?)\\s*(\\s(?<caseSensitive>[iIsS]))?\\s*)?\\]/gu,id:/#(?<name>[-\\w\\P{ASCII}]+)/gu,class:/\\.(?<name>[-\\w\\P{ASCII}]+)/gu,comma:/\\s*,\\s*/g,combinator:/\\s*[\\s>+~]\\s*/g,"pseudo-element":/::(?<name>[-\\w\\P{ASCII}]+)(?:\\((?<argument>\xB6*)\\))?/gu,"pseudo-class":/:(?<name>[-\\w\\P{ASCII}]+)(?:\\((?<argument>\xB6*)\\))?/gu,universal:/(?:(?<namespace>\\*|[-\\w\\P{ASCII}]*)\\|)?\\*/gu,type:/(?:(?<namespace>\\*|[-\\w\\P{ASCII}]*)\\|)?(?<name>[-\\w\\P{ASCII}]+)/gu},fe=new Set(["combinator","comma"]);var de=t=>{switch(t){case"pseudo-element":case"pseudo-class":return new RegExp(p[t].source.replace("(?<argument>\\xB6*)","(?<argument>.*)"),"gu");default:return p[t]}};function me(t,e){let n=0,r="";for(;e<t.length;e++){let o=t[e];switch(o){case"(":++n;break;case")":--n;break}if(r+=o,n===0)return r}return r}function he(t,e=p){if(!t)return[];let n=[t];for(let[o,i]of Object.entries(e))for(let s=0;s<n.length;s++){let l=n[s];if(typeof l!="string")continue;i.lastIndex=0;let a=i.exec(l);if(!a)continue;let h=a.index-1,d=[],H=a[0],B=l.slice(0,h+1);B&&d.push(B),d.push({...a.groups,type:o,content:H});let z=l.slice(h+H.length+1);z&&d.push(z),n.splice(s,1,...d)}let r=0;for(let o of n)switch(typeof o){case"string":throw new Error(`Unexpected sequence ${o} found at index ${r}`);case"object":r+=o.content.length,o.pos=[r-o.content.length,r],fe.has(o.type)&&(o.content=o.content.trim()||" ");break}return n}var pe=/([\'"])([^\\\\\\n]+?)\\1/g,ye=/\\\\./g;function K(t,e=p){if(t=t.trim(),t==="")return[];let n=[];t=t.replace(ye,(i,s)=>(n.push({value:i,offset:s}),"\\uE000".repeat(i.length))),t=t.replace(pe,(i,s,l,a)=>(n.push({value:i,offset:a}),`${s}${"\\uE001".repeat(l.length)}${s}`));{let i=0,s;for(;(s=t.indexOf("(",i))>-1;){let l=me(t,s);n.push({value:l,offset:s}),t=`${t.substring(0,s)}(${"\\xB6".repeat(l.length-2)})${t.substring(s+l.length)}`,i=s+l.length}}let r=he(t,e),o=new Set;for(let i of n.reverse())for(let s of r){let{offset:l,value:a}=i;if(!(s.pos[0]<=l&&l+a.length<=s.pos[1]))continue;let{content:h}=s,d=l-s.pos[0];s.content=h.slice(0,d)+a+h.slice(d+a.length),s.content!==h&&o.add(s)}for(let i of o){let s=de(i.type);if(!s)throw new Error(`Unknown token type: ${i.type}`);s.lastIndex=0;let l=s.exec(i.content);if(!l)throw new Error(`Unable to parse content for ${i.type}: ${i.content}`);Object.assign(i,l.groups)}return r}function*N(t,e){switch(t.type){case"list":for(let n of t.list)yield*N(n,t);break;case"complex":yield*N(t.left,t),yield*N(t.right,t);break;case"compound":yield*t.list.map(n=>[n,t]);break;default:yield[t,e]}}function y(t){let e;return Array.isArray(t)?e=t:e=[...N(t)].map(([n])=>n),e.map(n=>n.content).join("")}p.combinator=/\\s*(>>>>?|[\\s>+~])\\s*/g;var ge=/\\\\[\\s\\S]/g,we=t=>t.length<=1?t:((t[0]===\'"\'||t[0]==="\'")&&t.endsWith(t[0])&&(t=t.slice(1,-1)),t.replace(ge,e=>e[1]));function Y(t){let e=!0,n=K(t);if(n.length===0)return[[],e];let r=[],o=[r],i=[o],s=[];for(let l of n){switch(l.type){case"combinator":switch(l.content){case">>>":e=!1,s.length&&(r.push(y(s)),s.splice(0)),r=[],o.push(">>>"),o.push(r);continue;case">>>>":e=!1,s.length&&(r.push(y(s)),s.splice(0)),r=[],o.push(">>>>"),o.push(r);continue}break;case"pseudo-element":if(!l.name.startsWith("-p-"))break;e=!1,s.length&&(r.push(y(s)),s.splice(0)),r.push({name:l.name.slice(3),value:we(l.argument??"")});continue;case"comma":s.length&&(r.push(y(s)),s.splice(0)),r=[],o=[r],i.push(o);continue}s.push(l)}return s.length&&r.push(y(s)),[i,e]}var Q={};u(Q,{textQuerySelectorAll:()=>b});var Se=new Set(["checkbox","image","radio"]),be=t=>t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&!Se.has(t.type),Te=new Set(["SCRIPT","STYLE"]),w=t=>!Te.has(t.nodeName)&&!document.head?.contains(t),_=new WeakMap,Z=t=>{for(;t;)_.delete(t),t instanceof ShadowRoot?t=t.host:t=t.parentNode},J=new WeakSet,Ee=new MutationObserver(t=>{for(let e of t)Z(e.target)}),g=t=>{let e=_.get(t);if(e||(e={full:"",immediate:[]},!w(t)))return e;let n="";if(be(t))e.full=t.value,e.immediate.push(t.value),t.addEventListener("input",r=>{Z(r.target)},{once:!0,capture:!0});else{for(let r=t.firstChild;r;r=r.nextSibling){if(r.nodeType===Node.TEXT_NODE){e.full+=r.nodeValue??"",n+=r.nodeValue??"";continue}n&&e.immediate.push(n),n="",r.nodeType===Node.ELEMENT_NODE&&(e.full+=g(r).full)}n&&e.immediate.push(n),t instanceof Element&&t.shadowRoot&&(e.full+=g(t.shadowRoot).full),J.has(t)||(Ee.observe(t,{childList:!0,characterData:!0,subtree:!0}),J.add(t))}return _.set(t,e),e};var b=function*(t,e){let n=!1;for(let r of t.childNodes)if(r instanceof Element&&w(r)){let o;r.shadowRoot?o=b(r.shadowRoot,e):o=b(r,e);for(let i of o)yield i,n=!0}n||t instanceof Element&&w(t)&&g(t).full.includes(e)&&(yield t)};var $={};u($,{checkVisibility:()=>xe,pierce:()=>A,pierceAll:()=>L});var Pe=["hidden","collapse"],xe=(t,e)=>{if(!t)return e===!1;if(e===void 0)return t;let n=t.nodeType===Node.TEXT_NODE?t.parentElement:t,r=window.getComputedStyle(n),o=r&&!Pe.includes(r.visibility)&&!Ne(n);return e===o?t:!1};function Ne(t){let e=t.getBoundingClientRect();return e.width===0||e.height===0}var Ae=t=>"shadowRoot"in t&&t.shadowRoot instanceof ShadowRoot;function*A(t){Ae(t)?yield t.shadowRoot:yield t}function*L(t){t=A(t).next().value,yield t;let e=[document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT)];for(let n of e){let r;for(;r=n.nextNode();)r.shadowRoot&&(yield r.shadowRoot,e.push(document.createTreeWalker(r.shadowRoot,NodeFilter.SHOW_ELEMENT)))}}var U={};u(U,{xpathQuerySelectorAll:()=>j});var j=function*(t,e,n=-1){let o=(t.ownerDocument||document).evaluate(e,t,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE),i=[],s;for(;(s=o.iterateNext())&&(i.push(s),!(n&&i.length===n)););for(let l=0;l<i.length;l++)s=i[l],yield s,delete i[l]};var ve=/[-\\w\\P{ASCII}*]/,ee=t=>"querySelectorAll"in t,v=class extends Error{constructor(e,n){super(`${e} is not a valid selector: ${n}`)}},F=class{#e;#t;#n=[];#r=void 0;elements;constructor(e,n,r){this.elements=[e],this.#e=n,this.#t=r,this.#o()}async run(){if(typeof this.#r=="string")switch(this.#r.trimStart()){case":scope":this.#o();break}for(;this.#r!==void 0;this.#o()){let e=this.#r,n=this.#e;typeof e=="string"?e[0]&&ve.test(e[0])?this.elements=c.flatMap(this.elements,async function*(r){ee(r)&&(yield*r.querySelectorAll(e))}):this.elements=c.flatMap(this.elements,async function*(r){if(!r.parentElement){if(!ee(r))return;yield*r.querySelectorAll(e);return}let o=0;for(let i of r.parentElement.children)if(++o,i===r)break;yield*r.parentElement.querySelectorAll(`:scope>:nth-child(${o})${e}`)}):this.elements=c.flatMap(this.elements,async function*(r){switch(e.name){case"text":yield*b(r,e.value);break;case"xpath":yield*j(r,e.value);break;case"aria":yield*k(r,e.value);break;default:let o=M.get(e.name);if(!o)throw new v(n,`Unknown selector type: ${e.name}`);yield*o.querySelectorAll(r,e.value)}})}}#o(){if(this.#n.length!==0){this.#r=this.#n.shift();return}if(this.#t.length===0){this.#r=void 0;return}let e=this.#t.shift();switch(e){case">>>>":{this.elements=c.flatMap(this.elements,A),this.#o();break}case">>>":{this.elements=c.flatMap(this.elements,L),this.#o();break}default:this.#n=e,this.#o();break}}},V=class{#e=new WeakMap;calculate(e,n=[]){if(e===null)return n;e instanceof ShadowRoot&&(e=e.host);let r=this.#e.get(e);if(r)return[...r,...n];let o=0;for(let s=e.previousSibling;s;s=s.previousSibling)++o;let i=this.calculate(e.parentNode,[o]);return this.#e.set(e,i),[...i,...n]}},te=(t,e)=>{if(t.length+e.length===0)return 0;let[n=-1,...r]=t,[o=-1,...i]=e;return n===o?te(r,i):n<o?-1:1},Ce=async function*(t){let e=new Set;for await(let r of t)e.add(r);let n=new V;yield*[...e.values()].map(r=>[r,n.calculate(r)]).sort(([,r],[,o])=>te(r,o)).map(([r])=>r)},re=function(t,e){let n,r;try{[n,r]=Y(e)}catch{return t.querySelectorAll(e)}if(r)return t.querySelectorAll(e);if(n.some(o=>{let i=0;return o.some(s=>(typeof s=="string"?++i:i=0,i>1))}))throw new v(e,"Multiple deep combinators found in sequence.");return Ce(c.flatMap(n,o=>{let i=new F(t,e,o);return i.run(),i.elements}))},Ie=async function(t,e){for await(let n of re(t,e))return n;return null};var ke=Object.freeze({...R,...q,...D,...W,...Q,...$,...U,Deferred:f,createFunction:G,createTextContent:g,IntervalPoller:x,isSuitableNodeForTextMatching:w,MutationPoller:E,RAFPoller:P}),Re=ke;\n';
22836
+ var source = '"use strict";var C=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var se=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var n in e)C(t,n,{get:e[n],enumerable:!0})},ie=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of oe(e))!se.call(t,o)&&o!==n&&C(t,o,{get:()=>e[o],enumerable:!(r=ne(e,o))||r.enumerable});return t};var le=t=>ie(C({},"__esModule",{value:!0}),t);var Oe={};u(Oe,{default:()=>Re});module.exports=le(Oe);var T=class extends Error{constructor(e){super(e),this.name=this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},S=class extends T{},I=class extends T{#e;#t="";set code(e){this.#e=e}get code(){return this.#e}set originalMessage(e){this.#t=e}get originalMessage(){return this.#t}};var qe=Object.freeze({TimeoutError:S,ProtocolError:I});var f=class t{#e=!1;#t=!1;#n;#r=()=>{};#o=new Promise(e=>{this.#r=e});#s;#i;constructor(e){e&&e.timeout>0&&(this.#i=new S(e.message),this.#s=setTimeout(()=>{this.reject(this.#i)},e.timeout))}#l(e){clearTimeout(this.#s),this.#n=e,this.#r()}resolve(e){this.#t||this.#e||(this.#e=!0,this.#l(e))}reject(e){this.#t||this.#e||(this.#t=!0,this.#l(e))}resolved(){return this.#e}finished(){return this.#e||this.#t}value(){return this.#n}async valueOrThrow(){if(await this.#o,this.#t)throw this.#n;return this.#n}static create(e){return new t(e)}static async race(e){let n=new Set;try{let r=e.map(o=>o instanceof t?(o.#s&&n.add(o),o.valueOrThrow()):o);return await Promise.race(r)}finally{for(let r of n)r.reject(new Error("Timeout cleared"))}}};var X=new Map,G=t=>{let e=X.get(t);return e||(e=new Function(`return ${t}`)(),X.set(t,e),e)};var R={};u(R,{ariaQuerySelector:()=>ae,ariaQuerySelectorAll:()=>k});var ae=(t,e)=>window.__ariaQuerySelector(t,e),k=async function*(t,e){yield*await window.__ariaQuerySelectorAll(t,e)};var q={};u(q,{customQuerySelectors:()=>M});var O=class{#e=new Map;register(e,n){if(!n.queryOne&&n.queryAll){let r=n.queryAll;n.queryOne=(o,i)=>{for(let s of r(o,i))return s;return null}}else if(n.queryOne&&!n.queryAll){let r=n.queryOne;n.queryAll=(o,i)=>{let s=r(o,i);return s?[s]:[]}}else if(!n.queryOne||!n.queryAll)throw new Error("At least one query method must be defined.");this.#e.set(e,{querySelector:n.queryOne,querySelectorAll:n.queryAll})}unregister(e){this.#e.delete(e)}get(e){return this.#e.get(e)}clear(){this.#e.clear()}},M=new O;var D={};u(D,{pierceQuerySelector:()=>ce,pierceQuerySelectorAll:()=>ue});var ce=(t,e)=>{let n=null,r=o=>{let i=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&r(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==o&&!n&&s.matches(e)&&(n=s)}while(!n&&i.nextNode())};return t instanceof Document&&(t=t.documentElement),r(t),n},ue=(t,e)=>{let n=[],r=o=>{let i=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&r(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==o&&s.matches(e)&&n.push(s)}while(i.nextNode())};return t instanceof Document&&(t=t.documentElement),r(t),n};var m=(t,e)=>{if(!t)throw new Error(e)};var E=class{#e;#t;#n;#r;constructor(e,n){this.#e=e,this.#t=n}async start(){let e=this.#r=f.create(),n=await this.#e();if(n){e.resolve(n);return}this.#n=new MutationObserver(async()=>{let r=await this.#e();r&&(e.resolve(r),await this.stop())}),this.#n.observe(this.#t,{childList:!0,subtree:!0,attributes:!0})}async stop(){m(this.#r,"Polling never started."),this.#r.finished()||this.#r.reject(new Error("Polling stopped")),this.#n&&(this.#n.disconnect(),this.#n=void 0)}result(){return m(this.#r,"Polling never started."),this.#r.valueOrThrow()}},P=class{#e;#t;constructor(e){this.#e=e}async start(){let e=this.#t=f.create(),n=await this.#e();if(n){e.resolve(n);return}let r=async()=>{if(e.finished())return;let o=await this.#e();if(!o){window.requestAnimationFrame(r);return}e.resolve(o),await this.stop()};window.requestAnimationFrame(r)}async stop(){m(this.#t,"Polling never started."),this.#t.finished()||this.#t.reject(new Error("Polling stopped"))}result(){return m(this.#t,"Polling never started."),this.#t.valueOrThrow()}},x=class{#e;#t;#n;#r;constructor(e,n){this.#e=e,this.#t=n}async start(){let e=this.#r=f.create(),n=await this.#e();if(n){e.resolve(n);return}this.#n=setInterval(async()=>{let r=await this.#e();r&&(e.resolve(r),await this.stop())},this.#t)}async stop(){m(this.#r,"Polling never started."),this.#r.finished()||this.#r.reject(new Error("Polling stopped")),this.#n&&(clearInterval(this.#n),this.#n=void 0)}result(){return m(this.#r,"Polling never started."),this.#r.valueOrThrow()}};var W={};u(W,{pQuerySelector:()=>Ie,pQuerySelectorAll:()=>re});var c=class{static async*map(e,n){for await(let r of e)yield await n(r)}static async*flatMap(e,n){for await(let r of e)yield*n(r)}static async collect(e){let n=[];for await(let r of e)n.push(r);return n}static async first(e){for await(let n of e)return n}};var p={attribute:/\\[\\s*(?:(?<namespace>\\*|[-\\w\\P{ASCII}]*)\\|)?(?<name>[-\\w\\P{ASCII}]+)\\s*(?:(?<operator>\\W?=)\\s*(?<value>.+?)\\s*(\\s(?<caseSensitive>[iIsS]))?\\s*)?\\]/gu,id:/#(?<name>[-\\w\\P{ASCII}]+)/gu,class:/\\.(?<name>[-\\w\\P{ASCII}]+)/gu,comma:/\\s*,\\s*/g,combinator:/\\s*[\\s>+~]\\s*/g,"pseudo-element":/::(?<name>[-\\w\\P{ASCII}]+)(?:\\((?<argument>\xB6*)\\))?/gu,"pseudo-class":/:(?<name>[-\\w\\P{ASCII}]+)(?:\\((?<argument>\xB6*)\\))?/gu,universal:/(?:(?<namespace>\\*|[-\\w\\P{ASCII}]*)\\|)?\\*/gu,type:/(?:(?<namespace>\\*|[-\\w\\P{ASCII}]*)\\|)?(?<name>[-\\w\\P{ASCII}]+)/gu},fe=new Set(["combinator","comma"]);var de=t=>{switch(t){case"pseudo-element":case"pseudo-class":return new RegExp(p[t].source.replace("(?<argument>\\xB6*)","(?<argument>.*)"),"gu");default:return p[t]}};function me(t,e){let n=0,r="";for(;e<t.length;e++){let o=t[e];switch(o){case"(":++n;break;case")":--n;break}if(r+=o,n===0)return r}return r}function he(t,e=p){if(!t)return[];let n=[t];for(let[o,i]of Object.entries(e))for(let s=0;s<n.length;s++){let l=n[s];if(typeof l!="string")continue;i.lastIndex=0;let a=i.exec(l);if(!a)continue;let h=a.index-1,d=[],H=a[0],B=l.slice(0,h+1);B&&d.push(B),d.push({...a.groups,type:o,content:H});let z=l.slice(h+H.length+1);z&&d.push(z),n.splice(s,1,...d)}let r=0;for(let o of n)switch(typeof o){case"string":throw new Error(`Unexpected sequence ${o} found at index ${r}`);case"object":r+=o.content.length,o.pos=[r-o.content.length,r],fe.has(o.type)&&(o.content=o.content.trim()||" ");break}return n}var pe=/([\'"])([^\\\\\\n]+?)\\1/g,ye=/\\\\./g;function K(t,e=p){if(t=t.trim(),t==="")return[];let n=[];t=t.replace(ye,(i,s)=>(n.push({value:i,offset:s}),"\\uE000".repeat(i.length))),t=t.replace(pe,(i,s,l,a)=>(n.push({value:i,offset:a}),`${s}${"\\uE001".repeat(l.length)}${s}`));{let i=0,s;for(;(s=t.indexOf("(",i))>-1;){let l=me(t,s);n.push({value:l,offset:s}),t=`${t.substring(0,s)}(${"\\xB6".repeat(l.length-2)})${t.substring(s+l.length)}`,i=s+l.length}}let r=he(t,e),o=new Set;for(let i of n.reverse())for(let s of r){let{offset:l,value:a}=i;if(!(s.pos[0]<=l&&l+a.length<=s.pos[1]))continue;let{content:h}=s,d=l-s.pos[0];s.content=h.slice(0,d)+a+h.slice(d+a.length),s.content!==h&&o.add(s)}for(let i of o){let s=de(i.type);if(!s)throw new Error(`Unknown token type: ${i.type}`);s.lastIndex=0;let l=s.exec(i.content);if(!l)throw new Error(`Unable to parse content for ${i.type}: ${i.content}`);Object.assign(i,l.groups)}return r}function*N(t,e){switch(t.type){case"list":for(let n of t.list)yield*N(n,t);break;case"complex":yield*N(t.left,t),yield*N(t.right,t);break;case"compound":yield*t.list.map(n=>[n,t]);break;default:yield[t,e]}}function y(t){let e;return Array.isArray(t)?e=t:e=[...N(t)].map(([n])=>n),e.map(n=>n.content).join("")}p.combinator=/\\s*(>>>>?|[\\s>+~])\\s*/g;var ge=/\\\\[\\s\\S]/g,we=t=>t.length<=1?t:((t[0]===\'"\'||t[0]==="\'")&&t.endsWith(t[0])&&(t=t.slice(1,-1)),t.replace(ge,e=>e[1]));function Y(t){let e=!0,n=K(t);if(n.length===0)return[[],e];let r=[],o=[r],i=[o],s=[];for(let l of n){switch(l.type){case"combinator":switch(l.content){case">>>":e=!1,s.length&&(r.push(y(s)),s.splice(0)),r=[],o.push(">>>"),o.push(r);continue;case">>>>":e=!1,s.length&&(r.push(y(s)),s.splice(0)),r=[],o.push(">>>>"),o.push(r);continue}break;case"pseudo-element":if(!l.name.startsWith("-p-"))break;e=!1,s.length&&(r.push(y(s)),s.splice(0)),r.push({name:l.name.slice(3),value:we(l.argument??"")});continue;case"comma":s.length&&(r.push(y(s)),s.splice(0)),r=[],o=[r],i.push(o);continue}s.push(l)}return s.length&&r.push(y(s)),[i,e]}var Q={};u(Q,{textQuerySelectorAll:()=>b});var Se=new Set(["checkbox","image","radio"]),be=t=>t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&!Se.has(t.type),Te=new Set(["SCRIPT","STYLE"]),w=t=>!Te.has(t.nodeName)&&!document.head?.contains(t),_=new WeakMap,Z=t=>{for(;t;)_.delete(t),t instanceof ShadowRoot?t=t.host:t=t.parentNode},J=new WeakSet,Ee=new MutationObserver(t=>{for(let e of t)Z(e.target)}),g=t=>{let e=_.get(t);if(e||(e={full:"",immediate:[]},!w(t)))return e;let n="";if(be(t))e.full=t.value,e.immediate.push(t.value),t.addEventListener("input",r=>{Z(r.target)},{once:!0,capture:!0});else{for(let r=t.firstChild;r;r=r.nextSibling){if(r.nodeType===Node.TEXT_NODE){e.full+=r.nodeValue??"",n+=r.nodeValue??"";continue}n&&e.immediate.push(n),n="",r.nodeType===Node.ELEMENT_NODE&&(e.full+=g(r).full)}n&&e.immediate.push(n),t instanceof Element&&t.shadowRoot&&(e.full+=g(t.shadowRoot).full),J.has(t)||(Ee.observe(t,{childList:!0,characterData:!0,subtree:!0}),J.add(t))}return _.set(t,e),e};var b=function*(t,e){let n=!1;for(let r of t.childNodes)if(r instanceof Element&&w(r)){let o;r.shadowRoot?o=b(r.shadowRoot,e):o=b(r,e);for(let i of o)yield i,n=!0}n||t instanceof Element&&w(t)&&g(t).full.includes(e)&&(yield t)};var $={};u($,{checkVisibility:()=>xe,pierce:()=>A,pierceAll:()=>L});var Pe=["hidden","collapse"],xe=(t,e)=>{if(!t)return e===!1;if(e===void 0)return t;let n=t.nodeType===Node.TEXT_NODE?t.parentElement:t,r=window.getComputedStyle(n),o=r&&!Pe.includes(r.visibility)&&!Ne(n);return e===o?t:!1};function Ne(t){let e=t.getBoundingClientRect();return e.width===0||e.height===0}var Ae=t=>"shadowRoot"in t&&t.shadowRoot instanceof ShadowRoot;function*A(t){Ae(t)?yield t.shadowRoot:yield t}function*L(t){t=A(t).next().value,yield t;let e=[document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT)];for(let n of e){let r;for(;r=n.nextNode();)r.shadowRoot&&(yield r.shadowRoot,e.push(document.createTreeWalker(r.shadowRoot,NodeFilter.SHOW_ELEMENT)))}}var U={};u(U,{xpathQuerySelectorAll:()=>j});var j=function*(t,e,n=-1){let o=(t.ownerDocument||document).evaluate(e,t,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE),i=[],s;for(;(s=o.iterateNext())&&(i.push(s),!(n&&i.length===n)););for(let l=0;l<i.length;l++)s=i[l],yield s,delete i[l]};var ve=/[-\\w\\P{ASCII}*]/,ee=t=>"querySelectorAll"in t,v=class extends Error{constructor(e,n){super(`${e} is not a valid selector: ${n}`)}},F=class{#e;#t;#n=[];#r=void 0;elements;constructor(e,n,r){this.elements=[e],this.#e=n,this.#t=r,this.#o()}async run(){if(typeof this.#r=="string")switch(this.#r.trimStart()){case":scope":this.#o();break}for(;this.#r!==void 0;this.#o()){let e=this.#r,n=this.#e;typeof e=="string"?e[0]&&ve.test(e[0])?this.elements=c.flatMap(this.elements,async function*(r){ee(r)&&(yield*r.querySelectorAll(e))}):this.elements=c.flatMap(this.elements,async function*(r){if(!r.parentElement){if(!ee(r))return;yield*r.querySelectorAll(e);return}let o=0;for(let i of r.parentElement.children)if(++o,i===r)break;yield*r.parentElement.querySelectorAll(`:scope>:nth-child(${o})${e}`)}):this.elements=c.flatMap(this.elements,async function*(r){switch(e.name){case"text":yield*b(r,e.value);break;case"xpath":yield*j(r,e.value);break;case"aria":yield*k(r,e.value);break;default:let o=M.get(e.name);if(!o)throw new v(n,`Unknown selector type: ${e.name}`);yield*o.querySelectorAll(r,e.value)}})}}#o(){if(this.#n.length!==0){this.#r=this.#n.shift();return}if(this.#t.length===0){this.#r=void 0;return}let e=this.#t.shift();switch(e){case">>>>":{this.elements=c.flatMap(this.elements,A),this.#o();break}case">>>":{this.elements=c.flatMap(this.elements,L),this.#o();break}default:this.#n=e,this.#o();break}}},V=class{#e=new WeakMap;calculate(e,n=[]){if(e===null)return n;e instanceof ShadowRoot&&(e=e.host);let r=this.#e.get(e);if(r)return[...r,...n];let o=0;for(let s=e.previousSibling;s;s=s.previousSibling)++o;let i=this.calculate(e.parentNode,[o]);return this.#e.set(e,i),[...i,...n]}},te=(t,e)=>{if(t.length+e.length===0)return 0;let[n=-1,...r]=t,[o=-1,...i]=e;return n===o?te(r,i):n<o?-1:1},Ce=async function*(t){let e=new Set;for await(let r of t)e.add(r);let n=new V;yield*[...e.values()].map(r=>[r,n.calculate(r)]).sort(([,r],[,o])=>te(r,o)).map(([r])=>r)},re=function(t,e){let n,r;try{[n,r]=Y(e)}catch{return t.querySelectorAll(e)}if(r)return t.querySelectorAll(e);if(n.some(o=>{let i=0;return o.some(s=>(typeof s=="string"?++i:i=0,i>1))}))throw new v(e,"Multiple deep combinators found in sequence.");return Ce(c.flatMap(n,o=>{let i=new F(t,e,o);return i.run(),i.elements}))},Ie=async function(t,e){for await(let n of re(t,e))return n;return null};var ke=Object.freeze({...R,...q,...D,...W,...Q,...$,...U,Deferred:f,createFunction:G,createTextContent:g,IntervalPoller:x,isSuitableNodeForTextMatching:w,MutationPoller:E,RAFPoller:P}),Re=ke;\n/**\n * @license\n * Copyright 2018 Google Inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @license\n * Copyright 2023 Google Inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @license\n * Copyright 2022 Google Inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @license\n * Copyright 2020 Google Inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n';
22834
22837
 
22835
22838
  // node_modules/puppeteer-core/lib/esm/puppeteer/common/ScriptInjector.js
22836
22839
  var ScriptInjector = class {
@@ -26693,6 +26696,7 @@ ${sourceUrlComment}
26693
26696
  return this.#frameOrWorker.client;
26694
26697
  }
26695
26698
  clearContext() {
26699
+ this.#context?.reject(new Error("Execution context was destroyed"));
26696
26700
  this.#context = Deferred.create();
26697
26701
  if ("clearDocumentHandle" in this.#frameOrWorker) {
26698
26702
  this.#frameOrWorker.clearDocumentHandle();
@@ -27110,6 +27114,10 @@ ${sourceUrlComment}
27110
27114
  updateClient(client, keepWorlds = false) {
27111
27115
  this.#client = client;
27112
27116
  if (!keepWorlds) {
27117
+ if (this.worlds) {
27118
+ this.worlds[MAIN_WORLD].clearContext();
27119
+ this.worlds[PUPPETEER_WORLD].clearContext();
27120
+ }
27113
27121
  this.worlds = {
27114
27122
  [MAIN_WORLD]: new IsolatedWorld(this, this._frameManager.timeoutSettings),
27115
27123
  [PUPPETEER_WORLD]: new IsolatedWorld(this, this._frameManager.timeoutSettings)
@@ -27487,6 +27495,7 @@ ${sourceUrlComment}
27487
27495
  #url;
27488
27496
  #resourceType;
27489
27497
  #method;
27498
+ #hasPostData = false;
27490
27499
  #postData;
27491
27500
  #headers = {};
27492
27501
  #frame;
@@ -27512,6 +27521,7 @@ ${sourceUrlComment}
27512
27521
  this.#resourceType = (data.type || "other").toLowerCase();
27513
27522
  this.#method = data.request.method;
27514
27523
  this.#postData = data.request.postData;
27524
+ this.#hasPostData = data.request.hasPostData ?? false;
27515
27525
  this.#frame = frame;
27516
27526
  this._redirectChain = redirectChain;
27517
27527
  this.#continueRequestOverrides = {};
@@ -27577,6 +27587,20 @@ ${sourceUrlComment}
27577
27587
  postData() {
27578
27588
  return this.#postData;
27579
27589
  }
27590
+ hasPostData() {
27591
+ return this.#hasPostData;
27592
+ }
27593
+ async fetchPostData() {
27594
+ try {
27595
+ const result = await this.#client.send("Network.getRequestPostData", {
27596
+ requestId: this._requestId
27597
+ });
27598
+ return result.postData;
27599
+ } catch (err) {
27600
+ debugError(err);
27601
+ return;
27602
+ }
27603
+ }
27580
27604
  headers() {
27581
27605
  return this.#headers;
27582
27606
  }
@@ -29865,6 +29889,10 @@ ${sourceUrlComment}
29865
29889
  // node_modules/puppeteer-core/lib/esm/puppeteer/cdp/WebWorker.js
29866
29890
  init_dirname();
29867
29891
  init_buffer2();
29892
+
29893
+ // node_modules/puppeteer-core/lib/esm/puppeteer/api/WebWorker.js
29894
+ init_dirname();
29895
+ init_buffer2();
29868
29896
  init_EventEmitter();
29869
29897
  init_util2();
29870
29898
  var WebWorker = class extends EventEmitter2 {
@@ -29872,16 +29900,77 @@ ${sourceUrlComment}
29872
29900
  * @internal
29873
29901
  */
29874
29902
  timeoutSettings = new TimeoutSettings();
29875
- #world;
29876
- #client;
29877
29903
  #url;
29878
29904
  /**
29879
29905
  * @internal
29880
29906
  */
29881
- constructor(client, url, consoleAPICalled, exceptionThrown) {
29907
+ constructor(url) {
29882
29908
  super();
29883
- this.#client = client;
29884
29909
  this.#url = url;
29910
+ }
29911
+ /**
29912
+ * The URL of this web worker.
29913
+ */
29914
+ url() {
29915
+ return this.#url;
29916
+ }
29917
+ /**
29918
+ * Evaluates a given function in the {@link WebWorker | worker}.
29919
+ *
29920
+ * @remarks If the given function returns a promise,
29921
+ * {@link WebWorker.evaluate | evaluate} will wait for the promise to resolve.
29922
+ *
29923
+ * As a rule of thumb, if the return value of the given function is more
29924
+ * complicated than a JSON object (e.g. most classes), then
29925
+ * {@link WebWorker.evaluate | evaluate} will _likely_ return some truncated
29926
+ * value (or `{}`). This is because we are not returning the actual return
29927
+ * value, but a deserialized version as a result of transferring the return
29928
+ * value through a protocol to Puppeteer.
29929
+ *
29930
+ * In general, you should use
29931
+ * {@link WebWorker.evaluateHandle | evaluateHandle} if
29932
+ * {@link WebWorker.evaluate | evaluate} cannot serialize the return value
29933
+ * properly or you need a mutable {@link JSHandle | handle} to the return
29934
+ * object.
29935
+ *
29936
+ * @param func - Function to be evaluated.
29937
+ * @param args - Arguments to pass into `func`.
29938
+ * @returns The result of `func`.
29939
+ */
29940
+ async evaluate(func, ...args) {
29941
+ func = withSourcePuppeteerURLIfNone(this.evaluate.name, func);
29942
+ return await this.mainRealm().evaluate(func, ...args);
29943
+ }
29944
+ /**
29945
+ * Evaluates a given function in the {@link WebWorker | worker}.
29946
+ *
29947
+ * @remarks If the given function returns a promise,
29948
+ * {@link WebWorker.evaluate | evaluate} will wait for the promise to resolve.
29949
+ *
29950
+ * In general, you should use
29951
+ * {@link WebWorker.evaluateHandle | evaluateHandle} if
29952
+ * {@link WebWorker.evaluate | evaluate} cannot serialize the return value
29953
+ * properly or you need a mutable {@link JSHandle | handle} to the return
29954
+ * object.
29955
+ *
29956
+ * @param func - Function to be evaluated.
29957
+ * @param args - Arguments to pass into `func`.
29958
+ * @returns A {@link JSHandle | handle} to the return value of `func`.
29959
+ */
29960
+ async evaluateHandle(func, ...args) {
29961
+ func = withSourcePuppeteerURLIfNone(this.evaluateHandle.name, func);
29962
+ return await this.mainRealm().evaluateHandle(func, ...args);
29963
+ }
29964
+ };
29965
+
29966
+ // node_modules/puppeteer-core/lib/esm/puppeteer/cdp/WebWorker.js
29967
+ init_util2();
29968
+ var CdpWebWorker = class extends WebWorker {
29969
+ #world;
29970
+ #client;
29971
+ constructor(client, url, consoleAPICalled, exceptionThrown) {
29972
+ super(url);
29973
+ this.#client = client;
29885
29974
  this.#world = new IsolatedWorld(this, new TimeoutSettings());
29886
29975
  this.#client.once("Runtime.executionContextCreated", async (event) => {
29887
29976
  this.#world.setContext(new ExecutionContext(client, event.context, this.#world));
@@ -29898,58 +29987,12 @@ ${sourceUrlComment}
29898
29987
  this.#client.on("Runtime.exceptionThrown", exceptionThrown);
29899
29988
  this.#client.send("Runtime.enable").catch(debugError);
29900
29989
  }
29901
- /**
29902
- * @internal
29903
- */
29904
29990
  mainRealm() {
29905
29991
  return this.#world;
29906
29992
  }
29907
- /**
29908
- * The URL of this web worker.
29909
- */
29910
- url() {
29911
- return this.#url;
29912
- }
29913
- /**
29914
- * The CDP session client the WebWorker belongs to.
29915
- */
29916
29993
  get client() {
29917
29994
  return this.#client;
29918
29995
  }
29919
- /**
29920
- * If the function passed to the `worker.evaluate` returns a Promise, then
29921
- * `worker.evaluate` would wait for the promise to resolve and return its
29922
- * value. If the function passed to the `worker.evaluate` returns a
29923
- * non-serializable value, then `worker.evaluate` resolves to `undefined`.
29924
- * DevTools Protocol also supports transferring some additional values that
29925
- * are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`, and
29926
- * bigint literals.
29927
- * Shortcut for `await worker.executionContext()).evaluate(pageFunction, ...args)`.
29928
- *
29929
- * @param pageFunction - Function to be evaluated in the worker context.
29930
- * @param args - Arguments to pass to `pageFunction`.
29931
- * @returns Promise which resolves to the return value of `pageFunction`.
29932
- */
29933
- async evaluate(pageFunction, ...args) {
29934
- pageFunction = withSourcePuppeteerURLIfNone(this.evaluate.name, pageFunction);
29935
- return await this.mainRealm().evaluate(pageFunction, ...args);
29936
- }
29937
- /**
29938
- * The only difference between `worker.evaluate` and `worker.evaluateHandle`
29939
- * is that `worker.evaluateHandle` returns in-page object (JSHandle). If the
29940
- * function passed to the `worker.evaluateHandle` returns a `Promise`, then
29941
- * `worker.evaluateHandle` would wait for the promise to resolve and return
29942
- * its value. Shortcut for
29943
- * `await worker.executionContext()).evaluateHandle(pageFunction, ...args)`
29944
- *
29945
- * @param pageFunction - Function to be evaluated in the page context.
29946
- * @param args - Arguments to pass to `pageFunction`.
29947
- * @returns Promise which resolves to the return value of `pageFunction`.
29948
- */
29949
- async evaluateHandle(pageFunction, ...args) {
29950
- pageFunction = withSourcePuppeteerURLIfNone(this.evaluateHandle.name, pageFunction);
29951
- return await this.mainRealm().evaluateHandle(pageFunction, ...args);
29952
- }
29953
29996
  };
29954
29997
 
29955
29998
  // node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Page.js
@@ -30204,7 +30247,7 @@ ${sourceUrlComment}
30204
30247
  assert(session instanceof CdpCDPSession);
30205
30248
  this.#frameManager.onAttachedToTarget(session._target());
30206
30249
  if (session._target()._getTargetInfo().type === "worker") {
30207
- const worker = new WebWorker(session, session._target().url(), this.#addConsoleMessage.bind(this), this.#handleException.bind(this));
30250
+ const worker = new CdpWebWorker(session, session._target().url(), this.#addConsoleMessage.bind(this), this.#handleException.bind(this));
30208
30251
  this.#workers.set(session.id(), worker);
30209
30252
  this.emit("workercreated", worker);
30210
30253
  }
@@ -30302,7 +30345,7 @@ ${sourceUrlComment}
30302
30345
  const { level, text, args, source: source2, url, lineNumber } = event.entry;
30303
30346
  if (args) {
30304
30347
  args.map((arg) => {
30305
- return releaseObject(this.#primaryTargetClient, arg);
30348
+ void releaseObject(this.#primaryTargetClient, arg);
30306
30349
  });
30307
30350
  }
30308
30351
  if (source2 !== "worker") {
@@ -30432,6 +30475,9 @@ ${sourceUrlComment}
30432
30475
  });
30433
30476
  this.#exposedFunctions.set(name2, identifier);
30434
30477
  await Promise.all(this.frames().map((frame) => {
30478
+ if (frame !== this.mainFrame() && !frame._hasStartedLoading) {
30479
+ return;
30480
+ }
30435
30481
  return frame.evaluate(expression).catch(debugError);
30436
30482
  }));
30437
30483
  }
@@ -30443,6 +30489,9 @@ ${sourceUrlComment}
30443
30489
  await this.#primaryTargetClient.send("Runtime.removeBinding", { name: name2 });
30444
30490
  await this.removeScriptToEvaluateOnNewDocument(exposedFun);
30445
30491
  await Promise.all(this.frames().map((frame) => {
30492
+ if (frame !== this.mainFrame() && !frame._hasStartedLoading) {
30493
+ return;
30494
+ }
30446
30495
  return frame.evaluate((name3) => {
30447
30496
  globalThis[name3] = void 0;
30448
30497
  }, name2).catch(debugError);
@@ -30823,6 +30872,15 @@ ${sourceUrlComment}
30823
30872
  this.#session._setTarget(this);
30824
30873
  }
30825
30874
  }
30875
+ async asPage() {
30876
+ const session = this._session();
30877
+ if (!session) {
30878
+ return await this.createCDPSession().then((client) => {
30879
+ return CdpPage._create(client, this, false, null);
30880
+ });
30881
+ }
30882
+ return await CdpPage._create(session, this, false, null);
30883
+ }
30826
30884
  _subtype() {
30827
30885
  return this.#targetInfo.subtype;
30828
30886
  }
@@ -30980,7 +31038,7 @@ ${sourceUrlComment}
30980
31038
  /* isAutoAttachEmulated=*/
30981
31039
  false
30982
31040
  )).then((client) => {
30983
- return new WebWorker(
31041
+ return new CdpWebWorker(
30984
31042
  client,
30985
31043
  this._getTargetInfo().url,
30986
31044
  () => {
@@ -31610,6 +31668,48 @@ ${sourceUrlComment}
31610
31668
  @jspm/core/nodelibs/browser/buffer.js:
31611
31669
  (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
31612
31670
 
31671
+ puppeteer-core/lib/esm/third_party/rxjs/rxjs.js:
31672
+ (**
31673
+ * @license
31674
+ * Copyright 2023 Google Inc.
31675
+ * SPDX-License-Identifier: Apache-2.0
31676
+ *)
31677
+
31678
+ puppeteer-core/lib/esm/puppeteer/environment.js:
31679
+ (**
31680
+ * @license
31681
+ * Copyright 2020 Google Inc.
31682
+ * SPDX-License-Identifier: Apache-2.0
31683
+ *)
31684
+
31685
+ puppeteer-core/lib/esm/puppeteer/util/assert.js:
31686
+ (**
31687
+ * @license
31688
+ * Copyright 2020 Google Inc.
31689
+ * SPDX-License-Identifier: Apache-2.0
31690
+ *)
31691
+
31692
+ puppeteer-core/lib/esm/puppeteer/util/ErrorLike.js:
31693
+ (**
31694
+ * @license
31695
+ * Copyright 2022 Google Inc.
31696
+ * SPDX-License-Identifier: Apache-2.0
31697
+ *)
31698
+
31699
+ puppeteer-core/lib/esm/puppeteer/common/Debug.js:
31700
+ (**
31701
+ * @license
31702
+ * Copyright 2020 Google Inc.
31703
+ * SPDX-License-Identifier: Apache-2.0
31704
+ *)
31705
+
31706
+ puppeteer-core/lib/esm/puppeteer/common/Errors.js:
31707
+ (**
31708
+ * @license
31709
+ * Copyright 2018 Google Inc.
31710
+ * SPDX-License-Identifier: Apache-2.0
31711
+ *)
31712
+
31613
31713
  @jspm/core/nodelibs/browser/chunk-44e51b61.js:
31614
31714
  (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
31615
31715
 
@@ -31620,4 +31720,452 @@ ${sourceUrlComment}
31620
31720
  * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
31621
31721
  * @license MIT
31622
31722
  *)
31723
+
31724
+ puppeteer-core/lib/esm/puppeteer/common/util.js:
31725
+ (**
31726
+ * @license
31727
+ * Copyright 2017 Google Inc.
31728
+ * SPDX-License-Identifier: Apache-2.0
31729
+ *)
31730
+
31731
+ puppeteer-core/lib/esm/third_party/mitt/mitt.js:
31732
+ (**
31733
+ * @license
31734
+ * Copyright 2022 Google Inc.
31735
+ * SPDX-License-Identifier: Apache-2.0
31736
+ *)
31737
+
31738
+ puppeteer-core/lib/esm/puppeteer/util/disposable.js:
31739
+ (**
31740
+ * @license
31741
+ * Copyright 2023 Google Inc.
31742
+ * SPDX-License-Identifier: Apache-2.0
31743
+ *)
31744
+
31745
+ puppeteer-core/lib/esm/puppeteer/common/EventEmitter.js:
31746
+ (**
31747
+ * @license
31748
+ * Copyright 2022 Google Inc.
31749
+ * SPDX-License-Identifier: Apache-2.0
31750
+ *)
31751
+
31752
+ puppeteer-core/lib/esm/puppeteer/util/decorators.js:
31753
+ (**
31754
+ * @license
31755
+ * Copyright 2023 Google Inc.
31756
+ * SPDX-License-Identifier: Apache-2.0
31757
+ *)
31758
+
31759
+ puppeteer-core/lib/esm/puppeteer/node/ScreenRecorder.js:
31760
+ (**
31761
+ * @license
31762
+ * Copyright 2023 Google Inc.
31763
+ * SPDX-License-Identifier: Apache-2.0
31764
+ *)
31765
+
31766
+ puppeteer-core/lib/esm/puppeteer/api/Browser.js:
31767
+ (**
31768
+ * @license
31769
+ * Copyright 2017 Google Inc.
31770
+ * SPDX-License-Identifier: Apache-2.0
31771
+ *)
31772
+
31773
+ puppeteer-core/lib/esm/puppeteer/api/BrowserContext.js:
31774
+ (**
31775
+ * @license
31776
+ * Copyright 2017 Google Inc.
31777
+ * SPDX-License-Identifier: Apache-2.0
31778
+ *)
31779
+
31780
+ puppeteer-core/lib/esm/puppeteer/api/Target.js:
31781
+ (**
31782
+ * @license
31783
+ * Copyright 2023 Google Inc.
31784
+ * SPDX-License-Identifier: Apache-2.0
31785
+ *)
31786
+
31787
+ puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:
31788
+ (**
31789
+ * @license
31790
+ * Copyright 2023 Google Inc.
31791
+ * SPDX-License-Identifier: Apache-2.0
31792
+ *)
31793
+
31794
+ puppeteer-core/lib/esm/puppeteer/cdp/CDPSession.js:
31795
+ (**
31796
+ * @license
31797
+ * Copyright 2017 Google Inc.
31798
+ * SPDX-License-Identifier: Apache-2.0
31799
+ *)
31800
+
31801
+ puppeteer-core/lib/esm/puppeteer/common/NetworkManagerEvents.js:
31802
+ (**
31803
+ * @license
31804
+ * Copyright 2022 Google Inc.
31805
+ * SPDX-License-Identifier: Apache-2.0
31806
+ *)
31807
+
31808
+ puppeteer-core/lib/esm/puppeteer/common/PDFOptions.js:
31809
+ (**
31810
+ * @license
31811
+ * Copyright 2020 Google Inc.
31812
+ * SPDX-License-Identifier: Apache-2.0
31813
+ *)
31814
+
31815
+ puppeteer-core/lib/esm/puppeteer/common/TimeoutSettings.js:
31816
+ (**
31817
+ * @license
31818
+ * Copyright 2019 Google Inc.
31819
+ * SPDX-License-Identifier: Apache-2.0
31820
+ *)
31821
+
31822
+ puppeteer-core/lib/esm/puppeteer/api/Page.js:
31823
+ (**
31824
+ * @license
31825
+ * Copyright 2017 Google Inc.
31826
+ * SPDX-License-Identifier: Apache-2.0
31827
+ *)
31828
+
31829
+ puppeteer-core/lib/esm/puppeteer/common/ConsoleMessage.js:
31830
+ (**
31831
+ * @license
31832
+ * Copyright 2020 Google Inc.
31833
+ * SPDX-License-Identifier: Apache-2.0
31834
+ *)
31835
+
31836
+ puppeteer-core/lib/esm/puppeteer/common/FileChooser.js:
31837
+ (**
31838
+ * @license
31839
+ * Copyright 2020 Google Inc.
31840
+ * SPDX-License-Identifier: Apache-2.0
31841
+ *)
31842
+
31843
+ puppeteer-core/lib/esm/puppeteer/cdp/Accessibility.js:
31844
+ (**
31845
+ * @license
31846
+ * Copyright 2018 Google Inc.
31847
+ * SPDX-License-Identifier: Apache-2.0
31848
+ *)
31849
+
31850
+ puppeteer-core/lib/esm/puppeteer/api/JSHandle.js:
31851
+ (**
31852
+ * @license
31853
+ * Copyright 2023 Google Inc.
31854
+ * SPDX-License-Identifier: Apache-2.0
31855
+ *)
31856
+
31857
+ puppeteer-core/lib/esm/puppeteer/cdp/Connection.js:
31858
+ (**
31859
+ * @license
31860
+ * Copyright 2017 Google Inc.
31861
+ * SPDX-License-Identifier: Apache-2.0
31862
+ *)
31863
+
31864
+ puppeteer-core/lib/esm/puppeteer/cdp/Coverage.js:
31865
+ (**
31866
+ * @license
31867
+ * Copyright 2017 Google Inc.
31868
+ * SPDX-License-Identifier: Apache-2.0
31869
+ *)
31870
+
31871
+ puppeteer-core/lib/esm/puppeteer/api/Dialog.js:
31872
+ (**
31873
+ * @license
31874
+ * Copyright 2017 Google Inc.
31875
+ * SPDX-License-Identifier: Apache-2.0
31876
+ *)
31877
+
31878
+ puppeteer-core/lib/esm/puppeteer/cdp/Dialog.js:
31879
+ (**
31880
+ * @license
31881
+ * Copyright 2017 Google Inc.
31882
+ * SPDX-License-Identifier: Apache-2.0
31883
+ *)
31884
+
31885
+ puppeteer-core/lib/esm/puppeteer/common/LazyArg.js:
31886
+ (**
31887
+ * @license
31888
+ * Copyright 2022 Google Inc.
31889
+ * SPDX-License-Identifier: Apache-2.0
31890
+ *)
31891
+
31892
+ puppeteer-core/lib/esm/puppeteer/util/Function.js:
31893
+ (**
31894
+ * @license
31895
+ * Copyright 2023 Google Inc.
31896
+ * SPDX-License-Identifier: Apache-2.0
31897
+ *)
31898
+
31899
+ puppeteer-core/lib/esm/puppeteer/api/ElementHandleSymbol.js:
31900
+ (**
31901
+ * @license
31902
+ * Copyright 2023 Google Inc.
31903
+ * SPDX-License-Identifier: Apache-2.0
31904
+ *)
31905
+
31906
+ puppeteer-core/lib/esm/puppeteer/common/HandleIterator.js:
31907
+ (**
31908
+ * @license
31909
+ * Copyright 2023 Google Inc.
31910
+ * SPDX-License-Identifier: Apache-2.0
31911
+ *)
31912
+
31913
+ puppeteer-core/lib/esm/puppeteer/common/QueryHandler.js:
31914
+ (**
31915
+ * @license
31916
+ * Copyright 2023 Google Inc.
31917
+ * SPDX-License-Identifier: Apache-2.0
31918
+ *)
31919
+
31920
+ puppeteer-core/lib/esm/puppeteer/cdp/AriaQueryHandler.js:
31921
+ (**
31922
+ * @license
31923
+ * Copyright 2020 Google Inc.
31924
+ * SPDX-License-Identifier: Apache-2.0
31925
+ *)
31926
+
31927
+ puppeteer-core/lib/esm/puppeteer/common/CustomQueryHandler.js:
31928
+ (**
31929
+ * @license
31930
+ * Copyright 2023 Google Inc.
31931
+ * SPDX-License-Identifier: Apache-2.0
31932
+ *)
31933
+
31934
+ puppeteer-core/lib/esm/puppeteer/common/PierceQueryHandler.js:
31935
+ (**
31936
+ * @license
31937
+ * Copyright 2023 Google Inc.
31938
+ * SPDX-License-Identifier: Apache-2.0
31939
+ *)
31940
+
31941
+ puppeteer-core/lib/esm/puppeteer/common/PQueryHandler.js:
31942
+ (**
31943
+ * @license
31944
+ * Copyright 2023 Google Inc.
31945
+ * SPDX-License-Identifier: Apache-2.0
31946
+ *)
31947
+
31948
+ puppeteer-core/lib/esm/puppeteer/common/TextQueryHandler.js:
31949
+ (**
31950
+ * @license
31951
+ * Copyright 2023 Google Inc.
31952
+ * SPDX-License-Identifier: Apache-2.0
31953
+ *)
31954
+
31955
+ puppeteer-core/lib/esm/puppeteer/common/XPathQueryHandler.js:
31956
+ (**
31957
+ * @license
31958
+ * Copyright 2023 Google Inc.
31959
+ * SPDX-License-Identifier: Apache-2.0
31960
+ *)
31961
+
31962
+ puppeteer-core/lib/esm/puppeteer/common/GetQueryHandler.js:
31963
+ (**
31964
+ * @license
31965
+ * Copyright 2023 Google Inc.
31966
+ * SPDX-License-Identifier: Apache-2.0
31967
+ *)
31968
+
31969
+ puppeteer-core/lib/esm/puppeteer/api/ElementHandle.js:
31970
+ (**
31971
+ * @license
31972
+ * Copyright 2023 Google Inc.
31973
+ * SPDX-License-Identifier: Apache-2.0
31974
+ *)
31975
+
31976
+ puppeteer-core/lib/esm/puppeteer/cdp/JSHandle.js:
31977
+ (**
31978
+ * @license
31979
+ * Copyright 2019 Google Inc.
31980
+ * SPDX-License-Identifier: Apache-2.0
31981
+ *)
31982
+
31983
+ puppeteer-core/lib/esm/puppeteer/cdp/ElementHandle.js:
31984
+ (**
31985
+ * @license
31986
+ * Copyright 2019 Google Inc.
31987
+ * SPDX-License-Identifier: Apache-2.0
31988
+ *)
31989
+
31990
+ puppeteer-core/lib/esm/puppeteer/cdp/ExecutionContext.js:
31991
+ (**
31992
+ * @license
31993
+ * Copyright 2017 Google Inc.
31994
+ * SPDX-License-Identifier: Apache-2.0
31995
+ *)
31996
+
31997
+ puppeteer-core/lib/esm/puppeteer/cdp/FirefoxTargetManager.js:
31998
+ (**
31999
+ * @license
32000
+ * Copyright 2022 Google Inc.
32001
+ * SPDX-License-Identifier: Apache-2.0
32002
+ *)
32003
+
32004
+ puppeteer-core/lib/esm/puppeteer/api/Frame.js:
32005
+ (**
32006
+ * @license
32007
+ * Copyright 2023 Google Inc.
32008
+ * SPDX-License-Identifier: Apache-2.0
32009
+ *)
32010
+
32011
+ puppeteer-core/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js:
32012
+ (**
32013
+ * @license
32014
+ * Copyright 2022 Google Inc.
32015
+ * SPDX-License-Identifier: Apache-2.0
32016
+ *)
32017
+
32018
+ puppeteer-core/lib/esm/puppeteer/common/WaitTask.js:
32019
+ (**
32020
+ * @license
32021
+ * Copyright 2022 Google Inc.
32022
+ * SPDX-License-Identifier: Apache-2.0
32023
+ *)
32024
+
32025
+ puppeteer-core/lib/esm/puppeteer/api/Realm.js:
32026
+ (**
32027
+ * @license
32028
+ * Copyright 2023 Google Inc.
32029
+ * SPDX-License-Identifier: Apache-2.0
32030
+ *)
32031
+
32032
+ puppeteer-core/lib/esm/puppeteer/cdp/IsolatedWorld.js:
32033
+ (**
32034
+ * @license
32035
+ * Copyright 2019 Google Inc.
32036
+ * SPDX-License-Identifier: Apache-2.0
32037
+ *)
32038
+
32039
+ puppeteer-core/lib/esm/puppeteer/cdp/IsolatedWorlds.js:
32040
+ (**
32041
+ * @license
32042
+ * Copyright 2022 Google Inc.
32043
+ * SPDX-License-Identifier: Apache-2.0
32044
+ *)
32045
+
32046
+ puppeteer-core/lib/esm/puppeteer/cdp/FrameManagerEvents.js:
32047
+ (**
32048
+ * @license
32049
+ * Copyright 2023 Google Inc.
32050
+ * SPDX-License-Identifier: Apache-2.0
32051
+ *)
32052
+
32053
+ puppeteer-core/lib/esm/puppeteer/cdp/LifecycleWatcher.js:
32054
+ (**
32055
+ * @license
32056
+ * Copyright 2019 Google Inc.
32057
+ * SPDX-License-Identifier: Apache-2.0
32058
+ *)
32059
+
32060
+ puppeteer-core/lib/esm/puppeteer/cdp/Frame.js:
32061
+ (**
32062
+ * @license
32063
+ * Copyright 2017 Google Inc.
32064
+ * SPDX-License-Identifier: Apache-2.0
32065
+ *)
32066
+
32067
+ puppeteer-core/lib/esm/puppeteer/cdp/FrameTree.js:
32068
+ (**
32069
+ * @license
32070
+ * Copyright 2022 Google Inc.
32071
+ * SPDX-License-Identifier: Apache-2.0
32072
+ *)
32073
+
32074
+ puppeteer-core/lib/esm/puppeteer/api/HTTPResponse.js:
32075
+ (**
32076
+ * @license
32077
+ * Copyright 2023 Google Inc.
32078
+ * SPDX-License-Identifier: Apache-2.0
32079
+ *)
32080
+
32081
+ puppeteer-core/lib/esm/puppeteer/common/SecurityDetails.js:
32082
+ (**
32083
+ * @license
32084
+ * Copyright 2020 Google Inc.
32085
+ * SPDX-License-Identifier: Apache-2.0
32086
+ *)
32087
+
32088
+ puppeteer-core/lib/esm/puppeteer/cdp/NetworkEventManager.js:
32089
+ (**
32090
+ * @license
32091
+ * Copyright 2022 Google Inc.
32092
+ * SPDX-License-Identifier: Apache-2.0
32093
+ *)
32094
+
32095
+ puppeteer-core/lib/esm/puppeteer/cdp/NetworkManager.js:
32096
+ (**
32097
+ * @license
32098
+ * Copyright 2017 Google Inc.
32099
+ * SPDX-License-Identifier: Apache-2.0
32100
+ *)
32101
+
32102
+ puppeteer-core/lib/esm/puppeteer/cdp/FrameManager.js:
32103
+ (**
32104
+ * @license
32105
+ * Copyright 2017 Google Inc.
32106
+ * SPDX-License-Identifier: Apache-2.0
32107
+ *)
32108
+
32109
+ puppeteer-core/lib/esm/puppeteer/api/Input.js:
32110
+ (**
32111
+ * @license
32112
+ * Copyright 2017 Google Inc.
32113
+ * SPDX-License-Identifier: Apache-2.0
32114
+ *)
32115
+
32116
+ puppeteer-core/lib/esm/puppeteer/common/USKeyboardLayout.js:
32117
+ (**
32118
+ * @license
32119
+ * Copyright 2017 Google Inc.
32120
+ * SPDX-License-Identifier: Apache-2.0
32121
+ *)
32122
+
32123
+ puppeteer-core/lib/esm/puppeteer/cdp/Input.js:
32124
+ (**
32125
+ * @license
32126
+ * Copyright 2017 Google Inc.
32127
+ * SPDX-License-Identifier: Apache-2.0
32128
+ *)
32129
+
32130
+ puppeteer-core/lib/esm/puppeteer/api/WebWorker.js:
32131
+ (**
32132
+ * @license
32133
+ * Copyright 2018 Google Inc.
32134
+ * SPDX-License-Identifier: Apache-2.0
32135
+ *)
32136
+
32137
+ puppeteer-core/lib/esm/puppeteer/cdp/Page.js:
32138
+ (**
32139
+ * @license
32140
+ * Copyright 2017 Google Inc.
32141
+ * SPDX-License-Identifier: Apache-2.0
32142
+ *)
32143
+
32144
+ puppeteer-core/lib/esm/puppeteer/cdp/Target.js:
32145
+ (**
32146
+ * @license
32147
+ * Copyright 2019 Google Inc.
32148
+ * SPDX-License-Identifier: Apache-2.0
32149
+ *)
32150
+
32151
+ puppeteer-core/lib/esm/puppeteer/cdp/ChromeTargetManager.js:
32152
+ (**
32153
+ * @license
32154
+ * Copyright 2022 Google Inc.
32155
+ * SPDX-License-Identifier: Apache-2.0
32156
+ *)
32157
+
32158
+ puppeteer-core/lib/esm/puppeteer/cdp/Browser.js:
32159
+ (**
32160
+ * @license
32161
+ * Copyright 2017 Google Inc.
32162
+ * SPDX-License-Identifier: Apache-2.0
32163
+ *)
32164
+
32165
+ puppeteer-core/lib/esm/puppeteer/cdp/BrowserConnector.js:
32166
+ (**
32167
+ * @license
32168
+ * Copyright 2020 Google Inc.
32169
+ * SPDX-License-Identifier: Apache-2.0
32170
+ *)
31623
32171
  */