isomorfeus-puppetmaster 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (932) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isomorfeus/puppetmaster/driver/puppeteer.rb +21 -18
  3. data/lib/isomorfeus/puppetmaster/driver_registration.rb +4 -4
  4. data/lib/isomorfeus/puppetmaster/server_registration.rb +0 -52
  5. data/lib/isomorfeus/puppetmaster/version.rb +1 -1
  6. data/lib/isomorfeus/puppetmaster.rb +6 -3
  7. data/lib/isomorfeus-puppetmaster.rb +2 -1
  8. data/node_modules/.bin/extract-zip +12 -0
  9. data/node_modules/.bin/extract-zip.cmd +17 -0
  10. data/node_modules/.bin/extract-zip.ps1 +28 -0
  11. data/node_modules/.bin/mkdirp +12 -0
  12. data/node_modules/.bin/mkdirp.cmd +17 -0
  13. data/node_modules/.bin/mkdirp.ps1 +28 -0
  14. data/node_modules/.bin/rimraf +12 -0
  15. data/node_modules/.bin/rimraf.cmd +17 -0
  16. data/node_modules/.bin/rimraf.ps1 +28 -0
  17. data/node_modules/.package-lock.json +574 -0
  18. data/node_modules/@types/node/LICENSE +21 -0
  19. data/node_modules/@types/node/README.md +16 -0
  20. data/node_modules/@types/node/assert/strict.d.ts +8 -0
  21. data/node_modules/@types/node/assert.d.ts +912 -0
  22. data/node_modules/@types/node/async_hooks.d.ts +497 -0
  23. data/node_modules/@types/node/buffer.d.ts +2142 -0
  24. data/node_modules/@types/node/child_process.d.ts +1355 -0
  25. data/node_modules/@types/node/cluster.d.ts +414 -0
  26. data/node_modules/@types/node/console.d.ts +407 -0
  27. data/node_modules/@types/node/constants.d.ts +18 -0
  28. data/node_modules/@types/node/crypto.d.ts +3224 -0
  29. data/node_modules/@types/node/dgram.d.ts +545 -0
  30. data/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
  31. data/node_modules/@types/node/dns/promises.d.ts +357 -0
  32. data/node_modules/@types/node/dns.d.ts +643 -0
  33. data/node_modules/@types/node/domain.d.ts +169 -0
  34. data/node_modules/@types/node/events.d.ts +623 -0
  35. data/node_modules/@types/node/fs/promises.d.ts +997 -0
  36. data/node_modules/@types/node/fs.d.ts +3723 -0
  37. data/node_modules/@types/node/globals.d.ts +285 -0
  38. data/node_modules/@types/node/globals.global.d.ts +1 -0
  39. data/node_modules/@types/node/http.d.ts +1358 -0
  40. data/node_modules/@types/node/http2.d.ts +2100 -0
  41. data/node_modules/@types/node/https.d.ts +391 -0
  42. data/node_modules/@types/node/index.d.ts +131 -0
  43. data/node_modules/@types/node/inspector.d.ts +2738 -0
  44. data/node_modules/@types/node/module.d.ts +114 -0
  45. data/node_modules/@types/node/net.d.ts +783 -0
  46. data/node_modules/@types/node/os.d.ts +455 -0
  47. data/node_modules/@types/node/package.json +230 -0
  48. data/node_modules/@types/node/path.d.ts +172 -0
  49. data/node_modules/@types/node/perf_hooks.d.ts +555 -0
  50. data/node_modules/@types/node/process.d.ts +1477 -0
  51. data/node_modules/@types/node/punycode.d.ts +117 -0
  52. data/node_modules/@types/node/querystring.d.ts +131 -0
  53. data/node_modules/@types/node/readline.d.ts +542 -0
  54. data/node_modules/@types/node/repl.d.ts +424 -0
  55. data/node_modules/@types/node/stream/consumers.d.ts +24 -0
  56. data/node_modules/@types/node/stream/promises.d.ts +42 -0
  57. data/node_modules/@types/node/stream/web.d.ts +6 -0
  58. data/node_modules/@types/node/stream.d.ts +1181 -0
  59. data/node_modules/@types/node/string_decoder.d.ts +67 -0
  60. data/node_modules/@types/node/timers/promises.d.ts +68 -0
  61. data/node_modules/@types/node/timers.d.ts +94 -0
  62. data/node_modules/@types/node/tls.d.ts +1019 -0
  63. data/node_modules/@types/node/trace_events.d.ts +161 -0
  64. data/node_modules/@types/node/tty.d.ts +206 -0
  65. data/node_modules/@types/node/url.d.ts +798 -0
  66. data/node_modules/@types/node/util.d.ts +1556 -0
  67. data/node_modules/@types/node/v8.d.ts +378 -0
  68. data/node_modules/@types/node/vm.d.ts +504 -0
  69. data/node_modules/@types/node/wasi.d.ts +153 -0
  70. data/node_modules/@types/node/worker_threads.d.ts +649 -0
  71. data/node_modules/@types/node/zlib.d.ts +517 -0
  72. data/node_modules/@types/yauzl/LICENSE +21 -0
  73. data/node_modules/@types/yauzl/README.md +16 -0
  74. data/node_modules/@types/yauzl/index.d.ts +98 -0
  75. data/node_modules/@types/yauzl/package.json +27 -0
  76. data/node_modules/agent-base/README.md +145 -0
  77. data/node_modules/agent-base/dist/src/index.d.ts +78 -0
  78. data/node_modules/agent-base/dist/src/index.js +203 -0
  79. data/node_modules/agent-base/dist/src/index.js.map +1 -0
  80. data/node_modules/agent-base/dist/src/promisify.d.ts +4 -0
  81. data/node_modules/agent-base/dist/src/promisify.js +18 -0
  82. data/node_modules/agent-base/dist/src/promisify.js.map +1 -0
  83. data/node_modules/agent-base/package.json +64 -0
  84. data/node_modules/agent-base/src/index.ts +345 -0
  85. data/node_modules/agent-base/src/promisify.ts +33 -0
  86. data/node_modules/balanced-match/.github/FUNDING.yml +2 -0
  87. data/node_modules/balanced-match/LICENSE.md +21 -0
  88. data/node_modules/balanced-match/README.md +97 -0
  89. data/node_modules/balanced-match/index.js +62 -0
  90. data/node_modules/balanced-match/package.json +48 -0
  91. data/node_modules/base64-js/LICENSE +21 -0
  92. data/node_modules/base64-js/README.md +34 -0
  93. data/node_modules/base64-js/base64js.min.js +1 -0
  94. data/node_modules/base64-js/index.d.ts +3 -0
  95. data/node_modules/base64-js/index.js +150 -0
  96. data/node_modules/base64-js/package.json +47 -0
  97. data/node_modules/bl/.travis.yml +17 -0
  98. data/node_modules/bl/BufferList.js +396 -0
  99. data/node_modules/bl/LICENSE.md +13 -0
  100. data/node_modules/bl/README.md +247 -0
  101. data/node_modules/bl/bl.js +84 -0
  102. data/node_modules/bl/package.json +37 -0
  103. data/node_modules/bl/test/convert.js +21 -0
  104. data/node_modules/bl/test/indexOf.js +492 -0
  105. data/node_modules/bl/test/isBufferList.js +32 -0
  106. data/node_modules/bl/test/test.js +869 -0
  107. data/node_modules/brace-expansion/LICENSE +21 -0
  108. data/node_modules/brace-expansion/README.md +129 -0
  109. data/node_modules/brace-expansion/index.js +201 -0
  110. data/node_modules/brace-expansion/package.json +47 -0
  111. data/node_modules/buffer/AUTHORS.md +70 -0
  112. data/node_modules/buffer/LICENSE +21 -0
  113. data/node_modules/buffer/README.md +410 -0
  114. data/node_modules/buffer/index.d.ts +186 -0
  115. data/node_modules/buffer/index.js +1817 -0
  116. data/node_modules/buffer/package.json +96 -0
  117. data/node_modules/buffer-crc32/LICENSE +19 -0
  118. data/node_modules/buffer-crc32/README.md +47 -0
  119. data/node_modules/buffer-crc32/index.js +111 -0
  120. data/node_modules/buffer-crc32/package.json +39 -0
  121. data/node_modules/chownr/LICENSE +15 -0
  122. data/node_modules/chownr/README.md +3 -0
  123. data/node_modules/chownr/chownr.js +167 -0
  124. data/node_modules/chownr/package.json +29 -0
  125. data/node_modules/concat-map/.travis.yml +4 -0
  126. data/node_modules/concat-map/LICENSE +18 -0
  127. data/node_modules/concat-map/README.markdown +62 -0
  128. data/node_modules/concat-map/example/map.js +6 -0
  129. data/node_modules/concat-map/index.js +13 -0
  130. data/node_modules/concat-map/package.json +43 -0
  131. data/node_modules/concat-map/test/map.js +39 -0
  132. data/node_modules/debug/LICENSE +19 -0
  133. data/node_modules/debug/README.md +455 -0
  134. data/node_modules/debug/package.json +59 -0
  135. data/node_modules/debug/src/browser.js +269 -0
  136. data/node_modules/debug/src/common.js +261 -0
  137. data/node_modules/debug/src/index.js +10 -0
  138. data/node_modules/debug/src/node.js +263 -0
  139. data/node_modules/devtools-protocol/LICENSE +27 -0
  140. data/node_modules/devtools-protocol/README.md +12 -0
  141. data/node_modules/devtools-protocol/changelog.md +10491 -0
  142. data/node_modules/devtools-protocol/externs/protocol_externs.js +9734 -0
  143. data/node_modules/devtools-protocol/json/browser_protocol.json +20641 -0
  144. data/node_modules/devtools-protocol/json/js_protocol.json +3581 -0
  145. data/node_modules/devtools-protocol/package.json +18 -0
  146. data/node_modules/devtools-protocol/pdl/browser_protocol.pdl +9637 -0
  147. data/node_modules/devtools-protocol/pdl/js_protocol.pdl +1678 -0
  148. data/node_modules/devtools-protocol/types/protocol-mapping.d.ts +4321 -0
  149. data/node_modules/devtools-protocol/types/protocol-proxy-api.d.ts +3683 -0
  150. data/node_modules/devtools-protocol/types/protocol.d.ts +15538 -0
  151. data/node_modules/end-of-stream/LICENSE +21 -0
  152. data/node_modules/end-of-stream/README.md +54 -0
  153. data/node_modules/end-of-stream/index.js +94 -0
  154. data/node_modules/end-of-stream/package.json +37 -0
  155. data/node_modules/extract-zip/LICENSE +23 -0
  156. data/node_modules/extract-zip/cli.js +19 -0
  157. data/node_modules/extract-zip/index.d.ts +21 -0
  158. data/node_modules/extract-zip/index.js +173 -0
  159. data/node_modules/extract-zip/package.json +80 -0
  160. data/node_modules/extract-zip/readme.md +57 -0
  161. data/node_modules/fd-slicer/.npmignore +2 -0
  162. data/node_modules/fd-slicer/.travis.yml +7 -0
  163. data/node_modules/fd-slicer/CHANGELOG.md +49 -0
  164. data/node_modules/fd-slicer/LICENSE +21 -0
  165. data/node_modules/fd-slicer/README.md +199 -0
  166. data/node_modules/fd-slicer/index.js +296 -0
  167. data/node_modules/fd-slicer/package.json +36 -0
  168. data/node_modules/fd-slicer/test/test.js +350 -0
  169. data/node_modules/find-up/index.d.ts +137 -0
  170. data/node_modules/find-up/index.js +89 -0
  171. data/node_modules/find-up/license +9 -0
  172. data/node_modules/find-up/package.json +53 -0
  173. data/node_modules/find-up/readme.md +156 -0
  174. data/node_modules/fs-constants/LICENSE +21 -0
  175. data/node_modules/fs-constants/README.md +26 -0
  176. data/node_modules/fs-constants/browser.js +1 -0
  177. data/node_modules/fs-constants/index.js +1 -0
  178. data/node_modules/fs-constants/package.json +19 -0
  179. data/node_modules/fs.realpath/LICENSE +43 -0
  180. data/node_modules/fs.realpath/README.md +33 -0
  181. data/node_modules/fs.realpath/index.js +66 -0
  182. data/node_modules/fs.realpath/old.js +303 -0
  183. data/node_modules/fs.realpath/package.json +26 -0
  184. data/node_modules/get-stream/buffer-stream.js +52 -0
  185. data/node_modules/get-stream/index.d.ts +108 -0
  186. data/node_modules/get-stream/index.js +60 -0
  187. data/node_modules/get-stream/license +9 -0
  188. data/node_modules/get-stream/package.json +50 -0
  189. data/node_modules/get-stream/readme.md +124 -0
  190. data/node_modules/glob/LICENSE +21 -0
  191. data/node_modules/glob/README.md +375 -0
  192. data/node_modules/glob/changelog.md +67 -0
  193. data/node_modules/glob/common.js +234 -0
  194. data/node_modules/glob/glob.js +788 -0
  195. data/node_modules/glob/package.json +51 -0
  196. data/node_modules/glob/sync.js +484 -0
  197. data/node_modules/https-proxy-agent/README.md +137 -0
  198. data/node_modules/https-proxy-agent/dist/agent.d.ts +30 -0
  199. data/node_modules/https-proxy-agent/dist/agent.js +180 -0
  200. data/node_modules/https-proxy-agent/dist/agent.js.map +1 -0
  201. data/node_modules/https-proxy-agent/dist/index.d.ts +23 -0
  202. data/node_modules/https-proxy-agent/dist/index.js +14 -0
  203. data/node_modules/https-proxy-agent/dist/index.js.map +1 -0
  204. data/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +7 -0
  205. data/node_modules/https-proxy-agent/dist/parse-proxy-response.js +66 -0
  206. data/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
  207. data/node_modules/https-proxy-agent/package.json +56 -0
  208. data/node_modules/ieee754/LICENSE +11 -0
  209. data/node_modules/ieee754/README.md +51 -0
  210. data/node_modules/ieee754/index.d.ts +10 -0
  211. data/node_modules/ieee754/index.js +85 -0
  212. data/node_modules/ieee754/package.json +52 -0
  213. data/node_modules/inflight/LICENSE +15 -0
  214. data/node_modules/inflight/README.md +37 -0
  215. data/node_modules/inflight/inflight.js +54 -0
  216. data/node_modules/inflight/package.json +29 -0
  217. data/node_modules/inherits/LICENSE +16 -0
  218. data/node_modules/inherits/README.md +42 -0
  219. data/node_modules/inherits/inherits.js +9 -0
  220. data/node_modules/inherits/inherits_browser.js +27 -0
  221. data/node_modules/inherits/package.json +29 -0
  222. data/node_modules/locate-path/index.d.ts +83 -0
  223. data/node_modules/locate-path/index.js +65 -0
  224. data/node_modules/locate-path/license +9 -0
  225. data/node_modules/locate-path/package.json +45 -0
  226. data/node_modules/locate-path/readme.md +122 -0
  227. data/node_modules/minimatch/LICENSE +15 -0
  228. data/node_modules/minimatch/README.md +209 -0
  229. data/node_modules/minimatch/minimatch.js +923 -0
  230. data/node_modules/minimatch/package.json +30 -0
  231. data/node_modules/minimist/.travis.yml +8 -0
  232. data/node_modules/minimist/LICENSE +18 -0
  233. data/node_modules/minimist/example/parse.js +2 -0
  234. data/node_modules/minimist/index.js +245 -0
  235. data/node_modules/minimist/package.json +45 -0
  236. data/node_modules/minimist/readme.markdown +95 -0
  237. data/node_modules/minimist/test/all_bool.js +32 -0
  238. data/node_modules/minimist/test/bool.js +178 -0
  239. data/node_modules/minimist/test/dash.js +31 -0
  240. data/node_modules/minimist/test/default_bool.js +35 -0
  241. data/node_modules/minimist/test/dotted.js +22 -0
  242. data/node_modules/minimist/test/kv_short.js +16 -0
  243. data/node_modules/minimist/test/long.js +31 -0
  244. data/node_modules/minimist/test/num.js +36 -0
  245. data/node_modules/minimist/test/parse.js +197 -0
  246. data/node_modules/minimist/test/parse_modified.js +9 -0
  247. data/node_modules/minimist/test/proto.js +44 -0
  248. data/node_modules/minimist/test/short.js +67 -0
  249. data/node_modules/minimist/test/stop_early.js +15 -0
  250. data/node_modules/minimist/test/unknown.js +102 -0
  251. data/node_modules/minimist/test/whitespace.js +8 -0
  252. data/node_modules/mkdirp/LICENSE +21 -0
  253. data/node_modules/mkdirp/bin/cmd.js +33 -0
  254. data/node_modules/mkdirp/bin/usage.txt +12 -0
  255. data/node_modules/mkdirp/index.js +99 -0
  256. data/node_modules/mkdirp/package.json +34 -0
  257. data/node_modules/mkdirp/readme.markdown +100 -0
  258. data/node_modules/ms/index.js +162 -0
  259. data/node_modules/ms/license.md +21 -0
  260. data/node_modules/ms/package.json +37 -0
  261. data/node_modules/ms/readme.md +60 -0
  262. data/node_modules/node-fetch/CHANGELOG.md +272 -0
  263. data/node_modules/node-fetch/LICENSE.md +22 -0
  264. data/node_modules/node-fetch/README.md +590 -0
  265. data/node_modules/node-fetch/browser.js +25 -0
  266. data/node_modules/node-fetch/lib/index.es.js +1640 -0
  267. data/node_modules/node-fetch/lib/index.js +1649 -0
  268. data/node_modules/node-fetch/lib/index.mjs +1638 -0
  269. data/node_modules/node-fetch/package.json +66 -0
  270. data/node_modules/once/LICENSE +15 -0
  271. data/node_modules/once/README.md +79 -0
  272. data/node_modules/once/once.js +42 -0
  273. data/node_modules/once/package.json +33 -0
  274. data/node_modules/p-limit/index.d.ts +38 -0
  275. data/node_modules/p-limit/index.js +57 -0
  276. data/node_modules/p-limit/license +9 -0
  277. data/node_modules/p-limit/package.json +52 -0
  278. data/node_modules/p-limit/readme.md +101 -0
  279. data/node_modules/p-locate/index.d.ts +64 -0
  280. data/node_modules/p-locate/index.js +52 -0
  281. data/node_modules/p-locate/license +9 -0
  282. data/node_modules/p-locate/package.json +53 -0
  283. data/node_modules/p-locate/readme.md +90 -0
  284. data/node_modules/p-try/index.d.ts +39 -0
  285. data/node_modules/p-try/index.js +9 -0
  286. data/node_modules/p-try/license +9 -0
  287. data/node_modules/p-try/package.json +42 -0
  288. data/node_modules/p-try/readme.md +58 -0
  289. data/node_modules/path-exists/index.d.ts +28 -0
  290. data/node_modules/path-exists/index.js +23 -0
  291. data/node_modules/path-exists/license +9 -0
  292. data/node_modules/path-exists/package.json +39 -0
  293. data/node_modules/path-exists/readme.md +52 -0
  294. data/node_modules/path-is-absolute/index.js +20 -0
  295. data/node_modules/path-is-absolute/license +21 -0
  296. data/node_modules/path-is-absolute/package.json +43 -0
  297. data/node_modules/path-is-absolute/readme.md +59 -0
  298. data/node_modules/pend/LICENSE +23 -0
  299. data/node_modules/pend/README.md +41 -0
  300. data/node_modules/pend/index.js +55 -0
  301. data/node_modules/pend/package.json +18 -0
  302. data/node_modules/pend/test.js +137 -0
  303. data/node_modules/pkg-dir/index.d.ts +44 -0
  304. data/node_modules/pkg-dir/index.js +17 -0
  305. data/node_modules/pkg-dir/license +9 -0
  306. data/node_modules/pkg-dir/package.json +56 -0
  307. data/node_modules/pkg-dir/readme.md +66 -0
  308. data/node_modules/progress/CHANGELOG.md +115 -0
  309. data/node_modules/progress/LICENSE +22 -0
  310. data/node_modules/progress/Makefile +8 -0
  311. data/node_modules/progress/Readme.md +146 -0
  312. data/node_modules/progress/index.js +1 -0
  313. data/node_modules/progress/lib/node-progress.js +235 -0
  314. data/node_modules/progress/package.json +26 -0
  315. data/node_modules/proxy-from-env/.eslintrc +29 -0
  316. data/node_modules/proxy-from-env/.travis.yml +10 -0
  317. data/node_modules/proxy-from-env/LICENSE +20 -0
  318. data/node_modules/proxy-from-env/README.md +131 -0
  319. data/node_modules/proxy-from-env/index.js +108 -0
  320. data/node_modules/proxy-from-env/package.json +34 -0
  321. data/node_modules/proxy-from-env/test.js +483 -0
  322. data/node_modules/pump/.travis.yml +5 -0
  323. data/node_modules/pump/LICENSE +21 -0
  324. data/node_modules/pump/README.md +65 -0
  325. data/node_modules/pump/index.js +82 -0
  326. data/node_modules/pump/package.json +24 -0
  327. data/node_modules/pump/test-browser.js +66 -0
  328. data/node_modules/pump/test-node.js +53 -0
  329. data/node_modules/puppeteer-core/CHANGELOG.md +226 -0
  330. data/node_modules/puppeteer-core/LICENSE +202 -0
  331. data/node_modules/puppeteer-core/README.md +483 -0
  332. data/node_modules/puppeteer-core/cjs-entry-core.js +29 -0
  333. data/node_modules/puppeteer-core/cjs-entry.js +29 -0
  334. data/node_modules/puppeteer-core/install.js +89 -0
  335. data/node_modules/puppeteer-core/lib/cjs/puppeteer/api-docs-entry.d.ts +111 -0
  336. data/node_modules/puppeteer-core/lib/cjs/puppeteer/api-docs-entry.d.ts.map +1 -0
  337. data/node_modules/puppeteer-core/lib/cjs/puppeteer/api-docs-entry.js +81 -0
  338. data/node_modules/puppeteer-core/lib/cjs/puppeteer/api-docs-entry.js.map +1 -0
  339. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Accessibility.d.ts +176 -0
  340. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Accessibility.d.ts.map +1 -0
  341. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Accessibility.js +361 -0
  342. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Accessibility.js.map +1 -0
  343. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/AriaQueryHandler.d.ts +21 -0
  344. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/AriaQueryHandler.d.ts.map +1 -0
  345. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/AriaQueryHandler.js +85 -0
  346. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -0
  347. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Browser.d.ts +438 -0
  348. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Browser.d.ts.map +1 -0
  349. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Browser.js +528 -0
  350. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Browser.js.map +1 -0
  351. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/BrowserConnector.d.ts +54 -0
  352. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/BrowserConnector.d.ts.map +1 -0
  353. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/BrowserConnector.js +98 -0
  354. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -0
  355. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/BrowserWebSocketTransport.d.ts +26 -0
  356. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/BrowserWebSocketTransport.d.ts.map +1 -0
  357. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/BrowserWebSocketTransport.js +35 -0
  358. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/BrowserWebSocketTransport.js.map +1 -0
  359. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.d.ts +130 -0
  360. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.d.ts.map +1 -0
  361. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js +281 -0
  362. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js.map +1 -0
  363. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ConnectionTransport.d.ts +25 -0
  364. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ConnectionTransport.d.ts.map +1 -0
  365. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ConnectionTransport.js +18 -0
  366. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ConnectionTransport.js.map +1 -0
  367. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +73 -0
  368. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -0
  369. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ConsoleMessage.js +65 -0
  370. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -0
  371. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Coverage.d.ts +189 -0
  372. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Coverage.d.ts.map +1 -0
  373. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Coverage.js +329 -0
  374. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Coverage.js.map +1 -0
  375. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.d.ts +173 -0
  376. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +1 -0
  377. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.js +655 -0
  378. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.js.map +1 -0
  379. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Debug.d.ts +53 -0
  380. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Debug.d.ts.map +1 -0
  381. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Debug.js +82 -0
  382. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Debug.js.map +1 -0
  383. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DeviceDescriptors.d.ts +41 -0
  384. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DeviceDescriptors.d.ts.map +1 -0
  385. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DeviceDescriptors.js +951 -0
  386. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DeviceDescriptors.js.map +1 -0
  387. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Dialog.d.ts +75 -0
  388. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Dialog.d.ts.map +1 -0
  389. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Dialog.js +98 -0
  390. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Dialog.js.map +1 -0
  391. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EmulationManager.d.ts +25 -0
  392. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EmulationManager.d.ts.map +1 -0
  393. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EmulationManager.js +38 -0
  394. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EmulationManager.js.map +1 -0
  395. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Errors.d.ts +42 -0
  396. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Errors.d.ts.map +1 -0
  397. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Errors.js +49 -0
  398. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Errors.js.map +1 -0
  399. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EvalTypes.d.ts +61 -0
  400. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EvalTypes.d.ts.map +1 -0
  401. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EvalTypes.js +18 -0
  402. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EvalTypes.js.map +1 -0
  403. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EventEmitter.d.ts +93 -0
  404. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EventEmitter.d.ts.map +1 -0
  405. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EventEmitter.js +117 -0
  406. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EventEmitter.js.map +1 -0
  407. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Events.d.ts +82 -0
  408. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Events.d.ts.map +1 -0
  409. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Events.js +87 -0
  410. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Events.js.map +1 -0
  411. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.d.ts +194 -0
  412. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.d.ts.map +1 -0
  413. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js +322 -0
  414. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js.map +1 -0
  415. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FileChooser.d.ts +59 -0
  416. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FileChooser.d.ts.map +1 -0
  417. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FileChooser.js +72 -0
  418. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FileChooser.js.map +1 -0
  419. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FrameManager.d.ts +733 -0
  420. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FrameManager.d.ts.map +1 -0
  421. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FrameManager.js +965 -0
  422. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FrameManager.js.map +1 -0
  423. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPRequest.d.ts +341 -0
  424. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPRequest.d.ts.map +1 -0
  425. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPRequest.js +547 -0
  426. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPRequest.js.map +1 -0
  427. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPResponse.d.ts +126 -0
  428. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPResponse.d.ts.map +1 -0
  429. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPResponse.js +155 -0
  430. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPResponse.js.map +1 -0
  431. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Input.d.ts +360 -0
  432. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Input.d.ts.map +1 -0
  433. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Input.js +545 -0
  434. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Input.js.map +1 -0
  435. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.d.ts +469 -0
  436. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -0
  437. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.js +803 -0
  438. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.js.map +1 -0
  439. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts +66 -0
  440. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts.map +1 -0
  441. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/LifecycleWatcher.js +149 -0
  442. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/LifecycleWatcher.js.map +1 -0
  443. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkConditions.d.ts +27 -0
  444. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkConditions.d.ts.map +1 -0
  445. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkConditions.js +34 -0
  446. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkConditions.js.map +1 -0
  447. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.d.ts +97 -0
  448. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.d.ts.map +1 -0
  449. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.js +341 -0
  450. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.js.map +1 -0
  451. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PDFOptions.d.ts +157 -0
  452. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PDFOptions.d.ts.map +1 -0
  453. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PDFOptions.js +35 -0
  454. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PDFOptions.js.map +1 -0
  455. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.d.ts +2011 -0
  456. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.d.ts.map +1 -0
  457. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js +2427 -0
  458. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js.map +1 -0
  459. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Product.d.ts +21 -0
  460. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Product.d.ts.map +1 -0
  461. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Product.js +18 -0
  462. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Product.js.map +1 -0
  463. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Puppeteer.d.ts +160 -0
  464. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Puppeteer.d.ts.map +1 -0
  465. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Puppeteer.js +162 -0
  466. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Puppeteer.js.map +1 -0
  467. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PuppeteerViewport.d.ts +52 -0
  468. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PuppeteerViewport.d.ts.map +1 -0
  469. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PuppeteerViewport.js +3 -0
  470. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PuppeteerViewport.js.map +1 -0
  471. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/QueryHandler.d.ts +65 -0
  472. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/QueryHandler.d.ts.map +1 -0
  473. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/QueryHandler.js +166 -0
  474. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/QueryHandler.js.map +1 -0
  475. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/SecurityDetails.d.ts +61 -0
  476. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/SecurityDetails.d.ts.map +1 -0
  477. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/SecurityDetails.js +77 -0
  478. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/SecurityDetails.js.map +1 -0
  479. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Target.d.ts +99 -0
  480. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Target.d.ts.map +1 -0
  481. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Target.js +145 -0
  482. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Target.js.map +1 -0
  483. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/TimeoutSettings.d.ts +28 -0
  484. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/TimeoutSettings.d.ts.map +1 -0
  485. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/TimeoutSettings.js +48 -0
  486. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/TimeoutSettings.js.map +1 -0
  487. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Tracing.d.ts +47 -0
  488. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Tracing.d.ts.map +1 -0
  489. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Tracing.js +104 -0
  490. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Tracing.js.map +1 -0
  491. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/USKeyboardLayout.d.ts +40 -0
  492. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/USKeyboardLayout.d.ts.map +1 -0
  493. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/USKeyboardLayout.js +407 -0
  494. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/USKeyboardLayout.js.map +1 -0
  495. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WebWorker.d.ts +99 -0
  496. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WebWorker.d.ts.map +1 -0
  497. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WebWorker.js +113 -0
  498. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WebWorker.js.map +1 -0
  499. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/assert.d.ts +22 -0
  500. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/assert.d.ts.map +1 -0
  501. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/assert.js +29 -0
  502. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/assert.js.map +1 -0
  503. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/fetch.d.ts +17 -0
  504. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/fetch.d.ts.map +1 -0
  505. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/fetch.js +44 -0
  506. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/fetch.js.map +1 -0
  507. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/helper.d.ts +85 -0
  508. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/helper.d.ts.map +1 -0
  509. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/helper.js +328 -0
  510. data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/helper.js.map +1 -0
  511. data/node_modules/puppeteer-core/lib/cjs/puppeteer/environment.d.ts +17 -0
  512. data/node_modules/puppeteer-core/lib/cjs/puppeteer/environment.d.ts.map +1 -0
  513. data/node_modules/puppeteer-core/lib/cjs/puppeteer/environment.js +20 -0
  514. data/node_modules/puppeteer-core/lib/cjs/puppeteer/environment.js.map +1 -0
  515. data/node_modules/puppeteer-core/lib/cjs/puppeteer/initialize-node.d.ts +18 -0
  516. data/node_modules/puppeteer-core/lib/cjs/puppeteer/initialize-node.d.ts.map +1 -0
  517. data/node_modules/puppeteer-core/lib/cjs/puppeteer/initialize-node.js +45 -0
  518. data/node_modules/puppeteer-core/lib/cjs/puppeteer/initialize-node.js.map +1 -0
  519. data/node_modules/puppeteer-core/lib/cjs/puppeteer/initialize-web.d.ts +18 -0
  520. data/node_modules/puppeteer-core/lib/cjs/puppeteer/initialize-web.d.ts.map +1 -0
  521. data/node_modules/puppeteer-core/lib/cjs/puppeteer/initialize-web.js +27 -0
  522. data/node_modules/puppeteer-core/lib/cjs/puppeteer/initialize-web.js.map +1 -0
  523. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.d.ts +134 -0
  524. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.d.ts.map +1 -0
  525. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.js +502 -0
  526. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.js.map +1 -0
  527. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.d.ts +40 -0
  528. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.d.ts.map +1 -0
  529. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js +225 -0
  530. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js.map +1 -0
  531. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/LaunchOptions.d.ts +131 -0
  532. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/LaunchOptions.d.ts.map +1 -0
  533. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/LaunchOptions.js +18 -0
  534. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/LaunchOptions.js.map +1 -0
  535. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Launcher.d.ts +17 -0
  536. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Launcher.d.ts.map +1 -0
  537. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Launcher.js +574 -0
  538. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Launcher.js.map +1 -0
  539. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.d.ts +27 -0
  540. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -0
  541. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.js +42 -0
  542. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.js.map +1 -0
  543. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/PipeTransport.d.ts +30 -0
  544. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/PipeTransport.d.ts.map +1 -0
  545. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/PipeTransport.js +65 -0
  546. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/PipeTransport.js.map +1 -0
  547. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Puppeteer.d.ts +154 -0
  548. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Puppeteer.d.ts.map +1 -0
  549. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Puppeteer.js +189 -0
  550. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Puppeteer.js.map +1 -0
  551. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/install.d.ts +18 -0
  552. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/install.d.ts.map +1 -0
  553. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/install.js +160 -0
  554. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/install.js.map +1 -0
  555. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node-puppeteer-core.d.ts +18 -0
  556. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node-puppeteer-core.d.ts.map +1 -0
  557. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node-puppeteer-core.js +25 -0
  558. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node-puppeteer-core.js.map +1 -0
  559. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node.d.ts +18 -0
  560. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node.d.ts.map +1 -0
  561. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node.js +24 -0
  562. data/node_modules/puppeteer-core/lib/cjs/puppeteer/node.js.map +1 -0
  563. data/node_modules/puppeteer-core/lib/cjs/puppeteer/revisions.d.ts +22 -0
  564. data/node_modules/puppeteer-core/lib/cjs/puppeteer/revisions.d.ts.map +1 -0
  565. data/node_modules/puppeteer-core/lib/cjs/puppeteer/revisions.js +23 -0
  566. data/node_modules/puppeteer-core/lib/cjs/puppeteer/revisions.js.map +1 -0
  567. data/node_modules/puppeteer-core/lib/cjs/puppeteer/web.d.ts +18 -0
  568. data/node_modules/puppeteer-core/lib/cjs/puppeteer/web.d.ts.map +1 -0
  569. data/node_modules/puppeteer-core/lib/cjs/puppeteer/web.js +24 -0
  570. data/node_modules/puppeteer-core/lib/cjs/puppeteer/web.js.map +1 -0
  571. data/node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.d.ts +28 -0
  572. data/node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.d.ts.map +1 -0
  573. data/node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.js +57 -0
  574. data/node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.js.map +1 -0
  575. data/node_modules/puppeteer-core/lib/esm/puppeteer/api-docs-entry.d.ts +111 -0
  576. data/node_modules/puppeteer-core/lib/esm/puppeteer/api-docs-entry.d.ts.map +1 -0
  577. data/node_modules/puppeteer-core/lib/esm/puppeteer/api-docs-entry.js +81 -0
  578. data/node_modules/puppeteer-core/lib/esm/puppeteer/api-docs-entry.js.map +1 -0
  579. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Accessibility.d.ts +176 -0
  580. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Accessibility.d.ts.map +1 -0
  581. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Accessibility.js +357 -0
  582. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Accessibility.js.map +1 -0
  583. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/AriaQueryHandler.d.ts +21 -0
  584. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/AriaQueryHandler.d.ts.map +1 -0
  585. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/AriaQueryHandler.js +82 -0
  586. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -0
  587. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Browser.d.ts +438 -0
  588. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Browser.d.ts.map +1 -0
  589. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Browser.js +523 -0
  590. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Browser.js.map +1 -0
  591. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/BrowserConnector.d.ts +54 -0
  592. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/BrowserConnector.d.ts.map +1 -0
  593. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/BrowserConnector.js +75 -0
  594. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -0
  595. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/BrowserWebSocketTransport.d.ts +26 -0
  596. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/BrowserWebSocketTransport.d.ts.map +1 -0
  597. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/BrowserWebSocketTransport.js +31 -0
  598. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/BrowserWebSocketTransport.js.map +1 -0
  599. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.d.ts +130 -0
  600. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.d.ts.map +1 -0
  601. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.js +276 -0
  602. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.js.map +1 -0
  603. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/ConnectionTransport.d.ts +25 -0
  604. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/ConnectionTransport.d.ts.map +1 -0
  605. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/ConnectionTransport.js +17 -0
  606. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/ConnectionTransport.js.map +1 -0
  607. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/ConsoleMessage.d.ts +73 -0
  608. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -0
  609. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/ConsoleMessage.js +61 -0
  610. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -0
  611. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Coverage.d.ts +189 -0
  612. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Coverage.d.ts.map +1 -0
  613. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Coverage.js +323 -0
  614. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Coverage.js.map +1 -0
  615. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DOMWorld.d.ts +173 -0
  616. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -0
  617. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DOMWorld.js +650 -0
  618. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DOMWorld.js.map +1 -0
  619. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Debug.d.ts +53 -0
  620. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Debug.d.ts.map +1 -0
  621. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Debug.js +78 -0
  622. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Debug.js.map +1 -0
  623. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DeviceDescriptors.d.ts +41 -0
  624. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DeviceDescriptors.d.ts.map +1 -0
  625. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DeviceDescriptors.js +948 -0
  626. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DeviceDescriptors.js.map +1 -0
  627. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Dialog.d.ts +75 -0
  628. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Dialog.d.ts.map +1 -0
  629. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Dialog.js +94 -0
  630. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Dialog.js.map +1 -0
  631. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EmulationManager.d.ts +25 -0
  632. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EmulationManager.d.ts.map +1 -0
  633. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EmulationManager.js +34 -0
  634. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EmulationManager.js.map +1 -0
  635. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Errors.d.ts +42 -0
  636. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Errors.d.ts.map +1 -0
  637. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Errors.js +44 -0
  638. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Errors.js.map +1 -0
  639. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EvalTypes.d.ts +61 -0
  640. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EvalTypes.d.ts.map +1 -0
  641. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EvalTypes.js +17 -0
  642. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EvalTypes.js.map +1 -0
  643. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EventEmitter.d.ts +93 -0
  644. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -0
  645. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EventEmitter.js +110 -0
  646. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EventEmitter.js.map +1 -0
  647. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Events.d.ts +82 -0
  648. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Events.d.ts.map +1 -0
  649. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Events.js +84 -0
  650. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Events.js.map +1 -0
  651. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.d.ts +194 -0
  652. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.d.ts.map +1 -0
  653. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js +318 -0
  654. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js.map +1 -0
  655. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FileChooser.d.ts +59 -0
  656. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FileChooser.d.ts.map +1 -0
  657. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FileChooser.js +68 -0
  658. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FileChooser.js.map +1 -0
  659. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FrameManager.d.ts +733 -0
  660. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -0
  661. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FrameManager.js +960 -0
  662. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FrameManager.js.map +1 -0
  663. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPRequest.d.ts +341 -0
  664. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -0
  665. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPRequest.js +543 -0
  666. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPRequest.js.map +1 -0
  667. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPResponse.d.ts +126 -0
  668. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -0
  669. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPResponse.js +151 -0
  670. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/HTTPResponse.js.map +1 -0
  671. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Input.d.ts +360 -0
  672. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Input.d.ts.map +1 -0
  673. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Input.js +539 -0
  674. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Input.js.map +1 -0
  675. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.d.ts +469 -0
  676. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -0
  677. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.js +778 -0
  678. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.js.map +1 -0
  679. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/LifecycleWatcher.d.ts +66 -0
  680. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/LifecycleWatcher.d.ts.map +1 -0
  681. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/LifecycleWatcher.js +145 -0
  682. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/LifecycleWatcher.js.map +1 -0
  683. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkConditions.d.ts +27 -0
  684. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkConditions.d.ts.map +1 -0
  685. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkConditions.js +31 -0
  686. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkConditions.js.map +1 -0
  687. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkManager.d.ts +97 -0
  688. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -0
  689. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkManager.js +337 -0
  690. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkManager.js.map +1 -0
  691. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PDFOptions.d.ts +157 -0
  692. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PDFOptions.d.ts.map +1 -0
  693. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PDFOptions.js +32 -0
  694. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PDFOptions.js.map +1 -0
  695. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Page.d.ts +2011 -0
  696. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Page.d.ts.map +1 -0
  697. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Page.js +2423 -0
  698. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Page.js.map +1 -0
  699. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Product.d.ts +21 -0
  700. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Product.d.ts.map +1 -0
  701. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Product.js +17 -0
  702. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Product.js.map +1 -0
  703. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Puppeteer.d.ts +160 -0
  704. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Puppeteer.d.ts.map +1 -0
  705. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Puppeteer.js +158 -0
  706. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Puppeteer.js.map +1 -0
  707. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PuppeteerViewport.d.ts +52 -0
  708. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PuppeteerViewport.d.ts.map +1 -0
  709. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PuppeteerViewport.js +2 -0
  710. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PuppeteerViewport.js.map +1 -0
  711. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/QueryHandler.d.ts +65 -0
  712. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/QueryHandler.d.ts.map +1 -0
  713. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/QueryHandler.js +158 -0
  714. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/QueryHandler.js.map +1 -0
  715. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/SecurityDetails.d.ts +61 -0
  716. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/SecurityDetails.d.ts.map +1 -0
  717. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/SecurityDetails.js +73 -0
  718. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/SecurityDetails.js.map +1 -0
  719. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Target.d.ts +99 -0
  720. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Target.d.ts.map +1 -0
  721. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Target.js +141 -0
  722. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Target.js.map +1 -0
  723. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/TimeoutSettings.d.ts +28 -0
  724. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/TimeoutSettings.d.ts.map +1 -0
  725. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/TimeoutSettings.js +44 -0
  726. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/TimeoutSettings.js.map +1 -0
  727. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Tracing.d.ts +47 -0
  728. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Tracing.d.ts.map +1 -0
  729. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Tracing.js +100 -0
  730. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Tracing.js.map +1 -0
  731. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/USKeyboardLayout.d.ts +40 -0
  732. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/USKeyboardLayout.d.ts.map +1 -0
  733. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/USKeyboardLayout.js +404 -0
  734. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/USKeyboardLayout.js.map +1 -0
  735. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/WebWorker.d.ts +99 -0
  736. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/WebWorker.d.ts.map +1 -0
  737. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/WebWorker.js +109 -0
  738. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/WebWorker.js.map +1 -0
  739. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/assert.d.ts +22 -0
  740. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/assert.d.ts.map +1 -0
  741. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/assert.js +25 -0
  742. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/assert.js.map +1 -0
  743. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/fetch.d.ts +17 -0
  744. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/fetch.d.ts.map +1 -0
  745. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/fetch.js +21 -0
  746. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/fetch.js.map +1 -0
  747. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/helper.d.ts +85 -0
  748. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/helper.d.ts.map +1 -0
  749. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/helper.js +306 -0
  750. data/node_modules/puppeteer-core/lib/esm/puppeteer/common/helper.js.map +1 -0
  751. data/node_modules/puppeteer-core/lib/esm/puppeteer/environment.d.ts +17 -0
  752. data/node_modules/puppeteer-core/lib/esm/puppeteer/environment.d.ts.map +1 -0
  753. data/node_modules/puppeteer-core/lib/esm/puppeteer/environment.js +17 -0
  754. data/node_modules/puppeteer-core/lib/esm/puppeteer/environment.js.map +1 -0
  755. data/node_modules/puppeteer-core/lib/esm/puppeteer/initialize-node.d.ts +18 -0
  756. data/node_modules/puppeteer-core/lib/esm/puppeteer/initialize-node.d.ts.map +1 -0
  757. data/node_modules/puppeteer-core/lib/esm/puppeteer/initialize-node.js +38 -0
  758. data/node_modules/puppeteer-core/lib/esm/puppeteer/initialize-node.js.map +1 -0
  759. data/node_modules/puppeteer-core/lib/esm/puppeteer/initialize-web.d.ts +18 -0
  760. data/node_modules/puppeteer-core/lib/esm/puppeteer/initialize-web.d.ts.map +1 -0
  761. data/node_modules/puppeteer-core/lib/esm/puppeteer/initialize-web.js +23 -0
  762. data/node_modules/puppeteer-core/lib/esm/puppeteer/initialize-web.js.map +1 -0
  763. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserFetcher.d.ts +134 -0
  764. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserFetcher.d.ts.map +1 -0
  765. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserFetcher.js +476 -0
  766. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserFetcher.js.map +1 -0
  767. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserRunner.d.ts +40 -0
  768. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -0
  769. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserRunner.js +199 -0
  770. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserRunner.js.map +1 -0
  771. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/LaunchOptions.d.ts +131 -0
  772. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -0
  773. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/LaunchOptions.js +17 -0
  774. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/LaunchOptions.js.map +1 -0
  775. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/Launcher.d.ts +17 -0
  776. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/Launcher.d.ts.map +1 -0
  777. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/Launcher.js +552 -0
  778. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/Launcher.js.map +1 -0
  779. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts +27 -0
  780. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -0
  781. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/NodeWebSocketTransport.js +35 -0
  782. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/NodeWebSocketTransport.js.map +1 -0
  783. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/PipeTransport.d.ts +30 -0
  784. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/PipeTransport.d.ts.map +1 -0
  785. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/PipeTransport.js +61 -0
  786. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/PipeTransport.js.map +1 -0
  787. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/Puppeteer.d.ts +154 -0
  788. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/Puppeteer.d.ts.map +1 -0
  789. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/Puppeteer.js +182 -0
  790. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/Puppeteer.js.map +1 -0
  791. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/install.d.ts +18 -0
  792. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/install.d.ts.map +1 -0
  793. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/install.js +152 -0
  794. data/node_modules/puppeteer-core/lib/esm/puppeteer/node/install.js.map +1 -0
  795. data/node_modules/puppeteer-core/lib/esm/puppeteer/node-puppeteer-core.d.ts +18 -0
  796. data/node_modules/puppeteer-core/lib/esm/puppeteer/node-puppeteer-core.d.ts.map +1 -0
  797. data/node_modules/puppeteer-core/lib/esm/puppeteer/node-puppeteer-core.js +23 -0
  798. data/node_modules/puppeteer-core/lib/esm/puppeteer/node-puppeteer-core.js.map +1 -0
  799. data/node_modules/puppeteer-core/lib/esm/puppeteer/node.d.ts +18 -0
  800. data/node_modules/puppeteer-core/lib/esm/puppeteer/node.d.ts.map +1 -0
  801. data/node_modules/puppeteer-core/lib/esm/puppeteer/node.js +22 -0
  802. data/node_modules/puppeteer-core/lib/esm/puppeteer/node.js.map +1 -0
  803. data/node_modules/puppeteer-core/lib/esm/puppeteer/revisions.d.ts +22 -0
  804. data/node_modules/puppeteer-core/lib/esm/puppeteer/revisions.d.ts.map +1 -0
  805. data/node_modules/puppeteer-core/lib/esm/puppeteer/revisions.js +20 -0
  806. data/node_modules/puppeteer-core/lib/esm/puppeteer/revisions.js.map +1 -0
  807. data/node_modules/puppeteer-core/lib/esm/puppeteer/web.d.ts +18 -0
  808. data/node_modules/puppeteer-core/lib/esm/puppeteer/web.d.ts.map +1 -0
  809. data/node_modules/puppeteer-core/lib/esm/puppeteer/web.js +22 -0
  810. data/node_modules/puppeteer-core/lib/esm/puppeteer/web.js.map +1 -0
  811. data/node_modules/puppeteer-core/lib/esm/vendor/mitt/src/index.d.ts +28 -0
  812. data/node_modules/puppeteer-core/lib/esm/vendor/mitt/src/index.d.ts.map +1 -0
  813. data/node_modules/puppeteer-core/lib/esm/vendor/mitt/src/index.js +54 -0
  814. data/node_modules/puppeteer-core/lib/esm/vendor/mitt/src/index.js.map +1 -0
  815. data/node_modules/puppeteer-core/lib/types.d.ts +6911 -0
  816. data/node_modules/puppeteer-core/package.json +122 -0
  817. data/node_modules/puppeteer-core/typescript-if-required.js +61 -0
  818. data/node_modules/readable-stream/CONTRIBUTING.md +38 -0
  819. data/node_modules/readable-stream/GOVERNANCE.md +136 -0
  820. data/node_modules/readable-stream/LICENSE +47 -0
  821. data/node_modules/readable-stream/README.md +106 -0
  822. data/node_modules/readable-stream/errors-browser.js +127 -0
  823. data/node_modules/readable-stream/errors.js +116 -0
  824. data/node_modules/readable-stream/experimentalWarning.js +17 -0
  825. data/node_modules/readable-stream/lib/_stream_duplex.js +139 -0
  826. data/node_modules/readable-stream/lib/_stream_passthrough.js +39 -0
  827. data/node_modules/readable-stream/lib/_stream_readable.js +1124 -0
  828. data/node_modules/readable-stream/lib/_stream_transform.js +201 -0
  829. data/node_modules/readable-stream/lib/_stream_writable.js +697 -0
  830. data/node_modules/readable-stream/lib/internal/streams/async_iterator.js +207 -0
  831. data/node_modules/readable-stream/lib/internal/streams/buffer_list.js +210 -0
  832. data/node_modules/readable-stream/lib/internal/streams/destroy.js +105 -0
  833. data/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +104 -0
  834. data/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
  835. data/node_modules/readable-stream/lib/internal/streams/from.js +64 -0
  836. data/node_modules/readable-stream/lib/internal/streams/pipeline.js +97 -0
  837. data/node_modules/readable-stream/lib/internal/streams/state.js +27 -0
  838. data/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  839. data/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  840. data/node_modules/readable-stream/package.json +68 -0
  841. data/node_modules/readable-stream/readable-browser.js +9 -0
  842. data/node_modules/readable-stream/readable.js +16 -0
  843. data/node_modules/rimraf/CHANGELOG.md +65 -0
  844. data/node_modules/rimraf/LICENSE +15 -0
  845. data/node_modules/rimraf/README.md +101 -0
  846. data/node_modules/rimraf/bin.js +68 -0
  847. data/node_modules/rimraf/package.json +32 -0
  848. data/node_modules/rimraf/rimraf.js +360 -0
  849. data/node_modules/safe-buffer/LICENSE +21 -0
  850. data/node_modules/safe-buffer/README.md +584 -0
  851. data/node_modules/safe-buffer/index.d.ts +187 -0
  852. data/node_modules/safe-buffer/index.js +65 -0
  853. data/node_modules/safe-buffer/package.json +51 -0
  854. data/node_modules/string_decoder/LICENSE +48 -0
  855. data/node_modules/string_decoder/README.md +47 -0
  856. data/node_modules/string_decoder/lib/string_decoder.js +296 -0
  857. data/node_modules/string_decoder/package.json +34 -0
  858. data/node_modules/tar-fs/.travis.yml +5 -0
  859. data/node_modules/tar-fs/LICENSE +21 -0
  860. data/node_modules/tar-fs/README.md +163 -0
  861. data/node_modules/tar-fs/index.js +348 -0
  862. data/node_modules/tar-fs/package.json +41 -0
  863. data/node_modules/tar-fs/test/fixtures/a/hello.txt +1 -0
  864. data/node_modules/tar-fs/test/fixtures/b/a/test.txt +1 -0
  865. data/node_modules/tar-fs/test/fixtures/d/file1 +0 -0
  866. data/node_modules/tar-fs/test/fixtures/d/file2 +0 -0
  867. data/node_modules/tar-fs/test/fixtures/d/sub-dir/file5 +0 -0
  868. data/node_modules/tar-fs/test/fixtures/d/sub-files/file3 +0 -0
  869. data/node_modules/tar-fs/test/fixtures/d/sub-files/file4 +0 -0
  870. data/node_modules/tar-fs/test/fixtures/e/directory/.ignore +0 -0
  871. data/node_modules/tar-fs/test/fixtures/e/file +0 -0
  872. data/node_modules/tar-fs/test/fixtures/invalid.tar +0 -0
  873. data/node_modules/tar-fs/test/index.js +346 -0
  874. data/node_modules/tar-stream/LICENSE +21 -0
  875. data/node_modules/tar-stream/README.md +168 -0
  876. data/node_modules/tar-stream/extract.js +257 -0
  877. data/node_modules/tar-stream/headers.js +295 -0
  878. data/node_modules/tar-stream/index.js +2 -0
  879. data/node_modules/tar-stream/pack.js +255 -0
  880. data/node_modules/tar-stream/package.json +58 -0
  881. data/node_modules/tar-stream/sandbox.js +11 -0
  882. data/node_modules/through/.travis.yml +5 -0
  883. data/node_modules/through/LICENSE.APACHE2 +15 -0
  884. data/node_modules/through/LICENSE.MIT +24 -0
  885. data/node_modules/through/index.js +108 -0
  886. data/node_modules/through/package.json +36 -0
  887. data/node_modules/through/readme.markdown +64 -0
  888. data/node_modules/through/test/async.js +28 -0
  889. data/node_modules/through/test/auto-destroy.js +30 -0
  890. data/node_modules/through/test/buffering.js +71 -0
  891. data/node_modules/through/test/end.js +45 -0
  892. data/node_modules/through/test/index.js +133 -0
  893. data/node_modules/unbzip2-stream/LICENSE +24 -0
  894. data/node_modules/unbzip2-stream/README.md +59 -0
  895. data/node_modules/unbzip2-stream/dist/unbzip2-stream.min.js +1 -0
  896. data/node_modules/unbzip2-stream/index.js +92 -0
  897. data/node_modules/unbzip2-stream/lib/bit_iterator.js +39 -0
  898. data/node_modules/unbzip2-stream/lib/bzip2.js +367 -0
  899. data/node_modules/unbzip2-stream/package.json +51 -0
  900. data/node_modules/util-deprecate/History.md +16 -0
  901. data/node_modules/util-deprecate/LICENSE +24 -0
  902. data/node_modules/util-deprecate/README.md +53 -0
  903. data/node_modules/util-deprecate/browser.js +67 -0
  904. data/node_modules/util-deprecate/node.js +6 -0
  905. data/node_modules/util-deprecate/package.json +27 -0
  906. data/node_modules/wrappy/LICENSE +15 -0
  907. data/node_modules/wrappy/README.md +36 -0
  908. data/node_modules/wrappy/package.json +29 -0
  909. data/node_modules/wrappy/wrappy.js +33 -0
  910. data/node_modules/ws/LICENSE +21 -0
  911. data/node_modules/ws/README.md +496 -0
  912. data/node_modules/ws/browser.js +8 -0
  913. data/node_modules/ws/index.js +10 -0
  914. data/node_modules/ws/lib/buffer-util.js +129 -0
  915. data/node_modules/ws/lib/constants.js +10 -0
  916. data/node_modules/ws/lib/event-target.js +184 -0
  917. data/node_modules/ws/lib/extension.js +223 -0
  918. data/node_modules/ws/lib/limiter.js +55 -0
  919. data/node_modules/ws/lib/permessage-deflate.js +517 -0
  920. data/node_modules/ws/lib/receiver.js +507 -0
  921. data/node_modules/ws/lib/sender.js +405 -0
  922. data/node_modules/ws/lib/stream.js +165 -0
  923. data/node_modules/ws/lib/validation.js +104 -0
  924. data/node_modules/ws/lib/websocket-server.js +418 -0
  925. data/node_modules/ws/lib/websocket.js +942 -0
  926. data/node_modules/ws/package.json +56 -0
  927. data/node_modules/yauzl/LICENSE +21 -0
  928. data/node_modules/yauzl/README.md +658 -0
  929. data/node_modules/yauzl/index.js +796 -0
  930. data/node_modules/yauzl/package.json +40 -0
  931. data/package.json +6 -0
  932. metadata +940 -58
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../../src/common/Page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAEL,UAAU,EAEX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EACL,KAAK,EAGN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,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EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACtB,EACN,GAAG,IAAI,EAAE,sBAAsB,EAAE,GAChC,OAAO,CAAC,QAAQ,CAAC;IAQpB;;;;;;;;;;;;;;;;;;OAkBG;IACH,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+CG;IACH,eAAe,CACb,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;QACP,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;KACb,GACL,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAIhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+CG;IACH,YAAY,CACV,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;QACP,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;KACb,GACL,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAIhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiEG;IACH,eAAe,CACb,YAAY,EAAE,QAAQ,GAAG,MAAM,EAC/B,OAAO,GAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACtB,EACN,GAAG,IAAI,EAAE,sBAAsB,EAAE,GAChC,OAAO,CAAC,QAAQ,CAAC;CAGrB"}
@@ -0,0 +1,2427 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright 2017 Google Inc. All rights reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.Page = void 0;
19
+ const EventEmitter_js_1 = require("./EventEmitter.js");
20
+ const Connection_js_1 = require("./Connection.js");
21
+ const Dialog_js_1 = require("./Dialog.js");
22
+ const EmulationManager_js_1 = require("./EmulationManager.js");
23
+ const FrameManager_js_1 = require("./FrameManager.js");
24
+ const Input_js_1 = require("./Input.js");
25
+ const Tracing_js_1 = require("./Tracing.js");
26
+ const assert_js_1 = require("./assert.js");
27
+ const helper_js_1 = require("./helper.js");
28
+ const Coverage_js_1 = require("./Coverage.js");
29
+ const WebWorker_js_1 = require("./WebWorker.js");
30
+ const JSHandle_js_1 = require("./JSHandle.js");
31
+ const NetworkManager_js_1 = require("./NetworkManager.js");
32
+ const Accessibility_js_1 = require("./Accessibility.js");
33
+ const TimeoutSettings_js_1 = require("./TimeoutSettings.js");
34
+ const FileChooser_js_1 = require("./FileChooser.js");
35
+ const ConsoleMessage_js_1 = require("./ConsoleMessage.js");
36
+ const PDFOptions_js_1 = require("./PDFOptions.js");
37
+ const environment_js_1 = require("../environment.js");
38
+ class ScreenshotTaskQueue {
39
+ constructor() {
40
+ this._chain = Promise.resolve(undefined);
41
+ }
42
+ postTask(task) {
43
+ const result = this._chain.then(task);
44
+ this._chain = result.catch(() => { });
45
+ return result;
46
+ }
47
+ }
48
+ /**
49
+ * Page provides methods to interact with a single tab or
50
+ * {@link https://developer.chrome.com/extensions/background_pages | extension background page} in Chromium.
51
+ *
52
+ * @remarks
53
+ *
54
+ * One Browser instance might have multiple Page instances.
55
+ *
56
+ * @example
57
+ * This example creates a page, navigates it to a URL, and then * saves a screenshot:
58
+ * ```js
59
+ * const puppeteer = require('puppeteer');
60
+ *
61
+ * (async () => {
62
+ * const browser = await puppeteer.launch();
63
+ * const page = await browser.newPage();
64
+ * await page.goto('https://example.com');
65
+ * await page.screenshot({path: 'screenshot.png'});
66
+ * await browser.close();
67
+ * })();
68
+ * ```
69
+ *
70
+ * The Page class extends from Puppeteer's {@link EventEmitter} class and will
71
+ * emit various events which are documented in the {@link PageEmittedEvents} enum.
72
+ *
73
+ * @example
74
+ * This example logs a message for a single page `load` event:
75
+ * ```js
76
+ * page.once('load', () => console.log('Page loaded!'));
77
+ * ```
78
+ *
79
+ * To unsubscribe from events use the `off` method:
80
+ *
81
+ * ```js
82
+ * function logRequest(interceptedRequest) {
83
+ * console.log('A request was made:', interceptedRequest.url());
84
+ * }
85
+ * page.on('request', logRequest);
86
+ * // Sometime later...
87
+ * page.off('request', logRequest);
88
+ * ```
89
+ * @public
90
+ */
91
+ class Page extends EventEmitter_js_1.EventEmitter {
92
+ /**
93
+ * @internal
94
+ */
95
+ constructor(client, target, ignoreHTTPSErrors) {
96
+ super();
97
+ this._closed = false;
98
+ this._timeoutSettings = new TimeoutSettings_js_1.TimeoutSettings();
99
+ this._pageBindings = new Map();
100
+ this._javascriptEnabled = true;
101
+ this._workers = new Map();
102
+ // TODO: improve this typedef - it's a function that takes a file chooser or
103
+ // something?
104
+ this._fileChooserInterceptors = new Set();
105
+ this._userDragInterceptionEnabled = false;
106
+ this._client = client;
107
+ this._target = target;
108
+ this._keyboard = new Input_js_1.Keyboard(client);
109
+ this._mouse = new Input_js_1.Mouse(client, this._keyboard);
110
+ this._touchscreen = new Input_js_1.Touchscreen(client, this._keyboard);
111
+ this._accessibility = new Accessibility_js_1.Accessibility(client);
112
+ this._frameManager = new FrameManager_js_1.FrameManager(client, this, ignoreHTTPSErrors, this._timeoutSettings);
113
+ this._emulationManager = new EmulationManager_js_1.EmulationManager(client);
114
+ this._tracing = new Tracing_js_1.Tracing(client);
115
+ this._coverage = new Coverage_js_1.Coverage(client);
116
+ this._screenshotTaskQueue = new ScreenshotTaskQueue();
117
+ this._viewport = null;
118
+ client.on('Target.attachedToTarget', (event) => {
119
+ if (event.targetInfo.type !== 'worker' &&
120
+ event.targetInfo.type !== 'iframe') {
121
+ // If we don't detach from service workers, they will never die.
122
+ // We still want to attach to workers for emitting events.
123
+ // We still want to attach to iframes so sessions may interact with them.
124
+ // We detach from all other types out of an abundance of caution.
125
+ // See https://source.chromium.org/chromium/chromium/src/+/master:content/browser/devtools/devtools_agent_host_impl.cc?q=f:devtools%20-f:out%20%22::kTypePage%5B%5D%22&ss=chromium
126
+ // for the complete list of available types.
127
+ client
128
+ .send('Target.detachFromTarget', {
129
+ sessionId: event.sessionId,
130
+ })
131
+ .catch(helper_js_1.debugError);
132
+ return;
133
+ }
134
+ const session = Connection_js_1.Connection.fromSession(client).session(event.sessionId);
135
+ const worker = new WebWorker_js_1.WebWorker(session, event.targetInfo.url, this._addConsoleMessage.bind(this), this._handleException.bind(this));
136
+ this._workers.set(event.sessionId, worker);
137
+ this.emit("workercreated" /* WorkerCreated */, worker);
138
+ });
139
+ client.on('Target.detachedFromTarget', (event) => {
140
+ const worker = this._workers.get(event.sessionId);
141
+ if (!worker)
142
+ return;
143
+ this._workers.delete(event.sessionId);
144
+ this.emit("workerdestroyed" /* WorkerDestroyed */, worker);
145
+ });
146
+ this._frameManager.on(FrameManager_js_1.FrameManagerEmittedEvents.FrameAttached, (event) => this.emit("frameattached" /* FrameAttached */, event));
147
+ this._frameManager.on(FrameManager_js_1.FrameManagerEmittedEvents.FrameDetached, (event) => this.emit("framedetached" /* FrameDetached */, event));
148
+ this._frameManager.on(FrameManager_js_1.FrameManagerEmittedEvents.FrameNavigated, (event) => this.emit("framenavigated" /* FrameNavigated */, event));
149
+ const networkManager = this._frameManager.networkManager();
150
+ networkManager.on(NetworkManager_js_1.NetworkManagerEmittedEvents.Request, (event) => this.emit("request" /* Request */, event));
151
+ networkManager.on(NetworkManager_js_1.NetworkManagerEmittedEvents.RequestServedFromCache, (event) => this.emit("requestservedfromcache" /* RequestServedFromCache */, event));
152
+ networkManager.on(NetworkManager_js_1.NetworkManagerEmittedEvents.Response, (event) => this.emit("response" /* Response */, event));
153
+ networkManager.on(NetworkManager_js_1.NetworkManagerEmittedEvents.RequestFailed, (event) => this.emit("requestfailed" /* RequestFailed */, event));
154
+ networkManager.on(NetworkManager_js_1.NetworkManagerEmittedEvents.RequestFinished, (event) => this.emit("requestfinished" /* RequestFinished */, event));
155
+ this._fileChooserInterceptors = new Set();
156
+ client.on('Page.domContentEventFired', () => this.emit("domcontentloaded" /* DOMContentLoaded */));
157
+ client.on('Page.loadEventFired', () => this.emit("load" /* Load */));
158
+ client.on('Runtime.consoleAPICalled', (event) => this._onConsoleAPI(event));
159
+ client.on('Runtime.bindingCalled', (event) => this._onBindingCalled(event));
160
+ client.on('Page.javascriptDialogOpening', (event) => this._onDialog(event));
161
+ client.on('Runtime.exceptionThrown', (exception) => this._handleException(exception.exceptionDetails));
162
+ client.on('Inspector.targetCrashed', () => this._onTargetCrashed());
163
+ client.on('Performance.metrics', (event) => this._emitMetrics(event));
164
+ client.on('Log.entryAdded', (event) => this._onLogEntryAdded(event));
165
+ client.on('Page.fileChooserOpened', (event) => this._onFileChooser(event));
166
+ this._target._isClosedPromise.then(() => {
167
+ this.emit("close" /* Close */);
168
+ this._closed = true;
169
+ });
170
+ }
171
+ /**
172
+ * @internal
173
+ */
174
+ static async create(client, target, ignoreHTTPSErrors, defaultViewport) {
175
+ const page = new Page(client, target, ignoreHTTPSErrors);
176
+ await page._initialize();
177
+ if (defaultViewport)
178
+ await page.setViewport(defaultViewport);
179
+ return page;
180
+ }
181
+ async _initialize() {
182
+ await Promise.all([
183
+ this._frameManager.initialize(),
184
+ this._client.send('Target.setAutoAttach', {
185
+ autoAttach: true,
186
+ waitForDebuggerOnStart: false,
187
+ flatten: true,
188
+ }),
189
+ this._client.send('Performance.enable'),
190
+ this._client.send('Log.enable'),
191
+ ]);
192
+ }
193
+ async _onFileChooser(event) {
194
+ if (!this._fileChooserInterceptors.size)
195
+ return;
196
+ const frame = this._frameManager.frame(event.frameId);
197
+ const context = await frame.executionContext();
198
+ const element = await context._adoptBackendNodeId(event.backendNodeId);
199
+ const interceptors = Array.from(this._fileChooserInterceptors);
200
+ this._fileChooserInterceptors.clear();
201
+ const fileChooser = new FileChooser_js_1.FileChooser(element, event);
202
+ for (const interceptor of interceptors)
203
+ interceptor.call(null, fileChooser);
204
+ }
205
+ /**
206
+ * @returns `true` if drag events are being intercepted, `false` otherwise.
207
+ */
208
+ isDragInterceptionEnabled() {
209
+ return this._userDragInterceptionEnabled;
210
+ }
211
+ /**
212
+ * @returns `true` if the page has JavaScript enabled, `false` otherwise.
213
+ */
214
+ isJavaScriptEnabled() {
215
+ return this._javascriptEnabled;
216
+ }
217
+ /**
218
+ * Listen to page events.
219
+ */
220
+ // Note: this method exists to define event typings and handle
221
+ // proper wireup of cooperative request interception. Actual event listening and
222
+ // dispatching is delegated to EventEmitter.
223
+ on(eventName, handler) {
224
+ if (eventName === 'request') {
225
+ return super.on(eventName, (event) => {
226
+ event.enqueueInterceptAction(() => handler(event));
227
+ });
228
+ }
229
+ return super.on(eventName, handler);
230
+ }
231
+ once(eventName, handler) {
232
+ // Note: this method only exists to define the types; we delegate the impl
233
+ // to EventEmitter.
234
+ return super.once(eventName, handler);
235
+ }
236
+ /**
237
+ * This method is typically coupled with an action that triggers file
238
+ * choosing. The following example clicks a button that issues a file chooser
239
+ * and then responds with `/tmp/myfile.pdf` as if a user has selected this file.
240
+ *
241
+ * ```js
242
+ * const [fileChooser] = await Promise.all([
243
+ * page.waitForFileChooser(),
244
+ * page.click('#upload-file-button'),
245
+ * // some button that triggers file selection
246
+ * ]);
247
+ * await fileChooser.accept(['/tmp/myfile.pdf']);
248
+ * ```
249
+ *
250
+ * NOTE: This must be called before the file chooser is launched. It will not
251
+ * return a currently active file chooser.
252
+ * @param options - Optional waiting parameters
253
+ * @returns Resolves after a page requests a file picker.
254
+ * @remarks
255
+ * NOTE: In non-headless Chromium, this method results in the native file picker
256
+ * dialog `not showing up` for the user.
257
+ */
258
+ async waitForFileChooser(options = {}) {
259
+ if (!this._fileChooserInterceptors.size)
260
+ await this._client.send('Page.setInterceptFileChooserDialog', {
261
+ enabled: true,
262
+ });
263
+ const { timeout = this._timeoutSettings.timeout() } = options;
264
+ let callback;
265
+ const promise = new Promise((x) => (callback = x));
266
+ this._fileChooserInterceptors.add(callback);
267
+ return helper_js_1.helper
268
+ .waitWithTimeout(promise, 'waiting for file chooser', timeout)
269
+ .catch((error) => {
270
+ this._fileChooserInterceptors.delete(callback);
271
+ throw error;
272
+ });
273
+ }
274
+ /**
275
+ * Sets the page's geolocation.
276
+ * @remarks
277
+ * NOTE: Consider using {@link BrowserContext.overridePermissions} to grant
278
+ * permissions for the page to read its geolocation.
279
+ * @example
280
+ * ```js
281
+ * await page.setGeolocation({latitude: 59.95, longitude: 30.31667});
282
+ * ```
283
+ */
284
+ async setGeolocation(options) {
285
+ const { longitude, latitude, accuracy = 0 } = options;
286
+ if (longitude < -180 || longitude > 180)
287
+ throw new Error(`Invalid longitude "${longitude}": precondition -180 <= LONGITUDE <= 180 failed.`);
288
+ if (latitude < -90 || latitude > 90)
289
+ throw new Error(`Invalid latitude "${latitude}": precondition -90 <= LATITUDE <= 90 failed.`);
290
+ if (accuracy < 0)
291
+ throw new Error(`Invalid accuracy "${accuracy}": precondition 0 <= ACCURACY failed.`);
292
+ await this._client.send('Emulation.setGeolocationOverride', {
293
+ longitude,
294
+ latitude,
295
+ accuracy,
296
+ });
297
+ }
298
+ /**
299
+ * @returns A target this page was created from.
300
+ */
301
+ target() {
302
+ return this._target;
303
+ }
304
+ /**
305
+ * Get the browser the page belongs to.
306
+ */
307
+ browser() {
308
+ return this._target.browser();
309
+ }
310
+ /**
311
+ * Get the browser context that the page belongs to.
312
+ */
313
+ browserContext() {
314
+ return this._target.browserContext();
315
+ }
316
+ _onTargetCrashed() {
317
+ this.emit('error', new Error('Page crashed!'));
318
+ }
319
+ _onLogEntryAdded(event) {
320
+ const { level, text, args, source, url, lineNumber } = event.entry;
321
+ if (args)
322
+ args.map((arg) => helper_js_1.helper.releaseObject(this._client, arg));
323
+ if (source !== 'worker')
324
+ this.emit("console" /* Console */, new ConsoleMessage_js_1.ConsoleMessage(level, text, [], [{ url, lineNumber }]));
325
+ }
326
+ /**
327
+ * @returns The page's main frame.
328
+ * @remarks
329
+ * Page is guaranteed to have a main frame which persists during navigations.
330
+ */
331
+ mainFrame() {
332
+ return this._frameManager.mainFrame();
333
+ }
334
+ get keyboard() {
335
+ return this._keyboard;
336
+ }
337
+ get touchscreen() {
338
+ return this._touchscreen;
339
+ }
340
+ get coverage() {
341
+ return this._coverage;
342
+ }
343
+ get tracing() {
344
+ return this._tracing;
345
+ }
346
+ get accessibility() {
347
+ return this._accessibility;
348
+ }
349
+ /**
350
+ * @returns An array of all frames attached to the page.
351
+ */
352
+ frames() {
353
+ return this._frameManager.frames();
354
+ }
355
+ /**
356
+ * @returns all of the dedicated
357
+ * {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API |
358
+ * WebWorkers}
359
+ * associated with the page.
360
+ * @remarks
361
+ * NOTE: This does not contain ServiceWorkers
362
+ */
363
+ workers() {
364
+ return Array.from(this._workers.values());
365
+ }
366
+ /**
367
+ * @param value - Whether to enable request interception.
368
+ *
369
+ * @remarks
370
+ * Activating request interception enables {@link HTTPRequest.abort},
371
+ * {@link HTTPRequest.continue} and {@link HTTPRequest.respond} methods. This
372
+ * provides the capability to modify network requests that are made by a page.
373
+ *
374
+ * Once request interception is enabled, every request will stall unless it's
375
+ * continued, responded or aborted; or completed using the browser cache.
376
+ *
377
+ * @example
378
+ * An example of a naïve request interceptor that aborts all image requests:
379
+ * ```js
380
+ * const puppeteer = require('puppeteer');
381
+ * (async () => {
382
+ * const browser = await puppeteer.launch();
383
+ * const page = await browser.newPage();
384
+ * await page.setRequestInterception(true);
385
+ * page.on('request', interceptedRequest => {
386
+ * if (interceptedRequest.url().endsWith('.png') ||
387
+ * interceptedRequest.url().endsWith('.jpg'))
388
+ * interceptedRequest.abort();
389
+ * else
390
+ * interceptedRequest.continue();
391
+ * });
392
+ * await page.goto('https://example.com');
393
+ * await browser.close();
394
+ * })();
395
+ * ```
396
+ * NOTE: Enabling request interception disables page caching.
397
+ */
398
+ async setRequestInterception(value) {
399
+ return this._frameManager.networkManager().setRequestInterception(value);
400
+ }
401
+ /**
402
+ * @param enabled - Whether to enable drag interception.
403
+ *
404
+ * @remarks
405
+ * Activating drag interception enables the `Input.drag`,
406
+ * methods This provides the capability to capture drag events emitted
407
+ * on the page, which can then be used to simulate drag-and-drop.
408
+ */
409
+ async setDragInterception(enabled) {
410
+ this._userDragInterceptionEnabled = enabled;
411
+ return this._client.send('Input.setInterceptDrags', { enabled });
412
+ }
413
+ /**
414
+ * @param enabled - When `true`, enables offline mode for the page.
415
+ * @remarks
416
+ * NOTE: while this method sets the network connection to offline, it does
417
+ * not change the parameters used in [page.emulateNetworkConditions(networkConditions)]
418
+ * (#pageemulatenetworkconditionsnetworkconditions)
419
+ */
420
+ setOfflineMode(enabled) {
421
+ return this._frameManager.networkManager().setOfflineMode(enabled);
422
+ }
423
+ /**
424
+ * @param networkConditions - Passing `null` disables network condition emulation.
425
+ * @example
426
+ * ```js
427
+ * const puppeteer = require('puppeteer');
428
+ * const slow3G = puppeteer.networkConditions['Slow 3G'];
429
+ *
430
+ * (async () => {
431
+ * const browser = await puppeteer.launch();
432
+ * const page = await browser.newPage();
433
+ * await page.emulateNetworkConditions(slow3G);
434
+ * await page.goto('https://www.google.com');
435
+ * // other actions...
436
+ * await browser.close();
437
+ * })();
438
+ * ```
439
+ * @remarks
440
+ * NOTE: This does not affect WebSockets and WebRTC PeerConnections (see
441
+ * https://crbug.com/563644). To set the page offline, you can use
442
+ * [page.setOfflineMode(enabled)](#pagesetofflinemodeenabled).
443
+ */
444
+ emulateNetworkConditions(networkConditions) {
445
+ return this._frameManager
446
+ .networkManager()
447
+ .emulateNetworkConditions(networkConditions);
448
+ }
449
+ /**
450
+ * This setting will change the default maximum navigation time for the
451
+ * following methods and related shortcuts:
452
+ *
453
+ * - {@link Page.goBack | page.goBack(options)}
454
+ *
455
+ * - {@link Page.goForward | page.goForward(options)}
456
+ *
457
+ * - {@link Page.goto | page.goto(url,options)}
458
+ *
459
+ * - {@link Page.reload | page.reload(options)}
460
+ *
461
+ * - {@link Page.setContent | page.setContent(html,options)}
462
+ *
463
+ * - {@link Page.waitForNavigation | page.waitForNavigation(options)}
464
+ * @param timeout - Maximum navigation time in milliseconds.
465
+ */
466
+ setDefaultNavigationTimeout(timeout) {
467
+ this._timeoutSettings.setDefaultNavigationTimeout(timeout);
468
+ }
469
+ /**
470
+ * @param timeout - Maximum time in milliseconds.
471
+ */
472
+ setDefaultTimeout(timeout) {
473
+ this._timeoutSettings.setDefaultTimeout(timeout);
474
+ }
475
+ /**
476
+ * Runs `document.querySelector` within the page. If no element matches the
477
+ * selector, the return value resolves to `null`.
478
+ *
479
+ * @remarks
480
+ * Shortcut for {@link Frame.$ | Page.mainFrame().$(selector) }.
481
+ *
482
+ * @param selector - A `selector` to query page for
483
+ * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
484
+ * to query page for.
485
+ */
486
+ async $(selector) {
487
+ return this.mainFrame().$(selector);
488
+ }
489
+ /**
490
+ * @remarks
491
+ *
492
+ * The only difference between {@link Page.evaluate | page.evaluate} and
493
+ * `page.evaluateHandle` is that `evaluateHandle` will return the value
494
+ * wrapped in an in-page object.
495
+ *
496
+ * If the function passed to `page.evaluteHandle` returns a Promise, the
497
+ * function will wait for the promise to resolve and return its value.
498
+ *
499
+ * You can pass a string instead of a function (although functions are
500
+ * recommended as they are easier to debug and use with TypeScript):
501
+ *
502
+ * @example
503
+ * ```
504
+ * const aHandle = await page.evaluateHandle('document')
505
+ * ```
506
+ *
507
+ * @example
508
+ * {@link JSHandle} instances can be passed as arguments to the `pageFunction`:
509
+ * ```
510
+ * const aHandle = await page.evaluateHandle(() => document.body);
511
+ * const resultHandle = await page.evaluateHandle(body => body.innerHTML, aHandle);
512
+ * console.log(await resultHandle.jsonValue());
513
+ * await resultHandle.dispose();
514
+ * ```
515
+ *
516
+ * Most of the time this function returns a {@link JSHandle},
517
+ * but if `pageFunction` returns a reference to an element,
518
+ * you instead get an {@link ElementHandle} back:
519
+ *
520
+ * @example
521
+ * ```
522
+ * const button = await page.evaluateHandle(() => document.querySelector('button'));
523
+ * // can call `click` because `button` is an `ElementHandle`
524
+ * await button.click();
525
+ * ```
526
+ *
527
+ * The TypeScript definitions assume that `evaluateHandle` returns
528
+ * a `JSHandle`, but if you know it's going to return an
529
+ * `ElementHandle`, pass it as the generic argument:
530
+ *
531
+ * ```
532
+ * const button = await page.evaluateHandle<ElementHandle>(...);
533
+ * ```
534
+ *
535
+ * @param pageFunction - a function that is run within the page
536
+ * @param args - arguments to be passed to the pageFunction
537
+ */
538
+ async evaluateHandle(pageFunction, ...args) {
539
+ const context = await this.mainFrame().executionContext();
540
+ return context.evaluateHandle(pageFunction, ...args);
541
+ }
542
+ /**
543
+ * This method iterates the JavaScript heap and finds all objects with the
544
+ * given prototype.
545
+ *
546
+ * @remarks
547
+ * Shortcut for
548
+ * {@link ExecutionContext.queryObjects |
549
+ * page.mainFrame().executionContext().queryObjects(prototypeHandle)}.
550
+ *
551
+ * @example
552
+ *
553
+ * ```js
554
+ * // Create a Map object
555
+ * await page.evaluate(() => window.map = new Map());
556
+ * // Get a handle to the Map object prototype
557
+ * const mapPrototype = await page.evaluateHandle(() => Map.prototype);
558
+ * // Query all map instances into an array
559
+ * const mapInstances = await page.queryObjects(mapPrototype);
560
+ * // Count amount of map objects in heap
561
+ * const count = await page.evaluate(maps => maps.length, mapInstances);
562
+ * await mapInstances.dispose();
563
+ * await mapPrototype.dispose();
564
+ * ```
565
+ * @param prototypeHandle - a handle to the object prototype.
566
+ * @returns Promise which resolves to a handle to an array of objects with
567
+ * this prototype.
568
+ */
569
+ async queryObjects(prototypeHandle) {
570
+ const context = await this.mainFrame().executionContext();
571
+ return context.queryObjects(prototypeHandle);
572
+ }
573
+ /**
574
+ * This method runs `document.querySelector` within the page and passes the
575
+ * result as the first argument to the `pageFunction`.
576
+ *
577
+ * @remarks
578
+ *
579
+ * If no element is found matching `selector`, the method will throw an error.
580
+ *
581
+ * If `pageFunction` returns a promise `$eval` will wait for the promise to
582
+ * resolve and then return its value.
583
+ *
584
+ * @example
585
+ *
586
+ * ```
587
+ * const searchValue = await page.$eval('#search', el => el.value);
588
+ * const preloadHref = await page.$eval('link[rel=preload]', el => el.href);
589
+ * const html = await page.$eval('.main-container', el => el.outerHTML);
590
+ * ```
591
+ *
592
+ * If you are using TypeScript, you may have to provide an explicit type to the
593
+ * first argument of the `pageFunction`.
594
+ * By default it is typed as `Element`, but you may need to provide a more
595
+ * specific sub-type:
596
+ *
597
+ * @example
598
+ *
599
+ * ```
600
+ * // if you don't provide HTMLInputElement here, TS will error
601
+ * // as `value` is not on `Element`
602
+ * const searchValue = await page.$eval('#search', (el: HTMLInputElement) => el.value);
603
+ * ```
604
+ *
605
+ * The compiler should be able to infer the return type
606
+ * from the `pageFunction` you provide. If it is unable to, you can use the generic
607
+ * type to tell the compiler what return type you expect from `$eval`:
608
+ *
609
+ * @example
610
+ *
611
+ * ```
612
+ * // The compiler can infer the return type in this case, but if it can't
613
+ * // or if you want to be more explicit, provide it as the generic type.
614
+ * const searchValue = await page.$eval<string>(
615
+ * '#search', (el: HTMLInputElement) => el.value
616
+ * );
617
+ * ```
618
+ *
619
+ * @param selector - the
620
+ * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
621
+ * to query for
622
+ * @param pageFunction - the function to be evaluated in the page context.
623
+ * Will be passed the result of `document.querySelector(selector)` as its
624
+ * first argument.
625
+ * @param args - any additional arguments to pass through to `pageFunction`.
626
+ *
627
+ * @returns The result of calling `pageFunction`. If it returns an element it
628
+ * is wrapped in an {@link ElementHandle}, else the raw value itself is
629
+ * returned.
630
+ */
631
+ async $eval(selector, pageFunction, ...args) {
632
+ return this.mainFrame().$eval(selector, pageFunction, ...args);
633
+ }
634
+ /**
635
+ * This method runs `Array.from(document.querySelectorAll(selector))` within
636
+ * the page and passes the result as the first argument to the `pageFunction`.
637
+ *
638
+ * @remarks
639
+ *
640
+ * If `pageFunction` returns a promise `$$eval` will wait for the promise to
641
+ * resolve and then return its value.
642
+ *
643
+ * @example
644
+ *
645
+ * ```
646
+ * // get the amount of divs on the page
647
+ * const divCount = await page.$$eval('div', divs => divs.length);
648
+ *
649
+ * // get the text content of all the `.options` elements:
650
+ * const options = await page.$$eval('div > span.options', options => {
651
+ * return options.map(option => option.textContent)
652
+ * });
653
+ * ```
654
+ *
655
+ * If you are using TypeScript, you may have to provide an explicit type to the
656
+ * first argument of the `pageFunction`.
657
+ * By default it is typed as `Element[]`, but you may need to provide a more
658
+ * specific sub-type:
659
+ *
660
+ * @example
661
+ *
662
+ * ```
663
+ * // if you don't provide HTMLInputElement here, TS will error
664
+ * // as `value` is not on `Element`
665
+ * await page.$$eval('input', (elements: HTMLInputElement[]) => {
666
+ * return elements.map(e => e.value);
667
+ * });
668
+ * ```
669
+ *
670
+ * The compiler should be able to infer the return type
671
+ * from the `pageFunction` you provide. If it is unable to, you can use the generic
672
+ * type to tell the compiler what return type you expect from `$$eval`:
673
+ *
674
+ * @example
675
+ *
676
+ * ```
677
+ * // The compiler can infer the return type in this case, but if it can't
678
+ * // or if you want to be more explicit, provide it as the generic type.
679
+ * const allInputValues = await page.$$eval<string[]>(
680
+ * 'input', (elements: HTMLInputElement[]) => elements.map(e => e.textContent)
681
+ * );
682
+ * ```
683
+ *
684
+ * @param selector - the
685
+ * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
686
+ * to query for
687
+ * @param pageFunction - the function to be evaluated in the page context. Will
688
+ * be passed the result of `Array.from(document.querySelectorAll(selector))`
689
+ * as its first argument.
690
+ * @param args - any additional arguments to pass through to `pageFunction`.
691
+ *
692
+ * @returns The result of calling `pageFunction`. If it returns an element it
693
+ * is wrapped in an {@link ElementHandle}, else the raw value itself is
694
+ * returned.
695
+ */
696
+ async $$eval(selector, pageFunction, ...args) {
697
+ return this.mainFrame().$$eval(selector, pageFunction, ...args);
698
+ }
699
+ /**
700
+ * The method runs `document.querySelectorAll` within the page. If no elements
701
+ * match the selector, the return value resolves to `[]`.
702
+ * @remarks
703
+ * Shortcut for {@link Frame.$$ | Page.mainFrame().$$(selector) }.
704
+ * @param selector - A `selector` to query page for
705
+ */
706
+ async $$(selector) {
707
+ return this.mainFrame().$$(selector);
708
+ }
709
+ /**
710
+ * The method evaluates the XPath expression relative to the page document as
711
+ * its context node. If there are no such elements, the method resolves to an
712
+ * empty array.
713
+ * @remarks
714
+ * Shortcut for {@link Frame.$x | Page.mainFrame().$x(expression) }.
715
+ * @param expression - Expression to evaluate
716
+ */
717
+ async $x(expression) {
718
+ return this.mainFrame().$x(expression);
719
+ }
720
+ /**
721
+ * If no URLs are specified, this method returns cookies for the current page
722
+ * URL. If URLs are specified, only cookies for those URLs are returned.
723
+ */
724
+ async cookies(...urls) {
725
+ const originalCookies = (await this._client.send('Network.getCookies', {
726
+ urls: urls.length ? urls : [this.url()],
727
+ })).cookies;
728
+ const unsupportedCookieAttributes = ['priority'];
729
+ const filterUnsupportedAttributes = (cookie) => {
730
+ for (const attr of unsupportedCookieAttributes)
731
+ delete cookie[attr];
732
+ return cookie;
733
+ };
734
+ return originalCookies.map(filterUnsupportedAttributes);
735
+ }
736
+ async deleteCookie(...cookies) {
737
+ const pageURL = this.url();
738
+ for (const cookie of cookies) {
739
+ const item = Object.assign({}, cookie);
740
+ if (!cookie.url && pageURL.startsWith('http'))
741
+ item.url = pageURL;
742
+ await this._client.send('Network.deleteCookies', item);
743
+ }
744
+ }
745
+ /**
746
+ * @example
747
+ * ```js
748
+ * await page.setCookie(cookieObject1, cookieObject2);
749
+ * ```
750
+ */
751
+ async setCookie(...cookies) {
752
+ const pageURL = this.url();
753
+ const startsWithHTTP = pageURL.startsWith('http');
754
+ const items = cookies.map((cookie) => {
755
+ const item = Object.assign({}, cookie);
756
+ if (!item.url && startsWithHTTP)
757
+ item.url = pageURL;
758
+ assert_js_1.assert(item.url !== 'about:blank', `Blank page can not have cookie "${item.name}"`);
759
+ assert_js_1.assert(!String.prototype.startsWith.call(item.url || '', 'data:'), `Data URL page can not have cookie "${item.name}"`);
760
+ return item;
761
+ });
762
+ await this.deleteCookie(...items);
763
+ if (items.length)
764
+ await this._client.send('Network.setCookies', { cookies: items });
765
+ }
766
+ /**
767
+ * Adds a `<script>` tag into the page with the desired URL or content.
768
+ * @remarks
769
+ * Shortcut for {@link Frame.addScriptTag | page.mainFrame().addScriptTag(options) }.
770
+ * @returns Promise which resolves to the added tag when the script's onload fires or
771
+ * when the script content was injected into frame.
772
+ */
773
+ async addScriptTag(options) {
774
+ return this.mainFrame().addScriptTag(options);
775
+ }
776
+ /**
777
+ * Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
778
+ * `<style type="text/css">` tag with the content.
779
+ * @returns Promise which resolves to the added tag when the stylesheet's
780
+ * onload fires or when the CSS content was injected into frame.
781
+ */
782
+ async addStyleTag(options) {
783
+ return this.mainFrame().addStyleTag(options);
784
+ }
785
+ /**
786
+ * The method adds a function called `name` on the page's `window` object. When
787
+ * called, the function executes `puppeteerFunction` in node.js and returns a
788
+ * `Promise` which resolves to the return value of `puppeteerFunction`.
789
+ *
790
+ * If the puppeteerFunction returns a `Promise`, it will be awaited.
791
+ *
792
+ * NOTE: Functions installed via `page.exposeFunction` survive navigations.
793
+ * @param name - Name of the function on the window object
794
+ * @param puppeteerFunction - Callback function which will be called in
795
+ * Puppeteer's context.
796
+ * @example
797
+ * An example of adding an `md5` function into the page:
798
+ * ```js
799
+ * const puppeteer = require('puppeteer');
800
+ * const crypto = require('crypto');
801
+ *
802
+ * (async () => {
803
+ * const browser = await puppeteer.launch();
804
+ * const page = await browser.newPage();
805
+ * page.on('console', (msg) => console.log(msg.text()));
806
+ * await page.exposeFunction('md5', (text) =>
807
+ * crypto.createHash('md5').update(text).digest('hex')
808
+ * );
809
+ * await page.evaluate(async () => {
810
+ * // use window.md5 to compute hashes
811
+ * const myString = 'PUPPETEER';
812
+ * const myHash = await window.md5(myString);
813
+ * console.log(`md5 of ${myString} is ${myHash}`);
814
+ * });
815
+ * await browser.close();
816
+ * })();
817
+ * ```
818
+ * An example of adding a `window.readfile` function into the page:
819
+ * ```js
820
+ * const puppeteer = require('puppeteer');
821
+ * const fs = require('fs');
822
+ *
823
+ * (async () => {
824
+ * const browser = await puppeteer.launch();
825
+ * const page = await browser.newPage();
826
+ * page.on('console', (msg) => console.log(msg.text()));
827
+ * await page.exposeFunction('readfile', async (filePath) => {
828
+ * return new Promise((resolve, reject) => {
829
+ * fs.readFile(filePath, 'utf8', (err, text) => {
830
+ * if (err) reject(err);
831
+ * else resolve(text);
832
+ * });
833
+ * });
834
+ * });
835
+ * await page.evaluate(async () => {
836
+ * // use window.readfile to read contents of a file
837
+ * const content = await window.readfile('/etc/hosts');
838
+ * console.log(content);
839
+ * });
840
+ * await browser.close();
841
+ * })();
842
+ * ```
843
+ */
844
+ async exposeFunction(name, puppeteerFunction) {
845
+ if (this._pageBindings.has(name))
846
+ throw new Error(`Failed to add page binding with name ${name}: window['${name}'] already exists!`);
847
+ this._pageBindings.set(name, puppeteerFunction);
848
+ const expression = helper_js_1.helper.pageBindingInitString('exposedFun', name);
849
+ await this._client.send('Runtime.addBinding', { name: name });
850
+ await this._client.send('Page.addScriptToEvaluateOnNewDocument', {
851
+ source: expression,
852
+ });
853
+ await Promise.all(this.frames().map((frame) => frame.evaluate(expression).catch(helper_js_1.debugError)));
854
+ }
855
+ /**
856
+ * Provide credentials for `HTTP authentication`.
857
+ * @remarks To disable authentication, pass `null`.
858
+ */
859
+ async authenticate(credentials) {
860
+ return this._frameManager.networkManager().authenticate(credentials);
861
+ }
862
+ /**
863
+ * The extra HTTP headers will be sent with every request the page initiates.
864
+ * NOTE: All HTTP header names are lowercased. (HTTP headers are
865
+ * case-insensitive, so this shouldn’t impact your server code.)
866
+ * NOTE: page.setExtraHTTPHeaders does not guarantee the order of headers in
867
+ * the outgoing requests.
868
+ * @param headers - An object containing additional HTTP headers to be sent
869
+ * with every request. All header values must be strings.
870
+ * @returns
871
+ */
872
+ async setExtraHTTPHeaders(headers) {
873
+ return this._frameManager.networkManager().setExtraHTTPHeaders(headers);
874
+ }
875
+ /**
876
+ * @param userAgent - Specific user agent to use in this page
877
+ * @param userAgentData - Specific user agent client hint data to use in this
878
+ * page
879
+ * @returns Promise which resolves when the user agent is set.
880
+ */
881
+ async setUserAgent(userAgent, userAgentMetadata) {
882
+ return this._frameManager
883
+ .networkManager()
884
+ .setUserAgent(userAgent, userAgentMetadata);
885
+ }
886
+ /**
887
+ * @returns Object containing metrics as key/value pairs.
888
+ *
889
+ * - `Timestamp` : The timestamp when the metrics sample was taken.
890
+ *
891
+ * - `Documents` : Number of documents in the page.
892
+ *
893
+ * - `Frames` : Number of frames in the page.
894
+ *
895
+ * - `JSEventListeners` : Number of events in the page.
896
+ *
897
+ * - `Nodes` : Number of DOM nodes in the page.
898
+ *
899
+ * - `LayoutCount` : Total number of full or partial page layout.
900
+ *
901
+ * - `RecalcStyleCount` : Total number of page style recalculations.
902
+ *
903
+ * - `LayoutDuration` : Combined durations of all page layouts.
904
+ *
905
+ * - `RecalcStyleDuration` : Combined duration of all page style
906
+ * recalculations.
907
+ *
908
+ * - `ScriptDuration` : Combined duration of JavaScript execution.
909
+ *
910
+ * - `TaskDuration` : Combined duration of all tasks performed by the browser.
911
+ *
912
+ *
913
+ * - `JSHeapUsedSize` : Used JavaScript heap size.
914
+ *
915
+ * - `JSHeapTotalSize` : Total JavaScript heap size.
916
+ * @remarks
917
+ * NOTE: All timestamps are in monotonic time: monotonically increasing time
918
+ * in seconds since an arbitrary point in the past.
919
+ */
920
+ async metrics() {
921
+ const response = await this._client.send('Performance.getMetrics');
922
+ return this._buildMetricsObject(response.metrics);
923
+ }
924
+ _emitMetrics(event) {
925
+ this.emit("metrics" /* Metrics */, {
926
+ title: event.title,
927
+ metrics: this._buildMetricsObject(event.metrics),
928
+ });
929
+ }
930
+ _buildMetricsObject(metrics) {
931
+ const result = {};
932
+ for (const metric of metrics || []) {
933
+ if (supportedMetrics.has(metric.name))
934
+ result[metric.name] = metric.value;
935
+ }
936
+ return result;
937
+ }
938
+ _handleException(exceptionDetails) {
939
+ const message = helper_js_1.helper.getExceptionMessage(exceptionDetails);
940
+ const err = new Error(message);
941
+ err.stack = ''; // Don't report clientside error with a node stack attached
942
+ this.emit("pageerror" /* PageError */, err);
943
+ }
944
+ async _onConsoleAPI(event) {
945
+ if (event.executionContextId === 0) {
946
+ // DevTools protocol stores the last 1000 console messages. These
947
+ // messages are always reported even for removed execution contexts. In
948
+ // this case, they are marked with executionContextId = 0 and are
949
+ // reported upon enabling Runtime agent.
950
+ //
951
+ // Ignore these messages since:
952
+ // - there's no execution context we can use to operate with message
953
+ // arguments
954
+ // - these messages are reported before Puppeteer clients can subscribe
955
+ // to the 'console'
956
+ // page event.
957
+ //
958
+ // @see https://github.com/puppeteer/puppeteer/issues/3865
959
+ return;
960
+ }
961
+ const context = this._frameManager.executionContextById(event.executionContextId);
962
+ const values = event.args.map((arg) => JSHandle_js_1.createJSHandle(context, arg));
963
+ this._addConsoleMessage(event.type, values, event.stackTrace);
964
+ }
965
+ async _onBindingCalled(event) {
966
+ let payload;
967
+ try {
968
+ payload = JSON.parse(event.payload);
969
+ }
970
+ catch {
971
+ // The binding was either called by something in the page or it was
972
+ // called before our wrapper was initialized.
973
+ return;
974
+ }
975
+ const { type, name, seq, args } = payload;
976
+ if (type !== 'exposedFun' || !this._pageBindings.has(name))
977
+ return;
978
+ let expression = null;
979
+ try {
980
+ const result = await this._pageBindings.get(name)(...args);
981
+ expression = helper_js_1.helper.pageBindingDeliverResultString(name, seq, result);
982
+ }
983
+ catch (error) {
984
+ if (error instanceof Error)
985
+ expression = helper_js_1.helper.pageBindingDeliverErrorString(name, seq, error.message, error.stack);
986
+ else
987
+ expression = helper_js_1.helper.pageBindingDeliverErrorValueString(name, seq, error);
988
+ }
989
+ this._client
990
+ .send('Runtime.evaluate', {
991
+ expression,
992
+ contextId: event.executionContextId,
993
+ })
994
+ .catch(helper_js_1.debugError);
995
+ }
996
+ _addConsoleMessage(type, args, stackTrace) {
997
+ if (!this.listenerCount("console" /* Console */)) {
998
+ args.forEach((arg) => arg.dispose());
999
+ return;
1000
+ }
1001
+ const textTokens = [];
1002
+ for (const arg of args) {
1003
+ const remoteObject = arg._remoteObject;
1004
+ if (remoteObject.objectId)
1005
+ textTokens.push(arg.toString());
1006
+ else
1007
+ textTokens.push(helper_js_1.helper.valueFromRemoteObject(remoteObject));
1008
+ }
1009
+ const stackTraceLocations = [];
1010
+ if (stackTrace) {
1011
+ for (const callFrame of stackTrace.callFrames) {
1012
+ stackTraceLocations.push({
1013
+ url: callFrame.url,
1014
+ lineNumber: callFrame.lineNumber,
1015
+ columnNumber: callFrame.columnNumber,
1016
+ });
1017
+ }
1018
+ }
1019
+ const message = new ConsoleMessage_js_1.ConsoleMessage(type, textTokens.join(' '), args, stackTraceLocations);
1020
+ this.emit("console" /* Console */, message);
1021
+ }
1022
+ _onDialog(event) {
1023
+ let dialogType = null;
1024
+ const validDialogTypes = new Set([
1025
+ 'alert',
1026
+ 'confirm',
1027
+ 'prompt',
1028
+ 'beforeunload',
1029
+ ]);
1030
+ if (validDialogTypes.has(event.type)) {
1031
+ dialogType = event.type;
1032
+ }
1033
+ assert_js_1.assert(dialogType, 'Unknown javascript dialog type: ' + event.type);
1034
+ const dialog = new Dialog_js_1.Dialog(this._client, dialogType, event.message, event.defaultPrompt);
1035
+ this.emit("dialog" /* Dialog */, dialog);
1036
+ }
1037
+ /**
1038
+ * Resets default white background
1039
+ */
1040
+ async _resetDefaultBackgroundColor() {
1041
+ await this._client.send('Emulation.setDefaultBackgroundColorOverride');
1042
+ }
1043
+ /**
1044
+ * Hides default white background
1045
+ */
1046
+ async _setTransparentBackgroundColor() {
1047
+ await this._client.send('Emulation.setDefaultBackgroundColorOverride', {
1048
+ color: { r: 0, g: 0, b: 0, a: 0 },
1049
+ });
1050
+ }
1051
+ /**
1052
+ *
1053
+ * @returns
1054
+ * @remarks Shortcut for
1055
+ * {@link Frame.url | page.mainFrame().url()}.
1056
+ */
1057
+ url() {
1058
+ return this.mainFrame().url();
1059
+ }
1060
+ async content() {
1061
+ return await this._frameManager.mainFrame().content();
1062
+ }
1063
+ /**
1064
+ * @param html - HTML markup to assign to the page.
1065
+ * @param options - Parameters that has some properties.
1066
+ * @remarks
1067
+ * The parameter `options` might have the following options.
1068
+ *
1069
+ * - `timeout` : Maximum time in milliseconds for resources to load, defaults
1070
+ * to 30 seconds, pass `0` to disable timeout. The default value can be
1071
+ * changed by using the
1072
+ * {@link Page.setDefaultNavigationTimeout |
1073
+ * page.setDefaultNavigationTimeout(timeout)}
1074
+ * or {@link Page.setDefaultTimeout | page.setDefaultTimeout(timeout)}
1075
+ * methods.
1076
+ *
1077
+ * - `waitUntil`: When to consider setting markup succeeded, defaults to `load`.
1078
+ * Given an array of event strings, setting content is considered to be
1079
+ * successful after all events have been fired. Events can be either:<br/>
1080
+ * - `load` : consider setting content to be finished when the `load` event is
1081
+ * fired.<br/>
1082
+ * - `domcontentloaded` : consider setting content to be finished when the
1083
+ * `DOMContentLoaded` event is fired.<br/>
1084
+ * - `networkidle0` : consider setting content to be finished when there are no
1085
+ * more than 0 network connections for at least `500` ms.<br/>
1086
+ * - `networkidle2` : consider setting content to be finished when there are no
1087
+ * more than 2 network connections for at least `500` ms.
1088
+ */
1089
+ async setContent(html, options = {}) {
1090
+ await this._frameManager.mainFrame().setContent(html, options);
1091
+ }
1092
+ /**
1093
+ * @param url - URL to navigate page to. The URL should include scheme, e.g.
1094
+ * `https://`
1095
+ * @param options - Navigation Parameter
1096
+ * @returns Promise which resolves to the main resource response. In case of
1097
+ * multiple redirects, the navigation will resolve with the response of the
1098
+ * last redirect.
1099
+ * @remarks
1100
+ * The argument `options` might have the following properties:
1101
+ *
1102
+ * - `timeout` : Maximum navigation time in milliseconds, defaults to 30
1103
+ * seconds, pass 0 to disable timeout. The default value can be changed by
1104
+ * using the
1105
+ * {@link Page.setDefaultNavigationTimeout |
1106
+ * page.setDefaultNavigationTimeout(timeout)}
1107
+ * or {@link Page.setDefaultTimeout | page.setDefaultTimeout(timeout)}
1108
+ * methods.
1109
+ *
1110
+ * - `waitUntil`:When to consider navigation succeeded, defaults to `load`.
1111
+ * Given an array of event strings, navigation is considered to be successful
1112
+ * after all events have been fired. Events can be either:<br/>
1113
+ * - `load` : consider navigation to be finished when the load event is
1114
+ * fired.<br/>
1115
+ * - `domcontentloaded` : consider navigation to be finished when the
1116
+ * DOMContentLoaded event is fired.<br/>
1117
+ * - `networkidle0` : consider navigation to be finished when there are no
1118
+ * more than 0 network connections for at least `500` ms.<br/>
1119
+ * - `networkidle2` : consider navigation to be finished when there are no
1120
+ * more than 2 network connections for at least `500` ms.
1121
+ *
1122
+ * - `referer` : Referer header value. If provided it will take preference
1123
+ * over the referer header value set by
1124
+ * {@link Page.setExtraHTTPHeaders |page.setExtraHTTPHeaders()}.
1125
+ *
1126
+ * `page.goto` will throw an error if:
1127
+ * - there's an SSL error (e.g. in case of self-signed certificates).
1128
+ * - target URL is invalid.
1129
+ * - the timeout is exceeded during navigation.
1130
+ * - the remote server does not respond or is unreachable.
1131
+ * - the main resource failed to load.
1132
+ *
1133
+ * `page.goto` will not throw an error when any valid HTTP status code is
1134
+ * returned by the remote server, including 404 "Not Found" and 500
1135
+ * "Internal Server Error". The status code for such responses can be
1136
+ * retrieved by calling response.status().
1137
+ *
1138
+ * NOTE: `page.goto` either throws an error or returns a main resource
1139
+ * response. The only exceptions are navigation to about:blank or navigation
1140
+ * to the same URL with a different hash, which would succeed and return null.
1141
+ *
1142
+ * NOTE: Headless mode doesn't support navigation to a PDF document. See the
1143
+ * {@link https://bugs.chromium.org/p/chromium/issues/detail?id=761295
1144
+ * | upstream issue}.
1145
+ *
1146
+ * Shortcut for {@link Frame.goto | page.mainFrame().goto(url, options)}.
1147
+ */
1148
+ async goto(url, options = {}) {
1149
+ return await this._frameManager.mainFrame().goto(url, options);
1150
+ }
1151
+ /**
1152
+ * @param options - Navigation parameters which might have the following
1153
+ * properties:
1154
+ * @returns Promise which resolves to the main resource response. In case of
1155
+ * multiple redirects, the navigation will resolve with the response of the
1156
+ * last redirect.
1157
+ * @remarks
1158
+ * The argument `options` might have the following properties:
1159
+ *
1160
+ * - `timeout` : Maximum navigation time in milliseconds, defaults to 30
1161
+ * seconds, pass 0 to disable timeout. The default value can be changed by
1162
+ * using the
1163
+ * {@link Page.setDefaultNavigationTimeout |
1164
+ * page.setDefaultNavigationTimeout(timeout)}
1165
+ * or {@link Page.setDefaultTimeout | page.setDefaultTimeout(timeout)}
1166
+ * methods.
1167
+ *
1168
+ * - `waitUntil`: When to consider navigation succeeded, defaults to `load`.
1169
+ * Given an array of event strings, navigation is considered to be
1170
+ * successful after all events have been fired. Events can be either:<br/>
1171
+ * - `load` : consider navigation to be finished when the load event is fired.<br/>
1172
+ * - `domcontentloaded` : consider navigation to be finished when the
1173
+ * DOMContentLoaded event is fired.<br/>
1174
+ * - `networkidle0` : consider navigation to be finished when there are no
1175
+ * more than 0 network connections for at least `500` ms.<br/>
1176
+ * - `networkidle2` : consider navigation to be finished when there are no
1177
+ * more than 2 network connections for at least `500` ms.
1178
+ */
1179
+ async reload(options) {
1180
+ const result = await Promise.all([
1181
+ this.waitForNavigation(options),
1182
+ this._client.send('Page.reload'),
1183
+ ]);
1184
+ return result[0];
1185
+ }
1186
+ /**
1187
+ * This resolves when the page navigates to a new URL or reloads. It is useful
1188
+ * when you run code that will indirectly cause the page to navigate. Consider
1189
+ * this example:
1190
+ * ```js
1191
+ * const [response] = await Promise.all([
1192
+ * page.waitForNavigation(), // The promise resolves after navigation has finished
1193
+ * page.click('a.my-link'), // Clicking the link will indirectly cause a navigation
1194
+ * ]);
1195
+ * ```
1196
+ *
1197
+ * @param options - Navigation parameters which might have the following properties:
1198
+ * @returns Promise which resolves to the main resource response. In case of
1199
+ * multiple redirects, the navigation will resolve with the response of the
1200
+ * last redirect. In case of navigation to a different anchor or navigation
1201
+ * due to History API usage, the navigation will resolve with `null`.
1202
+ * @remarks
1203
+ * NOTE: Usage of the
1204
+ * {@link https://developer.mozilla.org/en-US/docs/Web/API/History_API | History API}
1205
+ * to change the URL is considered a navigation.
1206
+ *
1207
+ * Shortcut for
1208
+ * {@link Frame.waitForNavigation | page.mainFrame().waitForNavigation(options)}.
1209
+ */
1210
+ async waitForNavigation(options = {}) {
1211
+ return await this._frameManager.mainFrame().waitForNavigation(options);
1212
+ }
1213
+ _sessionClosePromise() {
1214
+ if (!this._disconnectPromise)
1215
+ this._disconnectPromise = new Promise((fulfill) => this._client.once(Connection_js_1.CDPSessionEmittedEvents.Disconnected, () => fulfill(new Error('Target closed'))));
1216
+ return this._disconnectPromise;
1217
+ }
1218
+ /**
1219
+ * @param urlOrPredicate - A URL or predicate to wait for
1220
+ * @param options - Optional waiting parameters
1221
+ * @returns Promise which resolves to the matched response
1222
+ * @example
1223
+ * ```js
1224
+ * const firstResponse = await page.waitForResponse(
1225
+ * 'https://example.com/resource'
1226
+ * );
1227
+ * const finalResponse = await page.waitForResponse(
1228
+ * (response) =>
1229
+ * response.url() === 'https://example.com' && response.status() === 200
1230
+ * );
1231
+ * const finalResponse = await page.waitForResponse(async (response) => {
1232
+ * return (await response.text()).includes('<html>');
1233
+ * });
1234
+ * return finalResponse.ok();
1235
+ * ```
1236
+ * @remarks
1237
+ * Optional Waiting Parameters have:
1238
+ *
1239
+ * - `timeout`: Maximum wait time in milliseconds, defaults to `30` seconds, pass
1240
+ * `0` to disable the timeout. The default value can be changed by using the
1241
+ * {@link Page.setDefaultTimeout} method.
1242
+ */
1243
+ async waitForRequest(urlOrPredicate, options = {}) {
1244
+ const { timeout = this._timeoutSettings.timeout() } = options;
1245
+ return helper_js_1.helper.waitForEvent(this._frameManager.networkManager(), NetworkManager_js_1.NetworkManagerEmittedEvents.Request, (request) => {
1246
+ if (helper_js_1.helper.isString(urlOrPredicate))
1247
+ return urlOrPredicate === request.url();
1248
+ if (typeof urlOrPredicate === 'function')
1249
+ return !!urlOrPredicate(request);
1250
+ return false;
1251
+ }, timeout, this._sessionClosePromise());
1252
+ }
1253
+ /**
1254
+ * @param urlOrPredicate - A URL or predicate to wait for.
1255
+ * @param options - Optional waiting parameters
1256
+ * @returns Promise which resolves to the matched response.
1257
+ * @example
1258
+ * ```js
1259
+ * const firstResponse = await page.waitForResponse(
1260
+ * 'https://example.com/resource'
1261
+ * );
1262
+ * const finalResponse = await page.waitForResponse(
1263
+ * (response) =>
1264
+ * response.url() === 'https://example.com' && response.status() === 200
1265
+ * );
1266
+ * const finalResponse = await page.waitForResponse(async (response) => {
1267
+ * return (await response.text()).includes('<html>');
1268
+ * });
1269
+ * return finalResponse.ok();
1270
+ * ```
1271
+ * @remarks
1272
+ * Optional Parameter have:
1273
+ *
1274
+ * - `timeout`: Maximum wait time in milliseconds, defaults to `30` seconds,
1275
+ * pass `0` to disable the timeout. The default value can be changed by using
1276
+ * the {@link Page.setDefaultTimeout} method.
1277
+ */
1278
+ async waitForResponse(urlOrPredicate, options = {}) {
1279
+ const { timeout = this._timeoutSettings.timeout() } = options;
1280
+ return helper_js_1.helper.waitForEvent(this._frameManager.networkManager(), NetworkManager_js_1.NetworkManagerEmittedEvents.Response, async (response) => {
1281
+ if (helper_js_1.helper.isString(urlOrPredicate))
1282
+ return urlOrPredicate === response.url();
1283
+ if (typeof urlOrPredicate === 'function')
1284
+ return !!(await urlOrPredicate(response));
1285
+ return false;
1286
+ }, timeout, this._sessionClosePromise());
1287
+ }
1288
+ /**
1289
+ * This method navigate to the previous page in history.
1290
+ * @param options - Navigation parameters
1291
+ * @returns Promise which resolves to the main resource response. In case of
1292
+ * multiple redirects, the navigation will resolve with the response of the
1293
+ * last redirect. If can not go back, resolves to `null`.
1294
+ * @remarks
1295
+ * The argument `options` might have the following properties:
1296
+ *
1297
+ * - `timeout` : Maximum navigation time in milliseconds, defaults to 30
1298
+ * seconds, pass 0 to disable timeout. The default value can be changed by
1299
+ * using the
1300
+ * {@link Page.setDefaultNavigationTimeout
1301
+ * | page.setDefaultNavigationTimeout(timeout)}
1302
+ * or {@link Page.setDefaultTimeout | page.setDefaultTimeout(timeout)}
1303
+ * methods.
1304
+ *
1305
+ * - `waitUntil` : When to consider navigation succeeded, defaults to `load`.
1306
+ * Given an array of event strings, navigation is considered to be
1307
+ * successful after all events have been fired. Events can be either:<br/>
1308
+ * - `load` : consider navigation to be finished when the load event is fired.<br/>
1309
+ * - `domcontentloaded` : consider navigation to be finished when the
1310
+ * DOMContentLoaded event is fired.<br/>
1311
+ * - `networkidle0` : consider navigation to be finished when there are no
1312
+ * more than 0 network connections for at least `500` ms.<br/>
1313
+ * - `networkidle2` : consider navigation to be finished when there are no
1314
+ * more than 2 network connections for at least `500` ms.
1315
+ */
1316
+ async goBack(options = {}) {
1317
+ return this._go(-1, options);
1318
+ }
1319
+ /**
1320
+ * This method navigate to the next page in history.
1321
+ * @param options - Navigation Parameter
1322
+ * @returns Promise which resolves to the main resource response. In case of
1323
+ * multiple redirects, the navigation will resolve with the response of the
1324
+ * last redirect. If can not go forward, resolves to `null`.
1325
+ * @remarks
1326
+ * The argument `options` might have the following properties:
1327
+ *
1328
+ * - `timeout` : Maximum navigation time in milliseconds, defaults to 30
1329
+ * seconds, pass 0 to disable timeout. The default value can be changed by
1330
+ * using the
1331
+ * {@link Page.setDefaultNavigationTimeout
1332
+ * | page.setDefaultNavigationTimeout(timeout)}
1333
+ * or {@link Page.setDefaultTimeout | page.setDefaultTimeout(timeout)}
1334
+ * methods.
1335
+ *
1336
+ * - `waitUntil`: When to consider navigation succeeded, defaults to `load`.
1337
+ * Given an array of event strings, navigation is considered to be
1338
+ * successful after all events have been fired. Events can be either:<br/>
1339
+ * - `load` : consider navigation to be finished when the load event is fired.<br/>
1340
+ * - `domcontentloaded` : consider navigation to be finished when the
1341
+ * DOMContentLoaded event is fired.<br/>
1342
+ * - `networkidle0` : consider navigation to be finished when there are no
1343
+ * more than 0 network connections for at least `500` ms.<br/>
1344
+ * - `networkidle2` : consider navigation to be finished when there are no
1345
+ * more than 2 network connections for at least `500` ms.
1346
+ */
1347
+ async goForward(options = {}) {
1348
+ return this._go(+1, options);
1349
+ }
1350
+ async _go(delta, options) {
1351
+ const history = await this._client.send('Page.getNavigationHistory');
1352
+ const entry = history.entries[history.currentIndex + delta];
1353
+ if (!entry)
1354
+ return null;
1355
+ const result = await Promise.all([
1356
+ this.waitForNavigation(options),
1357
+ this._client.send('Page.navigateToHistoryEntry', { entryId: entry.id }),
1358
+ ]);
1359
+ return result[0];
1360
+ }
1361
+ /**
1362
+ * Brings page to front (activates tab).
1363
+ */
1364
+ async bringToFront() {
1365
+ await this._client.send('Page.bringToFront');
1366
+ }
1367
+ /**
1368
+ * Emulates given device metrics and user agent. This method is a shortcut for
1369
+ * calling two methods: {@link Page.setUserAgent} and {@link Page.setViewport}
1370
+ * To aid emulation, Puppeteer provides a list of device descriptors that can
1371
+ * be obtained via the {@link Puppeteer.devices} `page.emulate` will resize
1372
+ * the page. A lot of websites don't expect phones to change size, so you
1373
+ * should emulate before navigating to the page.
1374
+ * @example
1375
+ * ```js
1376
+ * const puppeteer = require('puppeteer');
1377
+ * const iPhone = puppeteer.devices['iPhone 6'];
1378
+ * (async () => {
1379
+ * const browser = await puppeteer.launch();
1380
+ * const page = await browser.newPage();
1381
+ * await page.emulate(iPhone);
1382
+ * await page.goto('https://www.google.com');
1383
+ * // other actions...
1384
+ * await browser.close();
1385
+ * })();
1386
+ * ```
1387
+ * @remarks List of all available devices is available in the source code:
1388
+ * {@link https://github.com/puppeteer/puppeteer/blob/main/src/common/DeviceDescriptors.ts | src/common/DeviceDescriptors.ts}.
1389
+ */
1390
+ async emulate(options) {
1391
+ await Promise.all([
1392
+ this.setViewport(options.viewport),
1393
+ this.setUserAgent(options.userAgent),
1394
+ ]);
1395
+ }
1396
+ /**
1397
+ * @param enabled - Whether or not to enable JavaScript on the page.
1398
+ * @returns
1399
+ * @remarks
1400
+ * NOTE: changing this value won't affect scripts that have already been run.
1401
+ * It will take full effect on the next navigation.
1402
+ */
1403
+ async setJavaScriptEnabled(enabled) {
1404
+ if (this._javascriptEnabled === enabled)
1405
+ return;
1406
+ this._javascriptEnabled = enabled;
1407
+ await this._client.send('Emulation.setScriptExecutionDisabled', {
1408
+ value: !enabled,
1409
+ });
1410
+ }
1411
+ /**
1412
+ * Toggles bypassing page's Content-Security-Policy.
1413
+ * @param enabled - sets bypassing of page's Content-Security-Policy.
1414
+ * @remarks
1415
+ * NOTE: CSP bypassing happens at the moment of CSP initialization rather than
1416
+ * evaluation. Usually, this means that `page.setBypassCSP` should be called
1417
+ * before navigating to the domain.
1418
+ */
1419
+ async setBypassCSP(enabled) {
1420
+ await this._client.send('Page.setBypassCSP', { enabled });
1421
+ }
1422
+ /**
1423
+ * @param type - Changes the CSS media type of the page. The only allowed
1424
+ * values are `screen`, `print` and `null`. Passing `null` disables CSS media
1425
+ * emulation.
1426
+ * @example
1427
+ * ```
1428
+ * await page.evaluate(() => matchMedia('screen').matches);
1429
+ * // → true
1430
+ * await page.evaluate(() => matchMedia('print').matches);
1431
+ * // → false
1432
+ *
1433
+ * await page.emulateMediaType('print');
1434
+ * await page.evaluate(() => matchMedia('screen').matches);
1435
+ * // → false
1436
+ * await page.evaluate(() => matchMedia('print').matches);
1437
+ * // → true
1438
+ *
1439
+ * await page.emulateMediaType(null);
1440
+ * await page.evaluate(() => matchMedia('screen').matches);
1441
+ * // → true
1442
+ * await page.evaluate(() => matchMedia('print').matches);
1443
+ * // → false
1444
+ * ```
1445
+ */
1446
+ async emulateMediaType(type) {
1447
+ assert_js_1.assert(type === 'screen' || type === 'print' || type === null, 'Unsupported media type: ' + type);
1448
+ await this._client.send('Emulation.setEmulatedMedia', {
1449
+ media: type || '',
1450
+ });
1451
+ }
1452
+ async emulateCPUThrottling(factor) {
1453
+ assert_js_1.assert(factor === null || factor >= 1, 'Throttling rate should be greater or equal to 1');
1454
+ await this._client.send('Emulation.setCPUThrottlingRate', {
1455
+ rate: factor !== null ? factor : 1,
1456
+ });
1457
+ }
1458
+ /**
1459
+ * @param features - `<?Array<Object>>` Given an array of media feature
1460
+ * objects, emulates CSS media features on the page. Each media feature object
1461
+ * must have the following properties:
1462
+ * @example
1463
+ * ```js
1464
+ * await page.emulateMediaFeatures([
1465
+ * { name: 'prefers-color-scheme', value: 'dark' },
1466
+ * ]);
1467
+ * await page.evaluate(() => matchMedia('(prefers-color-scheme: dark)').matches);
1468
+ * // → true
1469
+ * await page.evaluate(() => matchMedia('(prefers-color-scheme: light)').matches);
1470
+ * // → false
1471
+ *
1472
+ * await page.emulateMediaFeatures([
1473
+ * { name: 'prefers-reduced-motion', value: 'reduce' },
1474
+ * ]);
1475
+ * await page.evaluate(
1476
+ * () => matchMedia('(prefers-reduced-motion: reduce)').matches
1477
+ * );
1478
+ * // → true
1479
+ * await page.evaluate(
1480
+ * () => matchMedia('(prefers-reduced-motion: no-preference)').matches
1481
+ * );
1482
+ * // → false
1483
+ *
1484
+ * await page.emulateMediaFeatures([
1485
+ * { name: 'prefers-color-scheme', value: 'dark' },
1486
+ * { name: 'prefers-reduced-motion', value: 'reduce' },
1487
+ * ]);
1488
+ * await page.evaluate(() => matchMedia('(prefers-color-scheme: dark)').matches);
1489
+ * // → true
1490
+ * await page.evaluate(() => matchMedia('(prefers-color-scheme: light)').matches);
1491
+ * // → false
1492
+ * await page.evaluate(
1493
+ * () => matchMedia('(prefers-reduced-motion: reduce)').matches
1494
+ * );
1495
+ * // → true
1496
+ * await page.evaluate(
1497
+ * () => matchMedia('(prefers-reduced-motion: no-preference)').matches
1498
+ * );
1499
+ * // → false
1500
+ *
1501
+ * await page.emulateMediaFeatures([{ name: 'color-gamut', value: 'p3' }]);
1502
+ * await page.evaluate(() => matchMedia('(color-gamut: srgb)').matches);
1503
+ * // → true
1504
+ * await page.evaluate(() => matchMedia('(color-gamut: p3)').matches);
1505
+ * // → true
1506
+ * await page.evaluate(() => matchMedia('(color-gamut: rec2020)').matches);
1507
+ * // → false
1508
+ * ```
1509
+ */
1510
+ async emulateMediaFeatures(features) {
1511
+ if (features === null)
1512
+ await this._client.send('Emulation.setEmulatedMedia', { features: null });
1513
+ if (Array.isArray(features)) {
1514
+ features.every((mediaFeature) => {
1515
+ const name = mediaFeature.name;
1516
+ assert_js_1.assert(/^(?:prefers-(?:color-scheme|reduced-motion)|color-gamut)$/.test(name), 'Unsupported media feature: ' + name);
1517
+ return true;
1518
+ });
1519
+ await this._client.send('Emulation.setEmulatedMedia', {
1520
+ features: features,
1521
+ });
1522
+ }
1523
+ }
1524
+ /**
1525
+ * @param timezoneId - Changes the timezone of the page. See
1526
+ * {@link https://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt | ICU’s metaZones.txt}
1527
+ * for a list of supported timezone IDs. Passing
1528
+ * `null` disables timezone emulation.
1529
+ */
1530
+ async emulateTimezone(timezoneId) {
1531
+ try {
1532
+ await this._client.send('Emulation.setTimezoneOverride', {
1533
+ timezoneId: timezoneId || '',
1534
+ });
1535
+ }
1536
+ catch (error) {
1537
+ if (error.message.includes('Invalid timezone'))
1538
+ throw new Error(`Invalid timezone ID: ${timezoneId}`);
1539
+ throw error;
1540
+ }
1541
+ }
1542
+ /**
1543
+ * Emulates the idle state.
1544
+ * If no arguments set, clears idle state emulation.
1545
+ *
1546
+ * @example
1547
+ * ```js
1548
+ * // set idle emulation
1549
+ * await page.emulateIdleState({isUserActive: true, isScreenUnlocked: false});
1550
+ *
1551
+ * // do some checks here
1552
+ * ...
1553
+ *
1554
+ * // clear idle emulation
1555
+ * await page.emulateIdleState();
1556
+ * ```
1557
+ *
1558
+ * @param overrides - Mock idle state. If not set, clears idle overrides
1559
+ */
1560
+ async emulateIdleState(overrides) {
1561
+ if (overrides) {
1562
+ await this._client.send('Emulation.setIdleOverride', {
1563
+ isUserActive: overrides.isUserActive,
1564
+ isScreenUnlocked: overrides.isScreenUnlocked,
1565
+ });
1566
+ }
1567
+ else {
1568
+ await this._client.send('Emulation.clearIdleOverride');
1569
+ }
1570
+ }
1571
+ /**
1572
+ * Simulates the given vision deficiency on the page.
1573
+ *
1574
+ * @example
1575
+ * ```js
1576
+ * const puppeteer = require('puppeteer');
1577
+ *
1578
+ * (async () => {
1579
+ * const browser = await puppeteer.launch();
1580
+ * const page = await browser.newPage();
1581
+ * await page.goto('https://v8.dev/blog/10-years');
1582
+ *
1583
+ * await page.emulateVisionDeficiency('achromatopsia');
1584
+ * await page.screenshot({ path: 'achromatopsia.png' });
1585
+ *
1586
+ * await page.emulateVisionDeficiency('deuteranopia');
1587
+ * await page.screenshot({ path: 'deuteranopia.png' });
1588
+ *
1589
+ * await page.emulateVisionDeficiency('blurredVision');
1590
+ * await page.screenshot({ path: 'blurred-vision.png' });
1591
+ *
1592
+ * await browser.close();
1593
+ * })();
1594
+ * ```
1595
+ *
1596
+ * @param type - the type of deficiency to simulate, or `'none'` to reset.
1597
+ */
1598
+ async emulateVisionDeficiency(type) {
1599
+ const visionDeficiencies = new Set([
1600
+ 'none',
1601
+ 'achromatopsia',
1602
+ 'blurredVision',
1603
+ 'deuteranopia',
1604
+ 'protanopia',
1605
+ 'tritanopia',
1606
+ ]);
1607
+ try {
1608
+ assert_js_1.assert(!type || visionDeficiencies.has(type), `Unsupported vision deficiency: ${type}`);
1609
+ await this._client.send('Emulation.setEmulatedVisionDeficiency', {
1610
+ type: type || 'none',
1611
+ });
1612
+ }
1613
+ catch (error) {
1614
+ throw error;
1615
+ }
1616
+ }
1617
+ /**
1618
+ * `page.setViewport` will resize the page. A lot of websites don't expect
1619
+ * phones to change size, so you should set the viewport before navigating to
1620
+ * the page.
1621
+ *
1622
+ * In the case of multiple pages in a single browser, each page can have its
1623
+ * own viewport size.
1624
+ * @example
1625
+ * ```js
1626
+ * const page = await browser.newPage();
1627
+ * await page.setViewport({
1628
+ * width: 640,
1629
+ * height: 480,
1630
+ * deviceScaleFactor: 1,
1631
+ * });
1632
+ * await page.goto('https://example.com');
1633
+ * ```
1634
+ *
1635
+ * @param viewport -
1636
+ * @remarks
1637
+ * Argument viewport have following properties:
1638
+ *
1639
+ * - `width`: page width in pixels. required
1640
+ *
1641
+ * - `height`: page height in pixels. required
1642
+ *
1643
+ * - `deviceScaleFactor`: Specify device scale factor (can be thought of as
1644
+ * DPR). Defaults to `1`.
1645
+ *
1646
+ * - `isMobile`: Whether the meta viewport tag is taken into account. Defaults
1647
+ * to `false`.
1648
+ *
1649
+ * - `hasTouch`: Specifies if viewport supports touch events. Defaults to `false`
1650
+ *
1651
+ * - `isLandScape`: Specifies if viewport is in landscape mode. Defaults to false.
1652
+ *
1653
+ * NOTE: in certain cases, setting viewport will reload the page in order to
1654
+ * set the isMobile or hasTouch properties.
1655
+ */
1656
+ async setViewport(viewport) {
1657
+ const needsReload = await this._emulationManager.emulateViewport(viewport);
1658
+ this._viewport = viewport;
1659
+ if (needsReload)
1660
+ await this.reload();
1661
+ }
1662
+ /**
1663
+ * @returns
1664
+ *
1665
+ * - `width`: page's width in pixels
1666
+ *
1667
+ * - `height`: page's height in pixels
1668
+ *
1669
+ * - `deviceScalarFactor`: Specify device scale factor (can be though of as
1670
+ * dpr). Defaults to `1`.
1671
+ *
1672
+ * - `isMobile`: Whether the meta viewport tag is taken into account. Defaults
1673
+ * to `false`.
1674
+ *
1675
+ * - `hasTouch`: Specifies if viewport supports touch events. Defaults to
1676
+ * `false`.
1677
+ *
1678
+ * - `isLandScape`: Specifies if viewport is in landscape mode. Defaults to
1679
+ * `false`.
1680
+ */
1681
+ viewport() {
1682
+ return this._viewport;
1683
+ }
1684
+ /**
1685
+ * @remarks
1686
+ *
1687
+ * Evaluates a function in the page's context and returns the result.
1688
+ *
1689
+ * If the function passed to `page.evaluteHandle` returns a Promise, the
1690
+ * function will wait for the promise to resolve and return its value.
1691
+ *
1692
+ * @example
1693
+ *
1694
+ * ```js
1695
+ * const result = await frame.evaluate(() => {
1696
+ * return Promise.resolve(8 * 7);
1697
+ * });
1698
+ * console.log(result); // prints "56"
1699
+ * ```
1700
+ *
1701
+ * You can pass a string instead of a function (although functions are
1702
+ * recommended as they are easier to debug and use with TypeScript):
1703
+ *
1704
+ * @example
1705
+ * ```
1706
+ * const aHandle = await page.evaluate('1 + 2');
1707
+ * ```
1708
+ *
1709
+ * To get the best TypeScript experience, you should pass in as the
1710
+ * generic the type of `pageFunction`:
1711
+ *
1712
+ * ```
1713
+ * const aHandle = await page.evaluate<() => number>(() => 2);
1714
+ * ```
1715
+ *
1716
+ * @example
1717
+ *
1718
+ * {@link ElementHandle} instances (including {@link JSHandle}s) can be passed
1719
+ * as arguments to the `pageFunction`:
1720
+ *
1721
+ * ```
1722
+ * const bodyHandle = await page.$('body');
1723
+ * const html = await page.evaluate(body => body.innerHTML, bodyHandle);
1724
+ * await bodyHandle.dispose();
1725
+ * ```
1726
+ *
1727
+ * @param pageFunction - a function that is run within the page
1728
+ * @param args - arguments to be passed to the pageFunction
1729
+ *
1730
+ * @returns the return value of `pageFunction`.
1731
+ */
1732
+ async evaluate(pageFunction, ...args) {
1733
+ return this._frameManager.mainFrame().evaluate(pageFunction, ...args);
1734
+ }
1735
+ /**
1736
+ * Adds a function which would be invoked in one of the following scenarios:
1737
+ *
1738
+ * - whenever the page is navigated
1739
+ *
1740
+ * - whenever the child frame is attached or navigated. In this case, the
1741
+ * function is invoked in the context of the newly attached frame.
1742
+ *
1743
+ * The function is invoked after the document was created but before any of
1744
+ * its scripts were run. This is useful to amend the JavaScript environment,
1745
+ * e.g. to seed `Math.random`.
1746
+ * @param pageFunction - Function to be evaluated in browser context
1747
+ * @param args - Arguments to pass to `pageFunction`
1748
+ * @example
1749
+ * An example of overriding the navigator.languages property before the page loads:
1750
+ * ```js
1751
+ * // preload.js
1752
+ *
1753
+ * // overwrite the `languages` property to use a custom getter
1754
+ * Object.defineProperty(navigator, 'languages', {
1755
+ * get: function () {
1756
+ * return ['en-US', 'en', 'bn'];
1757
+ * },
1758
+ * });
1759
+ *
1760
+ * // In your puppeteer script, assuming the preload.js file is
1761
+ * in same folder of our script
1762
+ * const preloadFile = fs.readFileSync('./preload.js', 'utf8');
1763
+ * await page.evaluateOnNewDocument(preloadFile);
1764
+ * ```
1765
+ */
1766
+ async evaluateOnNewDocument(pageFunction, ...args) {
1767
+ const source = helper_js_1.helper.evaluationString(pageFunction, ...args);
1768
+ await this._client.send('Page.addScriptToEvaluateOnNewDocument', {
1769
+ source,
1770
+ });
1771
+ }
1772
+ /**
1773
+ * Toggles ignoring cache for each request based on the enabled state. By
1774
+ * default, caching is enabled.
1775
+ * @param enabled - sets the `enabled` state of cache
1776
+ */
1777
+ async setCacheEnabled(enabled = true) {
1778
+ await this._frameManager.networkManager().setCacheEnabled(enabled);
1779
+ }
1780
+ /**
1781
+ * @remarks
1782
+ * Options object which might have the following properties:
1783
+ *
1784
+ * - `path` : The file path to save the image to. The screenshot type
1785
+ * will be inferred from file extension. If `path` is a relative path, then
1786
+ * it is resolved relative to
1787
+ * {@link https://nodejs.org/api/process.html#process_process_cwd
1788
+ * | current working directory}.
1789
+ * If no path is provided, the image won't be saved to the disk.
1790
+ *
1791
+ * - `type` : Specify screenshot type, can be either `jpeg` or `png`.
1792
+ * Defaults to 'png'.
1793
+ *
1794
+ * - `quality` : The quality of the image, between 0-100. Not
1795
+ * applicable to `png` images.
1796
+ *
1797
+ * - `fullPage` : When true, takes a screenshot of the full
1798
+ * scrollable page. Defaults to `false`
1799
+ *
1800
+ * - `clip` : An object which specifies clipping region of the page.
1801
+ * Should have the following fields:<br/>
1802
+ * - `x` : x-coordinate of top-left corner of clip area.<br/>
1803
+ * - `y` : y-coordinate of top-left corner of clip area.<br/>
1804
+ * - `width` : width of clipping area.<br/>
1805
+ * - `height` : height of clipping area.
1806
+ *
1807
+ * - `omitBackground` : Hides default white background and allows
1808
+ * capturing screenshots with transparency. Defaults to `false`
1809
+ *
1810
+ * - `encoding` : The encoding of the image, can be either base64 or
1811
+ * binary. Defaults to `binary`.
1812
+ *
1813
+ *
1814
+ * NOTE: Screenshots take at least 1/6 second on OS X. See
1815
+ * {@link https://crbug.com/741689} for discussion.
1816
+ * @returns Promise which resolves to buffer or a base64 string (depending on
1817
+ * the value of `encoding`) with captured screenshot.
1818
+ */
1819
+ async screenshot(options = {}) {
1820
+ let screenshotType = null;
1821
+ // options.type takes precedence over inferring the type from options.path
1822
+ // because it may be a 0-length file with no extension created beforehand
1823
+ // (i.e. as a temp file).
1824
+ if (options.type) {
1825
+ assert_js_1.assert(options.type === 'png' || options.type === 'jpeg', 'Unknown options.type value: ' + options.type);
1826
+ screenshotType = options.type;
1827
+ }
1828
+ else if (options.path) {
1829
+ const filePath = options.path;
1830
+ const extension = filePath
1831
+ .slice(filePath.lastIndexOf('.') + 1)
1832
+ .toLowerCase();
1833
+ if (extension === 'png')
1834
+ screenshotType = 'png';
1835
+ else if (extension === 'jpg' || extension === 'jpeg')
1836
+ screenshotType = 'jpeg';
1837
+ assert_js_1.assert(screenshotType, `Unsupported screenshot type for extension \`.${extension}\``);
1838
+ }
1839
+ if (!screenshotType)
1840
+ screenshotType = 'png';
1841
+ if (options.quality) {
1842
+ assert_js_1.assert(screenshotType === 'jpeg', 'options.quality is unsupported for the ' +
1843
+ screenshotType +
1844
+ ' screenshots');
1845
+ assert_js_1.assert(typeof options.quality === 'number', 'Expected options.quality to be a number but found ' +
1846
+ typeof options.quality);
1847
+ assert_js_1.assert(Number.isInteger(options.quality), 'Expected options.quality to be an integer');
1848
+ assert_js_1.assert(options.quality >= 0 && options.quality <= 100, 'Expected options.quality to be between 0 and 100 (inclusive), got ' +
1849
+ options.quality);
1850
+ }
1851
+ assert_js_1.assert(!options.clip || !options.fullPage, 'options.clip and options.fullPage are exclusive');
1852
+ if (options.clip) {
1853
+ assert_js_1.assert(typeof options.clip.x === 'number', 'Expected options.clip.x to be a number but found ' +
1854
+ typeof options.clip.x);
1855
+ assert_js_1.assert(typeof options.clip.y === 'number', 'Expected options.clip.y to be a number but found ' +
1856
+ typeof options.clip.y);
1857
+ assert_js_1.assert(typeof options.clip.width === 'number', 'Expected options.clip.width to be a number but found ' +
1858
+ typeof options.clip.width);
1859
+ assert_js_1.assert(typeof options.clip.height === 'number', 'Expected options.clip.height to be a number but found ' +
1860
+ typeof options.clip.height);
1861
+ assert_js_1.assert(options.clip.width !== 0, 'Expected options.clip.width not to be 0.');
1862
+ assert_js_1.assert(options.clip.height !== 0, 'Expected options.clip.height not to be 0.');
1863
+ }
1864
+ return this._screenshotTaskQueue.postTask(() => this._screenshotTask(screenshotType, options));
1865
+ }
1866
+ async _screenshotTask(format, options) {
1867
+ await this._client.send('Target.activateTarget', {
1868
+ targetId: this._target._targetId,
1869
+ });
1870
+ let clip = options.clip ? processClip(options.clip) : undefined;
1871
+ let { captureBeyondViewport = true } = options;
1872
+ captureBeyondViewport =
1873
+ typeof captureBeyondViewport === 'boolean' ? captureBeyondViewport : true;
1874
+ if (options.fullPage) {
1875
+ const metrics = await this._client.send('Page.getLayoutMetrics');
1876
+ // Fallback to `contentSize` in case of using Firefox.
1877
+ const { width, height } = metrics.cssContentSize || metrics.contentSize;
1878
+ // Overwrite clip for full page.
1879
+ clip = { x: 0, y: 0, width, height, scale: 1 };
1880
+ if (!captureBeyondViewport) {
1881
+ const { isMobile = false, deviceScaleFactor = 1, isLandscape = false, } = this._viewport || {};
1882
+ const screenOrientation = isLandscape
1883
+ ? { angle: 90, type: 'landscapePrimary' }
1884
+ : { angle: 0, type: 'portraitPrimary' };
1885
+ await this._client.send('Emulation.setDeviceMetricsOverride', {
1886
+ mobile: isMobile,
1887
+ width,
1888
+ height,
1889
+ deviceScaleFactor,
1890
+ screenOrientation,
1891
+ });
1892
+ }
1893
+ }
1894
+ const shouldSetDefaultBackground = options.omitBackground && format === 'png';
1895
+ if (shouldSetDefaultBackground) {
1896
+ await this._setTransparentBackgroundColor();
1897
+ }
1898
+ const result = await this._client.send('Page.captureScreenshot', {
1899
+ format,
1900
+ quality: options.quality,
1901
+ clip,
1902
+ captureBeyondViewport,
1903
+ });
1904
+ if (shouldSetDefaultBackground) {
1905
+ await this._resetDefaultBackgroundColor();
1906
+ }
1907
+ if (options.fullPage && this._viewport)
1908
+ await this.setViewport(this._viewport);
1909
+ const buffer = options.encoding === 'base64'
1910
+ ? result.data
1911
+ : Buffer.from(result.data, 'base64');
1912
+ if (options.path) {
1913
+ if (!environment_js_1.isNode) {
1914
+ throw new Error('Screenshots can only be written to a file path in a Node environment.');
1915
+ }
1916
+ const fs = await helper_js_1.helper.importFSModule();
1917
+ await fs.promises.writeFile(options.path, buffer);
1918
+ }
1919
+ return buffer;
1920
+ function processClip(clip) {
1921
+ const x = Math.round(clip.x);
1922
+ const y = Math.round(clip.y);
1923
+ const width = Math.round(clip.width + clip.x - x);
1924
+ const height = Math.round(clip.height + clip.y - y);
1925
+ return { x, y, width, height, scale: 1 };
1926
+ }
1927
+ }
1928
+ /**
1929
+ * Generatees a PDF of the page with the `print` CSS media type.
1930
+ * @remarks
1931
+ *
1932
+ * NOTE: PDF generation is only supported in Chrome headless mode.
1933
+ *
1934
+ * To generate a PDF with the `screen` media type, call
1935
+ * {@link Page.emulateMediaType | `page.emulateMediaType('screen')`} before
1936
+ * calling `page.pdf()`.
1937
+ *
1938
+ * By default, `page.pdf()` generates a pdf with modified colors for printing.
1939
+ * Use the
1940
+ * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust | `-webkit-print-color-adjust`}
1941
+ * property to force rendering of exact colors.
1942
+ *
1943
+ *
1944
+ * @param options - options for generating the PDF.
1945
+ */
1946
+ async createPDFStream(options = {}) {
1947
+ const { scale = 1, displayHeaderFooter = false, headerTemplate = '', footerTemplate = '', printBackground = false, landscape = false, pageRanges = '', preferCSSPageSize = false, margin = {}, omitBackground = false, } = options;
1948
+ let paperWidth = 8.5;
1949
+ let paperHeight = 11;
1950
+ if (options.format) {
1951
+ const format = PDFOptions_js_1.paperFormats[options.format.toLowerCase()];
1952
+ assert_js_1.assert(format, 'Unknown paper format: ' + options.format);
1953
+ paperWidth = format.width;
1954
+ paperHeight = format.height;
1955
+ }
1956
+ else {
1957
+ paperWidth = convertPrintParameterToInches(options.width) || paperWidth;
1958
+ paperHeight =
1959
+ convertPrintParameterToInches(options.height) || paperHeight;
1960
+ }
1961
+ const marginTop = convertPrintParameterToInches(margin.top) || 0;
1962
+ const marginLeft = convertPrintParameterToInches(margin.left) || 0;
1963
+ const marginBottom = convertPrintParameterToInches(margin.bottom) || 0;
1964
+ const marginRight = convertPrintParameterToInches(margin.right) || 0;
1965
+ if (omitBackground) {
1966
+ await this._setTransparentBackgroundColor();
1967
+ }
1968
+ const result = await this._client.send('Page.printToPDF', {
1969
+ transferMode: 'ReturnAsStream',
1970
+ landscape,
1971
+ displayHeaderFooter,
1972
+ headerTemplate,
1973
+ footerTemplate,
1974
+ printBackground,
1975
+ scale,
1976
+ paperWidth,
1977
+ paperHeight,
1978
+ marginTop,
1979
+ marginBottom,
1980
+ marginLeft,
1981
+ marginRight,
1982
+ pageRanges,
1983
+ preferCSSPageSize,
1984
+ });
1985
+ if (omitBackground) {
1986
+ await this._resetDefaultBackgroundColor();
1987
+ }
1988
+ return helper_js_1.helper.getReadableFromProtocolStream(this._client, result.stream);
1989
+ }
1990
+ /**
1991
+ * @param options -
1992
+ * @returns
1993
+ */
1994
+ async pdf(options = {}) {
1995
+ const { path = undefined } = options;
1996
+ const readable = await this.createPDFStream(options);
1997
+ return await helper_js_1.helper.getReadableAsBuffer(readable, path);
1998
+ }
1999
+ /**
2000
+ * @returns The page's title
2001
+ * @remarks
2002
+ * Shortcut for {@link Frame.title | page.mainFrame().title()}.
2003
+ */
2004
+ async title() {
2005
+ return this.mainFrame().title();
2006
+ }
2007
+ async close(options = { runBeforeUnload: undefined }) {
2008
+ assert_js_1.assert(!!this._client._connection, 'Protocol error: Connection closed. Most likely the page has been closed.');
2009
+ const runBeforeUnload = !!options.runBeforeUnload;
2010
+ if (runBeforeUnload) {
2011
+ await this._client.send('Page.close');
2012
+ }
2013
+ else {
2014
+ await this._client._connection.send('Target.closeTarget', {
2015
+ targetId: this._target._targetId,
2016
+ });
2017
+ await this._target._isClosedPromise;
2018
+ }
2019
+ }
2020
+ /**
2021
+ * Indicates that the page has been closed.
2022
+ * @returns
2023
+ */
2024
+ isClosed() {
2025
+ return this._closed;
2026
+ }
2027
+ get mouse() {
2028
+ return this._mouse;
2029
+ }
2030
+ /**
2031
+ * This method fetches an element with `selector`, scrolls it into view if
2032
+ * needed, and then uses {@link Page.mouse} to click in the center of the
2033
+ * element. If there's no element matching `selector`, the method throws an
2034
+ * error.
2035
+ * @remarks Bear in mind that if `click()` triggers a navigation event and
2036
+ * there's a separate `page.waitForNavigation()` promise to be resolved, you
2037
+ * may end up with a race condition that yields unexpected results. The
2038
+ * correct pattern for click and wait for navigation is the following:
2039
+ * ```js
2040
+ * const [response] = await Promise.all([
2041
+ * page.waitForNavigation(waitOptions),
2042
+ * page.click(selector, clickOptions),
2043
+ * ]);
2044
+ * ```
2045
+ * Shortcut for {@link Frame.click | page.mainFrame().click(selector[, options]) }.
2046
+ * @param selector - A `selector` to search for element to click. If there are
2047
+ * multiple elements satisfying the `selector`, the first will be clicked
2048
+ * @param options - `Object`
2049
+ * @returns Promise which resolves when the element matching `selector` is
2050
+ * successfully clicked. The Promise will be rejected if there is no element
2051
+ * matching `selector`.
2052
+ */
2053
+ click(selector, options = {}) {
2054
+ return this.mainFrame().click(selector, options);
2055
+ }
2056
+ /**
2057
+ * This method fetches an element with `selector` and focuses it. If there's no
2058
+ * element matching `selector`, the method throws an error.
2059
+ * @param selector - A
2060
+ * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector }
2061
+ * of an element to focus. If there are multiple elements satisfying the
2062
+ * selector, the first will be focused.
2063
+ * @returns Promise which resolves when the element matching selector is
2064
+ * successfully focused. The promise will be rejected if there is no element
2065
+ * matching selector.
2066
+ * @remarks
2067
+ * Shortcut for {@link Frame.focus | page.mainFrame().focus(selector)}.
2068
+ */
2069
+ focus(selector) {
2070
+ return this.mainFrame().focus(selector);
2071
+ }
2072
+ /**
2073
+ * This method fetches an element with `selector`, scrolls it into view if
2074
+ * needed, and then uses {@link Page.mouse} to hover over the center of the element.
2075
+ * If there's no element matching `selector`, the method throws an error.
2076
+ * @param selector - A
2077
+ * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
2078
+ * to search for element to hover. If there are multiple elements satisfying
2079
+ * the selector, the first will be hovered.
2080
+ * @returns Promise which resolves when the element matching `selector` is
2081
+ * successfully hovered. Promise gets rejected if there's no element matching
2082
+ * `selector`.
2083
+ * @remarks
2084
+ * Shortcut for {@link Page.hover | page.mainFrame().hover(selector)}.
2085
+ */
2086
+ hover(selector) {
2087
+ return this.mainFrame().hover(selector);
2088
+ }
2089
+ /**
2090
+ * Triggers a `change` and `input` event once all the provided options have been
2091
+ * selected. If there's no `<select>` element matching `selector`, the method
2092
+ * throws an error.
2093
+ *
2094
+ * @example
2095
+ * ```js
2096
+ * page.select('select#colors', 'blue'); // single selection
2097
+ * page.select('select#colors', 'red', 'green', 'blue'); // multiple selections
2098
+ * ```
2099
+ * @param selector - A
2100
+ * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | Selector}
2101
+ * to query the page for
2102
+ * @param values - Values of options to select. If the `<select>` has the
2103
+ * `multiple` attribute, all values are considered, otherwise only the first one
2104
+ * is taken into account.
2105
+ * @returns
2106
+ *
2107
+ * @remarks
2108
+ * Shortcut for {@link Frame.select | page.mainFrame().select()}
2109
+ */
2110
+ select(selector, ...values) {
2111
+ return this.mainFrame().select(selector, ...values);
2112
+ }
2113
+ /**
2114
+ * This method fetches an element with `selector`, scrolls it into view if
2115
+ * needed, and then uses {@link Page.touchscreen} to tap in the center of the element.
2116
+ * If there's no element matching `selector`, the method throws an error.
2117
+ * @param selector - A
2118
+ * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | Selector}
2119
+ * to search for element to tap. If there are multiple elements satisfying the
2120
+ * selector, the first will be tapped.
2121
+ * @returns
2122
+ * @remarks
2123
+ * Shortcut for {@link Frame.tap | page.mainFrame().tap(selector)}.
2124
+ */
2125
+ tap(selector) {
2126
+ return this.mainFrame().tap(selector);
2127
+ }
2128
+ /**
2129
+ * Sends a `keydown`, `keypress/input`, and `keyup` event for each character
2130
+ * in the text.
2131
+ *
2132
+ * To press a special key, like `Control` or `ArrowDown`, use {@link Keyboard.press}.
2133
+ * @example
2134
+ * ```
2135
+ * await page.type('#mytextarea', 'Hello');
2136
+ * // Types instantly
2137
+ * await page.type('#mytextarea', 'World', { delay: 100 });
2138
+ * // Types slower, like a user
2139
+ * ```
2140
+ * @param selector - A
2141
+ * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
2142
+ * of an element to type into. If there are multiple elements satisfying the
2143
+ * selector, the first will be used.
2144
+ * @param text - A text to type into a focused element.
2145
+ * @param options - have property `delay` which is the Time to wait between
2146
+ * key presses in milliseconds. Defaults to `0`.
2147
+ * @returns
2148
+ * @remarks
2149
+ */
2150
+ type(selector, text, options) {
2151
+ return this.mainFrame().type(selector, text, options);
2152
+ }
2153
+ /**
2154
+ * @remarks
2155
+ *
2156
+ * This method behaves differently depending on the first parameter. If it's a
2157
+ * `string`, it will be treated as a `selector` or `xpath` (if the string
2158
+ * starts with `//`). This method then is a shortcut for
2159
+ * {@link Page.waitForSelector} or {@link Page.waitForXPath}.
2160
+ *
2161
+ * If the first argument is a function this method is a shortcut for
2162
+ * {@link Page.waitForFunction}.
2163
+ *
2164
+ * If the first argument is a `number`, it's treated as a timeout in
2165
+ * milliseconds and the method returns a promise which resolves after the
2166
+ * timeout.
2167
+ *
2168
+ * @param selectorOrFunctionOrTimeout - a selector, predicate or timeout to
2169
+ * wait for.
2170
+ * @param options - optional waiting parameters.
2171
+ * @param args - arguments to pass to `pageFunction`.
2172
+ *
2173
+ * @deprecated Don't use this method directly. Instead use the more explicit
2174
+ * methods available: {@link Page.waitForSelector},
2175
+ * {@link Page.waitForXPath}, {@link Page.waitForFunction} or
2176
+ * {@link Page.waitForTimeout}.
2177
+ */
2178
+ waitFor(selectorOrFunctionOrTimeout, options = {}, ...args) {
2179
+ return this.mainFrame().waitFor(selectorOrFunctionOrTimeout, options, ...args);
2180
+ }
2181
+ /**
2182
+ * Causes your script to wait for the given number of milliseconds.
2183
+ *
2184
+ * @remarks
2185
+ *
2186
+ * It's generally recommended to not wait for a number of seconds, but instead
2187
+ * use {@link Page.waitForSelector}, {@link Page.waitForXPath} or
2188
+ * {@link Page.waitForFunction} to wait for exactly the conditions you want.
2189
+ *
2190
+ * @example
2191
+ *
2192
+ * Wait for 1 second:
2193
+ *
2194
+ * ```
2195
+ * await page.waitForTimeout(1000);
2196
+ * ```
2197
+ *
2198
+ * @param milliseconds - the number of milliseconds to wait.
2199
+ */
2200
+ waitForTimeout(milliseconds) {
2201
+ return this.mainFrame().waitForTimeout(milliseconds);
2202
+ }
2203
+ /**
2204
+ * Wait for the `selector` to appear in page. If at the moment of calling the
2205
+ * method the `selector` already exists, the method will return immediately. If
2206
+ * the `selector` doesn't appear after the `timeout` milliseconds of waiting, the
2207
+ * function will throw.
2208
+ *
2209
+ * This method works across navigations:
2210
+ * ```js
2211
+ * const puppeteer = require('puppeteer');
2212
+ * (async () => {
2213
+ * const browser = await puppeteer.launch();
2214
+ * const page = await browser.newPage();
2215
+ * let currentURL;
2216
+ * page
2217
+ * .waitForSelector('img')
2218
+ * .then(() => console.log('First URL with image: ' + currentURL));
2219
+ * for (currentURL of [
2220
+ * 'https://example.com',
2221
+ * 'https://google.com',
2222
+ * 'https://bbc.com',
2223
+ * ]) {
2224
+ * await page.goto(currentURL);
2225
+ * }
2226
+ * await browser.close();
2227
+ * })();
2228
+ * ```
2229
+ * @param selector - A
2230
+ * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
2231
+ * of an element to wait for
2232
+ * @param options - Optional waiting parameters
2233
+ * @returns Promise which resolves when element specified by selector string
2234
+ * is added to DOM. Resolves to `null` if waiting for hidden: `true` and
2235
+ * selector is not found in DOM.
2236
+ * @remarks
2237
+ * The optional Parameter in Arguments `options` are :
2238
+ *
2239
+ * - `Visible`: A boolean wait for element to be present in DOM and to be
2240
+ * visible, i.e. to not have `display: none` or `visibility: hidden` CSS
2241
+ * properties. Defaults to `false`.
2242
+ *
2243
+ * - `hidden`: ait for element to not be found in the DOM or to be hidden,
2244
+ * i.e. have `display: none` or `visibility: hidden` CSS properties. Defaults to
2245
+ * `false`.
2246
+ *
2247
+ * - `timeout`: maximum time to wait for in milliseconds. Defaults to `30000`
2248
+ * (30 seconds). Pass `0` to disable timeout. The default value can be changed
2249
+ * by using the {@link Page.setDefaultTimeout} method.
2250
+ */
2251
+ waitForSelector(selector, options = {}) {
2252
+ return this.mainFrame().waitForSelector(selector, options);
2253
+ }
2254
+ /**
2255
+ * Wait for the `xpath` to appear in page. If at the moment of calling the
2256
+ * method the `xpath` already exists, the method will return immediately. If
2257
+ * the `xpath` doesn't appear after the `timeout` milliseconds of waiting, the
2258
+ * function will throw.
2259
+ *
2260
+ * This method works across navigation
2261
+ * ```js
2262
+ * const puppeteer = require('puppeteer');
2263
+ * (async () => {
2264
+ * const browser = await puppeteer.launch();
2265
+ * const page = await browser.newPage();
2266
+ * let currentURL;
2267
+ * page
2268
+ * .waitForXPath('//img')
2269
+ * .then(() => console.log('First URL with image: ' + currentURL));
2270
+ * for (currentURL of [
2271
+ * 'https://example.com',
2272
+ * 'https://google.com',
2273
+ * 'https://bbc.com',
2274
+ * ]) {
2275
+ * await page.goto(currentURL);
2276
+ * }
2277
+ * await browser.close();
2278
+ * })();
2279
+ * ```
2280
+ * @param xpath - A
2281
+ * {@link https://developer.mozilla.org/en-US/docs/Web/XPath | xpath} of an
2282
+ * element to wait for
2283
+ * @param options - Optional waiting parameters
2284
+ * @returns Promise which resolves when element specified by xpath string is
2285
+ * added to DOM. Resolves to `null` if waiting for `hidden: true` and xpath is
2286
+ * not found in DOM.
2287
+ * @remarks
2288
+ * The optional Argument `options` have properties:
2289
+ *
2290
+ * - `visible`: A boolean to wait for element to be present in DOM and to be
2291
+ * visible, i.e. to not have `display: none` or `visibility: hidden` CSS
2292
+ * properties. Defaults to `false`.
2293
+ *
2294
+ * - `hidden`: A boolean wait for element to not be found in the DOM or to be
2295
+ * hidden, i.e. have `display: none` or `visibility: hidden` CSS properties.
2296
+ * Defaults to `false`.
2297
+ *
2298
+ * - `timeout`: A number which is maximum time to wait for in milliseconds.
2299
+ * Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default
2300
+ * value can be changed by using the {@link Page.setDefaultTimeout} method.
2301
+ */
2302
+ waitForXPath(xpath, options = {}) {
2303
+ return this.mainFrame().waitForXPath(xpath, options);
2304
+ }
2305
+ /**
2306
+ * The `waitForFunction` can be used to observe viewport size change:
2307
+ *
2308
+ * ```
2309
+ * const puppeteer = require('puppeteer');
2310
+ * (async () => {
2311
+ * const browser = await puppeteer.launch();
2312
+ * const page = await browser.newPage();
2313
+ * const watchDog = page.waitForFunction('window.innerWidth < 100');
2314
+ * await page.setViewport({ width: 50, height: 50 });
2315
+ * await watchDog;
2316
+ * await browser.close();
2317
+ * })();
2318
+ * ```
2319
+ * To pass arguments from node.js to the predicate of `page.waitForFunction` function:
2320
+ * ```
2321
+ * const selector = '.foo';
2322
+ * await page.waitForFunction(
2323
+ * (selector) => !!document.querySelector(selector),
2324
+ * {},
2325
+ * selector
2326
+ * );
2327
+ * ```
2328
+ * The predicate of `page.waitForFunction` can be asynchronous too:
2329
+ * ```
2330
+ * const username = 'github-username';
2331
+ * await page.waitForFunction(
2332
+ * async (username) => {
2333
+ * const githubResponse = await fetch(
2334
+ * `https://api.github.com/users/${username}`
2335
+ * );
2336
+ * const githubUser = await githubResponse.json();
2337
+ * // show the avatar
2338
+ * const img = document.createElement('img');
2339
+ * img.src = githubUser.avatar_url;
2340
+ * // wait 3 seconds
2341
+ * await new Promise((resolve, reject) => setTimeout(resolve, 3000));
2342
+ * img.remove();
2343
+ * },
2344
+ * {},
2345
+ * username
2346
+ * );
2347
+ * ```
2348
+ * @param pageFunction - Function to be evaluated in browser context
2349
+ * @param options - Optional waiting parameters
2350
+ * @param args - Arguments to pass to `pageFunction`
2351
+ * @returns Promise which resolves when the `pageFunction` returns a truthy
2352
+ * value. It resolves to a JSHandle of the truthy value.
2353
+ *
2354
+ * The optional waiting parameter can be:
2355
+ *
2356
+ * - `Polling`: An interval at which the `pageFunction` is executed, defaults to
2357
+ * `raf`. If `polling` is a number, then it is treated as an interval in
2358
+ * milliseconds at which the function would be executed. If polling is a
2359
+ * string, then it can be one of the following values:<br/>
2360
+ * - `raf`: to constantly execute `pageFunction` in `requestAnimationFrame`
2361
+ * callback. This is the tightest polling mode which is suitable to
2362
+ * observe styling changes.<br/>
2363
+ * - `mutation`: to execute pageFunction on every DOM mutation.
2364
+ *
2365
+ * - `timeout`: maximum time to wait for in milliseconds. Defaults to `30000`
2366
+ * (30 seconds). Pass `0` to disable timeout. The default value can be changed
2367
+ * by using the
2368
+ * {@link Page.setDefaultTimeout | page.setDefaultTimeout(timeout)} method.
2369
+ *
2370
+ */
2371
+ waitForFunction(pageFunction, options = {}, ...args) {
2372
+ return this.mainFrame().waitForFunction(pageFunction, options, ...args);
2373
+ }
2374
+ }
2375
+ exports.Page = Page;
2376
+ const supportedMetrics = new Set([
2377
+ 'Timestamp',
2378
+ 'Documents',
2379
+ 'Frames',
2380
+ 'JSEventListeners',
2381
+ 'Nodes',
2382
+ 'LayoutCount',
2383
+ 'RecalcStyleCount',
2384
+ 'LayoutDuration',
2385
+ 'RecalcStyleDuration',
2386
+ 'ScriptDuration',
2387
+ 'TaskDuration',
2388
+ 'JSHeapUsedSize',
2389
+ 'JSHeapTotalSize',
2390
+ ]);
2391
+ const unitToPixels = {
2392
+ px: 1,
2393
+ in: 96,
2394
+ cm: 37.8,
2395
+ mm: 3.78,
2396
+ };
2397
+ function convertPrintParameterToInches(parameter) {
2398
+ if (typeof parameter === 'undefined')
2399
+ return undefined;
2400
+ let pixels;
2401
+ if (helper_js_1.helper.isNumber(parameter)) {
2402
+ // Treat numbers as pixel values to be aligned with phantom's paperSize.
2403
+ pixels = /** @type {number} */ parameter;
2404
+ }
2405
+ else if (helper_js_1.helper.isString(parameter)) {
2406
+ const text = /** @type {string} */ parameter;
2407
+ let unit = text.substring(text.length - 2).toLowerCase();
2408
+ let valueText = '';
2409
+ if (unitToPixels.hasOwnProperty(unit)) {
2410
+ valueText = text.substring(0, text.length - 2);
2411
+ }
2412
+ else {
2413
+ // In case of unknown unit try to parse the whole parameter as number of pixels.
2414
+ // This is consistent with phantom's paperSize behavior.
2415
+ unit = 'px';
2416
+ valueText = text;
2417
+ }
2418
+ const value = Number(valueText);
2419
+ assert_js_1.assert(!isNaN(value), 'Failed to parse parameter value: ' + text);
2420
+ pixels = value * unitToPixels[unit];
2421
+ }
2422
+ else {
2423
+ throw new Error('page.pdf() Cannot handle parameter type: ' + typeof parameter);
2424
+ }
2425
+ return pixels / 96;
2426
+ }
2427
+ //# sourceMappingURL=Page.js.map