@browserless.io/browserless 2.2.0-beta-8 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -2
- package/bin/browserless.js +1 -1
- package/bin/scaffold/README.md +8 -7
- package/build/browserless.js +7 -6
- package/build/browsers/chrome.cdp.d.ts +6 -0
- package/build/browsers/chrome.cdp.js +6 -0
- package/build/browsers/chrome.playwright.d.ts +6 -0
- package/build/browsers/chrome.playwright.js +6 -0
- package/build/browsers/{cdp-chromium.d.ts → chromium.cdp.d.ts} +3 -2
- package/build/browsers/{cdp-chromium.js → chromium.cdp.js} +16 -10
- package/build/browsers/{playwright-chromium.d.ts → chromium.playwright.d.ts} +3 -2
- package/build/browsers/{playwright-chromium.js → chromium.playwright.js} +6 -5
- package/build/browsers/{playwright-firefox.d.ts → firefox.playwright.d.ts} +2 -2
- package/build/browsers/{playwright-firefox.js → firefox.playwright.js} +4 -4
- package/build/browsers/index.d.ts +20 -10
- package/build/browsers/index.js +110 -11
- package/build/browsers/{playwright-webkit.d.ts → webkit.playwright.d.ts} +2 -2
- package/build/browsers/{playwright-webkit.js → webkit.playwright.js} +4 -4
- package/build/data/selectors.json +1 -1
- package/build/exports.d.ts +6 -4
- package/build/exports.js +6 -4
- package/build/hooks.d.ts +4 -5
- package/build/hooks.js +4 -6
- package/build/http.d.ts +22 -1
- package/build/http.js +21 -0
- package/build/router.js +19 -3
- package/build/routes/{chromium/http/content-post.body.json → chrome/http/content.post.body.json} +8 -8
- package/build/routes/chrome/http/content.post.d.ts +7 -0
- package/build/routes/chrome/http/content.post.js +6 -0
- package/build/routes/chrome/http/download.post.d.ts +7 -0
- package/build/routes/chrome/http/download.post.js +6 -0
- package/build/routes/chrome/http/function.post.d.ts +7 -0
- package/build/routes/chrome/http/function.post.js +6 -0
- package/build/routes/chrome/http/json-list.get.d.ts +1 -0
- package/build/routes/chrome/http/json-list.get.js +1 -0
- package/build/routes/chrome/http/json-new.put.d.ts +1 -0
- package/build/routes/chrome/http/json-new.put.js +1 -0
- package/build/routes/chrome/http/json-protocol.get.d.ts +1 -0
- package/build/routes/chrome/http/json-protocol.get.js +1 -0
- package/build/routes/chrome/http/json-version.get.d.ts +1 -0
- package/build/routes/chrome/http/json-version.get.js +1 -0
- package/build/routes/chrome/http/json-version.get.response.json +44 -0
- package/build/routes/{chromium/http/pdf-post.body.json → chrome/http/pdf.post.body.json} +8 -8
- package/build/routes/chrome/http/pdf.post.d.ts +7 -0
- package/build/routes/chrome/http/pdf.post.js +6 -0
- package/build/routes/chrome/http/performance.post.d.ts +7 -0
- package/build/routes/chrome/http/performance.post.js +6 -0
- package/build/routes/{chromium/http/scrape-post.body.json → chrome/http/scrape.post.body.json} +8 -8
- package/build/routes/chrome/http/scrape.post.d.ts +7 -0
- package/build/routes/chrome/http/scrape.post.js +6 -0
- package/build/routes/{chromium/http/screenshot-post.body.json → chrome/http/screenshot.post.body.json} +8 -8
- package/build/routes/chrome/http/screenshot.post.d.ts +7 -0
- package/build/routes/chrome/http/screenshot.post.js +6 -0
- package/build/routes/chrome/tests/content.spec.js +311 -0
- package/build/routes/chrome/tests/download.spec.js +67 -0
- package/build/routes/chrome/tests/function.spec.d.ts +1 -0
- package/build/routes/chrome/tests/function.spec.js +245 -0
- package/build/routes/chrome/tests/json-version.spec.d.ts +1 -0
- package/build/routes/chrome/tests/json-version.spec.js +37 -0
- package/build/routes/chrome/tests/page-websocket.spec.d.ts +1 -0
- package/build/routes/chrome/tests/page-websocket.spec.js +97 -0
- package/build/routes/chrome/tests/pdf.spec.d.ts +1 -0
- package/build/routes/chrome/tests/pdf.spec.js +333 -0
- package/build/routes/chrome/tests/performance.spec.d.ts +1 -0
- package/build/routes/chrome/tests/performance.spec.js +124 -0
- package/build/routes/chrome/tests/scrape.spec.d.ts +1 -0
- package/build/routes/chrome/tests/scrape.spec.js +354 -0
- package/build/routes/chrome/tests/screenshot.spec.d.ts +1 -0
- package/build/routes/chrome/tests/screenshot.spec.js +339 -0
- package/build/routes/chrome/tests/websocket.spec.d.ts +1 -0
- package/build/routes/chrome/tests/websocket.spec.js +371 -0
- package/build/routes/chrome/ws/browser.d.ts +6 -0
- package/build/routes/chrome/ws/browser.js +5 -0
- package/build/routes/chrome/ws/cdp.d.ts +7 -0
- package/build/routes/chrome/ws/cdp.js +6 -0
- package/build/routes/chrome/ws/cdp.query.json +120 -0
- package/build/routes/chrome/ws/page.d.ts +6 -0
- package/build/routes/chrome/ws/page.js +5 -0
- package/build/routes/chrome/ws/page.query.json +120 -0
- package/build/routes/chrome/ws/playwright.d.ts +7 -0
- package/build/routes/chrome/ws/playwright.js +6 -0
- package/build/routes/chromium/http/content.post.body.json +510 -0
- package/build/routes/chromium/http/content.post.d.ts +1 -0
- package/build/routes/chromium/http/content.post.js +1 -0
- package/build/routes/chromium/http/content.post.query.json +183 -0
- package/build/routes/chromium/http/content.post.response.json +5 -0
- package/build/routes/chromium/http/download.post.body.json +32 -0
- package/build/routes/chromium/http/download.post.d.ts +1 -0
- package/build/routes/chromium/http/download.post.js +1 -0
- package/build/routes/chromium/http/download.post.query.json +120 -0
- package/build/routes/chromium/http/download.post.response.json +4 -0
- package/build/routes/chromium/http/function.post.body.json +32 -0
- package/build/routes/chromium/http/function.post.d.ts +1 -0
- package/build/routes/chromium/http/function.post.js +1 -0
- package/build/routes/chromium/http/function.post.query.json +120 -0
- package/build/routes/chromium/http/function.post.response.json +4 -0
- package/build/routes/chromium/http/json-list.get.d.ts +1 -0
- package/build/routes/chromium/http/json-list.get.js +1 -0
- package/build/routes/chromium/http/json-list.get.response.json +52 -0
- package/build/routes/chromium/http/json-new.put.d.ts +1 -0
- package/build/routes/chromium/http/json-new.put.js +1 -0
- package/build/routes/chromium/http/json-new.put.response.json +44 -0
- package/build/routes/chromium/http/json-protocol.get.d.ts +1 -0
- package/build/routes/chromium/http/json-protocol.get.js +1 -0
- package/build/routes/chromium/http/json-protocol.get.response.json +6 -0
- package/build/routes/chromium/http/json-version.get.d.ts +1 -0
- package/build/routes/chromium/http/json-version.get.js +1 -0
- package/build/routes/chromium/http/json-version.get.response.json +44 -0
- package/build/routes/chromium/http/pdf.post.body.json +654 -0
- package/build/routes/chromium/http/pdf.post.d.ts +1 -0
- package/build/routes/chromium/http/pdf.post.js +1 -0
- package/build/routes/chromium/http/pdf.post.query.json +120 -0
- package/build/routes/chromium/http/pdf.post.response.json +5 -0
- package/build/routes/chromium/http/performance.post.body.json +26 -0
- package/build/routes/chromium/http/performance.post.d.ts +1 -0
- package/build/routes/chromium/http/performance.post.js +1 -0
- package/build/routes/chromium/http/performance.post.query.json +120 -0
- package/build/routes/chromium/http/performance.post.response.json +7 -0
- package/build/routes/chromium/http/scrape.post.body.json +557 -0
- package/build/routes/chromium/http/scrape.post.d.ts +1 -0
- package/build/routes/chromium/http/scrape.post.js +1 -0
- package/build/routes/chromium/http/scrape.post.query.json +183 -0
- package/build/routes/chromium/http/scrape.post.response.json +309 -0
- package/build/routes/chromium/http/screenshot.post.body.json +600 -0
- package/build/routes/chromium/http/screenshot.post.d.ts +1 -0
- package/build/routes/chromium/http/screenshot.post.js +1 -0
- package/build/routes/chromium/http/screenshot.post.query.json +120 -0
- package/build/routes/chromium/http/screenshot.post.response.json +5 -0
- package/build/routes/chromium/tests/content.spec.js +16 -16
- package/build/routes/chromium/tests/download.spec.js +3 -3
- package/build/routes/chromium/tests/function.spec.js +10 -10
- package/build/routes/chromium/tests/page-websocket.spec.d.ts +1 -0
- package/build/routes/chromium/tests/page-websocket.spec.js +97 -0
- package/build/routes/chromium/tests/pdf.spec.js +16 -16
- package/build/routes/chromium/tests/performance.spec.js +7 -7
- package/build/routes/chromium/tests/scrape.spec.js +15 -15
- package/build/routes/chromium/tests/screenshot.spec.js +17 -17
- package/build/routes/chromium/tests/websocket.spec.js +31 -37
- package/build/routes/chromium/ws/browser.d.ts +1 -16
- package/build/routes/chromium/ws/browser.js +1 -10
- package/build/routes/chromium/ws/cdp.d.ts +1 -0
- package/build/routes/chromium/ws/cdp.js +1 -0
- package/build/routes/chromium/ws/cdp.query.json +120 -0
- package/build/routes/chromium/ws/page.d.ts +1 -16
- package/build/routes/chromium/ws/page.js +1 -10
- package/build/routes/chromium/ws/playwright.d.ts +1 -0
- package/build/routes/chromium/ws/playwright.js +1 -0
- package/build/routes/firefox/ws/{playwright-firefox.d.ts → playwright.d.ts} +5 -5
- package/build/routes/firefox/ws/{playwright-firefox.js → playwright.js} +4 -4
- package/build/routes/management/http/{sessions-get.response.json → sessions.get.response.json} +11 -1
- package/build/routes/management/http/{static-get.js → static.get.js} +2 -2
- package/build/routes/webkit/ws/{playwright-webkit.d.ts → playwright.d.ts} +5 -5
- package/build/routes/webkit/ws/{playwright-webkit.js → playwright.js} +4 -4
- package/build/routes/webkit/ws/playwright.query.json +100 -0
- package/build/{routes/chromium/ws/cdp-chromium.d.ts → shared/browser.ws.d.ts} +4 -4
- package/build/shared/browser.ws.js +12 -0
- package/build/{routes/chromium/ws/playwright-chromium.d.ts → shared/chromium.playwright.ws.d.ts} +4 -4
- package/build/{routes/chromium/ws/playwright-chromium.js → shared/chromium.playwright.ws.js} +6 -3
- package/build/shared/chromium.ws.d.ts +16 -0
- package/build/shared/chromium.ws.js +10 -0
- package/build/{routes/chromium/http/content-post.d.ts → shared/content.http.d.ts} +3 -3
- package/build/{routes/chromium/http/content-post.js → shared/content.http.js} +3 -3
- package/build/{routes/chromium/http/download-post.d.ts → shared/download.http.d.ts} +3 -3
- package/build/{routes/chromium/http/download-post.js → shared/download.http.js} +4 -4
- package/build/{routes/chromium/http/function-post.d.ts → shared/function.http.d.ts} +3 -3
- package/build/{routes/chromium/http/function-post.js → shared/function.http.js} +4 -4
- package/build/{routes/chromium/http/json-new.d.ts → shared/json-list.http.d.ts} +2 -3
- package/build/{routes/chromium/http/json-list.js → shared/json-list.http.js} +5 -8
- package/build/{routes/chromium/http/json-list.d.ts → shared/json-new.http.d.ts} +2 -3
- package/build/shared/json-new.http.js +34 -0
- package/build/{routes/chromium/http/json-protocol-get.js → shared/json-protocol.http.js} +2 -2
- package/build/{routes/chromium/http/json-version-get.js → shared/json-version.http.js} +3 -3
- package/build/shared/page.ws.d.ts +16 -0
- package/build/shared/page.ws.js +13 -0
- package/build/{routes/chromium/http/pdf-post.d.ts → shared/pdf.http.d.ts} +3 -3
- package/build/{routes/chromium/http/pdf-post.js → shared/pdf.http.js} +3 -3
- package/build/{routes/chromium/http/performance.d.ts → shared/performance.http.d.ts} +3 -3
- package/build/{routes/chromium/http/performance.js → shared/performance.http.js} +4 -4
- package/build/{routes/chromium/http/scrape-post.d.ts → shared/scrape.http.d.ts} +3 -3
- package/build/{routes/chromium/http/scrape-post.js → shared/scrape.http.js} +3 -3
- package/build/{routes/chromium/http/screenshot-post.d.ts → shared/screenshot.http.d.ts} +3 -3
- package/build/{routes/chromium/http/screenshot-post.js → shared/screenshot.http.js} +3 -3
- package/build/shared/utils/performance/child.d.ts +1 -0
- package/build/{routes/chromium → shared}/utils/performance/main.js +1 -1
- package/build/shared/utils/performance/types.js +1 -0
- package/build/shim.js +2 -1
- package/build/types.d.ts +10 -8
- package/build/utils.d.ts +8 -3
- package/build/utils.js +24 -11
- package/docker/base/Dockerfile +1 -1
- package/docker/chrome/Dockerfile +4 -4
- package/docker/chromium/.dockerignore +16 -0
- package/docker/chromium/Dockerfile +40 -0
- package/docker/firefox/Dockerfile +1 -1
- package/docker/multi/Dockerfile +13 -1
- package/docker/webkit/Dockerfile +1 -1
- package/extensions/ublock/3p-filters.html +1 -1
- package/extensions/ublock/_locales/ar/messages.json +4 -0
- package/extensions/ublock/_locales/az/messages.json +4 -0
- package/extensions/ublock/_locales/be/messages.json +4 -0
- package/extensions/ublock/_locales/bg/messages.json +5 -1
- package/extensions/ublock/_locales/bn/messages.json +4 -0
- package/extensions/ublock/_locales/br_FR/messages.json +6 -2
- package/extensions/ublock/_locales/bs/messages.json +4 -0
- package/extensions/ublock/_locales/ca/messages.json +4 -0
- package/extensions/ublock/_locales/cs/messages.json +4 -0
- package/extensions/ublock/_locales/cv/messages.json +4 -0
- package/extensions/ublock/_locales/cy/messages.json +1294 -0
- package/extensions/ublock/_locales/da/messages.json +4 -0
- package/extensions/ublock/_locales/de/messages.json +5 -1
- package/extensions/ublock/_locales/el/messages.json +4 -0
- package/extensions/ublock/_locales/en/messages.json +4 -0
- package/extensions/ublock/_locales/en_GB/messages.json +4 -0
- package/extensions/ublock/_locales/eo/messages.json +9 -5
- package/extensions/ublock/_locales/es/messages.json +4 -0
- package/extensions/ublock/_locales/et/messages.json +4 -0
- package/extensions/ublock/_locales/eu/messages.json +8 -4
- package/extensions/ublock/_locales/fa/messages.json +4 -0
- package/extensions/ublock/_locales/fi/messages.json +4 -0
- package/extensions/ublock/_locales/fil/messages.json +4 -0
- package/extensions/ublock/_locales/fr/messages.json +4 -0
- package/extensions/ublock/_locales/fy/messages.json +4 -0
- package/extensions/ublock/_locales/gl/messages.json +4 -0
- package/extensions/ublock/_locales/gu/messages.json +4 -0
- package/extensions/ublock/_locales/he/messages.json +4 -0
- package/extensions/ublock/_locales/hi/messages.json +4 -0
- package/extensions/ublock/_locales/hr/messages.json +4 -0
- package/extensions/ublock/_locales/hu/messages.json +4 -0
- package/extensions/ublock/_locales/hy/messages.json +4 -0
- package/extensions/ublock/_locales/id/messages.json +5 -1
- package/extensions/ublock/_locales/it/messages.json +4 -0
- package/extensions/ublock/_locales/ja/messages.json +4 -0
- package/extensions/ublock/_locales/ka/messages.json +34 -30
- package/extensions/ublock/_locales/kk/messages.json +4 -0
- package/extensions/ublock/_locales/kn/messages.json +4 -0
- package/extensions/ublock/_locales/ko/messages.json +4 -0
- package/extensions/ublock/_locales/ku/messages.json +4 -0
- package/extensions/ublock/_locales/lt/messages.json +4 -0
- package/extensions/ublock/_locales/lv/messages.json +4 -0
- package/extensions/ublock/_locales/mk/messages.json +4 -0
- package/extensions/ublock/_locales/ml/messages.json +4 -0
- package/extensions/ublock/_locales/mr/messages.json +4 -0
- package/extensions/ublock/_locales/ms/messages.json +13 -9
- package/extensions/ublock/_locales/nb/messages.json +4 -0
- package/extensions/ublock/_locales/nl/messages.json +4 -0
- package/extensions/ublock/_locales/no/messages.json +4 -0
- package/extensions/ublock/_locales/oc/messages.json +4 -0
- package/extensions/ublock/_locales/pa/messages.json +4 -0
- package/extensions/ublock/_locales/pl/messages.json +5 -1
- package/extensions/ublock/_locales/pt_BR/messages.json +4 -0
- package/extensions/ublock/_locales/pt_PT/messages.json +4 -0
- package/extensions/ublock/_locales/ro/messages.json +5 -1
- package/extensions/ublock/_locales/ru/messages.json +4 -0
- package/extensions/ublock/_locales/si/messages.json +4 -0
- package/extensions/ublock/_locales/sk/messages.json +4 -0
- package/extensions/ublock/_locales/sl/messages.json +4 -0
- package/extensions/ublock/_locales/so/messages.json +4 -0
- package/extensions/ublock/_locales/sq/messages.json +4 -0
- package/extensions/ublock/_locales/sr/messages.json +4 -0
- package/extensions/ublock/_locales/sv/messages.json +4 -0
- package/extensions/ublock/_locales/sw/messages.json +4 -0
- package/extensions/ublock/_locales/ta/messages.json +4 -0
- package/extensions/ublock/_locales/te/messages.json +4 -0
- package/extensions/ublock/_locales/th/messages.json +12 -8
- package/extensions/ublock/_locales/tr/messages.json +4 -0
- package/extensions/ublock/_locales/uk/messages.json +4 -0
- package/extensions/ublock/_locales/ur/messages.json +4 -0
- package/extensions/ublock/_locales/vi/messages.json +4 -0
- package/extensions/ublock/_locales/zh_CN/messages.json +6 -2
- package/extensions/ublock/_locales/zh_TW/messages.json +6 -2
- package/extensions/ublock/assets/assets.json +11 -11
- package/extensions/ublock/assets/resources/scriptlets.js +660 -378
- package/extensions/ublock/assets/thirdparties/easylist/easylist.txt +7173 -3455
- package/extensions/ublock/assets/thirdparties/easylist/easyprivacy.txt +18829 -1918
- package/extensions/ublock/assets/thirdparties/pgl.yoyo.org/as/serverlist +21 -26
- package/extensions/ublock/assets/thirdparties/publicsuffix.org/list/effective_tld_names.dat +118 -46
- package/extensions/ublock/assets/thirdparties/urlhaus-filter/urlhaus-filter-online.txt +710 -1117
- package/extensions/ublock/assets/ublock/badlists.txt +0 -4
- package/extensions/ublock/assets/ublock/badware.min.txt +116 -105
- package/extensions/ublock/assets/ublock/filters.min.txt +1443 -1097
- package/extensions/ublock/assets/ublock/privacy.min.txt +50 -31
- package/extensions/ublock/assets/ublock/quick-fixes.min.txt +97 -108
- package/extensions/ublock/assets/ublock/unbreak.min.txt +64 -21
- package/extensions/ublock/css/1p-filters.css +4 -0
- package/extensions/ublock/css/3p-filters.css +6 -4
- package/extensions/ublock/css/common.css +1 -1
- package/extensions/ublock/css/fa-icons.css +1 -0
- package/extensions/ublock/css/logger-ui.css +72 -52
- package/extensions/ublock/css/popup-fenix.css +1 -1
- package/extensions/ublock/img/fontawesome/fontawesome-defs.svg +1 -0
- package/extensions/ublock/js/3p-filters.js +3 -3
- package/extensions/ublock/js/assets.js +7 -4
- package/extensions/ublock/js/background.js +1 -3
- package/extensions/ublock/js/benchmarks.js +1 -0
- package/extensions/ublock/js/broadcast.js +12 -0
- package/extensions/ublock/js/click2load.js +2 -3
- package/extensions/ublock/js/codemirror/ubo-static-filtering.js +1 -0
- package/extensions/ublock/js/commands.js +10 -0
- package/extensions/ublock/js/contentscript-extra.js +13 -11
- package/extensions/ublock/js/contentscript.js +0 -31
- package/extensions/ublock/js/contextmenu.js +5 -1
- package/extensions/ublock/js/dyna-rules.js +83 -52
- package/extensions/ublock/js/fa-icons.js +1 -0
- package/extensions/ublock/js/filtering-context.js +0 -2
- package/extensions/ublock/js/i18n.js +1 -5
- package/extensions/ublock/js/logger-ui.js +71 -38
- package/extensions/ublock/js/logger.js +18 -14
- package/extensions/ublock/js/messaging.js +17 -5
- package/extensions/ublock/js/popup-fenix.js +6 -6
- package/extensions/ublock/js/scriptlet-filtering-core.js +14 -12
- package/extensions/ublock/js/scriptlet-filtering.js +149 -53
- package/extensions/ublock/js/scriptlets/scriptlet-loglevel-1.js +49 -0
- package/extensions/ublock/js/scriptlets/scriptlet-loglevel-2.js +49 -0
- package/extensions/ublock/js/scriptlets/should-inject-contentscript.js +1 -1
- package/extensions/ublock/js/static-dnr-filtering.js +4 -2
- package/extensions/ublock/js/static-filtering-parser.js +14 -8
- package/extensions/ublock/js/static-net-filtering.js +32 -30
- package/extensions/ublock/js/storage.js +18 -4
- package/extensions/ublock/js/traffic.js +3 -3
- package/extensions/ublock/js/ublock.js +1 -1
- package/extensions/ublock/js/vapi-background.js +15 -7
- package/extensions/ublock/logger-ui.html +18 -10
- package/extensions/ublock/manifest.json +4 -1
- package/extensions/ublock/web_accessible_resources/chartbeat.js +3 -0
- package/package.json +12 -11
- package/scripts/build-function.js +1 -1
- package/scripts/build-open-api.js +3 -2
- package/scripts/clean.js +6 -1
- package/scripts/install-debugger.js +20 -0
- package/scripts/install-devtools.js +40 -0
- package/src/browserless.ts +11 -9
- package/src/browsers/chrome.cdp.ts +10 -0
- package/src/browsers/chrome.playwright.ts +10 -0
- package/src/browsers/{cdp-chromium.ts → chromium.cdp.ts} +20 -13
- package/src/browsers/{playwright-chromium.ts → chromium.playwright.ts} +7 -6
- package/src/browsers/{playwright-firefox.ts → firefox.playwright.ts} +5 -5
- package/src/browsers/index.ts +160 -23
- package/src/browsers/{playwright-webkit.ts → webkit.playwright.ts} +5 -5
- package/src/exports.ts +6 -4
- package/src/hooks.ts +4 -12
- package/src/http.ts +21 -0
- package/src/router.ts +21 -5
- package/src/routes/chrome/http/content.post.ts +14 -0
- package/src/routes/chrome/http/download.post.ts +14 -0
- package/src/routes/chrome/http/function.post.ts +14 -0
- package/src/routes/chrome/http/json-list.get.ts +1 -0
- package/src/routes/chrome/http/json-new.put.ts +1 -0
- package/src/routes/chrome/http/json-protocol.get.ts +1 -0
- package/src/routes/chrome/http/json-version.get.ts +1 -0
- package/src/routes/chrome/http/pdf.post.ts +14 -0
- package/src/routes/chrome/http/performance.post.ts +14 -0
- package/src/routes/chrome/http/scrape.post.ts +14 -0
- package/src/routes/chrome/http/screenshot.post.ts +14 -0
- package/src/routes/chrome/tests/content.spec.ts +375 -0
- package/src/routes/chrome/tests/download.spec.ts +77 -0
- package/src/routes/chrome/tests/function.spec.ts +282 -0
- package/src/routes/chrome/tests/json-version.spec.ts +52 -0
- package/src/routes/chrome/tests/page-websocket.spec.ts +129 -0
- package/src/routes/chrome/tests/pdf.spec.ts +380 -0
- package/src/routes/chrome/tests/performance.spec.ts +155 -0
- package/src/routes/chrome/tests/scrape.spec.ts +417 -0
- package/src/routes/chrome/tests/screenshot.spec.ts +387 -0
- package/src/routes/chrome/tests/websocket.spec.ts +491 -0
- package/src/routes/chrome/ws/browser.ts +8 -0
- package/src/routes/chrome/ws/cdp.ts +12 -0
- package/src/routes/chrome/ws/page.ts +8 -0
- package/src/routes/chrome/ws/playwright.ts +12 -0
- package/src/routes/chromium/http/content.post.ts +6 -0
- package/src/routes/chromium/http/download.post.ts +6 -0
- package/src/routes/chromium/http/function.post.ts +6 -0
- package/src/routes/chromium/http/json-list.get.ts +1 -0
- package/src/routes/chromium/http/json-new.put.ts +1 -0
- package/src/routes/chromium/http/json-protocol.get.ts +1 -0
- package/src/routes/chromium/http/json-version.get.ts +1 -0
- package/src/routes/chromium/http/pdf.post.ts +6 -0
- package/src/routes/chromium/http/performance.post.ts +6 -0
- package/src/routes/chromium/http/scrape.post.ts +6 -0
- package/src/routes/chromium/http/screenshot.post.ts +6 -0
- package/src/routes/chromium/tests/content.spec.ts +36 -28
- package/src/routes/chromium/tests/download.spec.ts +3 -3
- package/src/routes/chromium/tests/function.spec.ts +18 -15
- package/src/routes/chromium/tests/page-websocket.spec.ts +129 -0
- package/src/routes/chromium/tests/pdf.spec.ts +31 -26
- package/src/routes/chromium/tests/performance.spec.ts +46 -34
- package/src/routes/chromium/tests/scrape.spec.ts +23 -20
- package/src/routes/chromium/tests/screenshot.spec.ts +24 -24
- package/src/routes/chromium/tests/websocket.spec.ts +31 -40
- package/src/routes/chromium/ws/browser.ts +1 -29
- package/src/routes/chromium/ws/cdp.ts +1 -0
- package/src/routes/chromium/ws/page.ts +1 -29
- package/src/routes/chromium/ws/playwright.ts +4 -0
- package/src/routes/firefox/ws/{playwright-firefox.ts → playwright.ts} +5 -5
- package/src/routes/management/http/{static-get.ts → static.get.ts} +2 -2
- package/src/routes/webkit/ws/{playwright-webkit.ts → playwright.ts} +5 -5
- package/src/shared/browser.ws.ts +34 -0
- package/src/{routes/chromium/ws/playwright-chromium.ts → shared/chromium.playwright.ws.ts} +7 -4
- package/src/{routes/chromium/ws/cdp-chromium.ts → shared/chromium.ws.ts} +6 -6
- package/src/{routes/chromium/http/content-post.ts → shared/content.http.ts} +4 -4
- package/src/{routes/chromium/http/download-post.ts → shared/download.http.ts} +4 -4
- package/src/{routes/chromium/http/function-post.ts → shared/function.http.ts} +4 -4
- package/src/shared/json-list.http.ts +35 -0
- package/src/{routes/chromium/http/json-new.ts → shared/json-new.http.ts} +23 -7
- package/src/{routes/chromium/http/json-protocol-get.ts → shared/json-protocol.http.ts} +3 -5
- package/src/{routes/chromium/http/json-version-get.ts → shared/json-version.http.ts} +4 -5
- package/src/shared/page.ws.ts +35 -0
- package/src/{routes/chromium/http/pdf-post.ts → shared/pdf.http.ts} +4 -4
- package/src/{routes/chromium/http/performance.ts → shared/performance.http.ts} +4 -4
- package/src/{routes/chromium/http/scrape-post.ts → shared/scrape.http.ts} +4 -4
- package/src/{routes/chromium/http/screenshot-post.ts → shared/screenshot.http.ts} +4 -4
- package/src/{routes/chromium → shared}/utils/function/handler.ts +2 -2
- package/src/{routes/chromium → shared}/utils/performance/main.ts +1 -2
- package/src/shim.ts +2 -1
- package/src/types.ts +27 -20
- package/src/utils.ts +32 -14
- package/static/devtools/Images/accelerometer-back.svg +1 -0
- package/static/devtools/Images/accelerometer-bottom.png +0 -0
- package/static/devtools/Images/accelerometer-front.svg +1 -0
- package/static/devtools/Images/accelerometer-left.png +0 -0
- package/static/devtools/Images/accelerometer-right.png +0 -0
- package/static/devtools/Images/accelerometer-top.png +0 -0
- package/static/devtools/Images/baseline-icon.svg +1 -0
- package/static/devtools/Images/breaking_change_icon.svg +1 -0
- package/static/devtools/Images/checkboxCheckmark.svg +1 -0
- package/static/devtools/Images/checker.png +0 -0
- package/static/devtools/Images/chevrons.svg +1 -0
- package/static/devtools/Images/chromeDisabledSelect.png +0 -0
- package/static/devtools/Images/chromeDisabledSelect_2x.png +0 -0
- package/static/devtools/Images/chromeLeft.avif +0 -0
- package/static/devtools/Images/chromeMiddle.avif +0 -0
- package/static/devtools/Images/chromeRight.avif +0 -0
- package/static/devtools/Images/chromeSelect.svg +1 -0
- package/static/devtools/Images/chromeSelectDark.svg +1 -0
- package/static/devtools/Images/cssoverview_icons_2x.avif +0 -0
- package/static/devtools/Images/dropdown_7x6_icon.svg +1 -0
- package/static/devtools/Images/elements_panel_icon.svg +1 -0
- package/static/devtools/Images/errorWave.svg +1 -0
- package/static/devtools/Images/error_icon.svg +1 -0
- package/static/devtools/Images/feedback_thin_16x16_icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-center-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-end-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-space-around-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-space-between-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-space-evenly-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-start-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-stretch-icon.svg +1 -0
- package/static/devtools/Images/flex-align-items-center-icon.svg +1 -0
- package/static/devtools/Images/flex-align-items-flex-end-icon.svg +1 -0
- package/static/devtools/Images/flex-align-items-flex-start-icon.svg +1 -0
- package/static/devtools/Images/flex-align-items-stretch-icon.svg +1 -0
- package/static/devtools/Images/flex-align-self-center-icon.svg +1 -0
- package/static/devtools/Images/flex-align-self-flex-end-icon.svg +1 -0
- package/static/devtools/Images/flex-align-self-flex-start-icon.svg +1 -0
- package/static/devtools/Images/flex-align-self-stretch-icon.svg +1 -0
- package/static/devtools/Images/flex-direction-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-center-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-flex-end-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-flex-start-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-space-around-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-space-between-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-space-evenly-icon.svg +1 -0
- package/static/devtools/Images/ic_checkmark_16x16.svg +3 -0
- package/static/devtools/Images/ic_delete_filter.svg +1 -0
- package/static/devtools/Images/ic_delete_list.svg +1 -0
- package/static/devtools/Images/ic_info_black_18dp.svg +1 -0
- package/static/devtools/Images/ic_page_next_16x16_icon.svg +1 -0
- package/static/devtools/Images/ic_page_prev_16x16_icon.svg +1 -0
- package/static/devtools/Images/ic_redo_16x16_icon.svg +1 -0
- package/static/devtools/Images/ic_show_node_16x16.svg +4 -0
- package/static/devtools/Images/ic_suggest_color.svg +6 -0
- package/static/devtools/Images/ic_undo_16x16_icon.svg +1 -0
- package/static/devtools/Images/ic_warning_black_18dp.svg +1 -0
- package/static/devtools/Images/issue-text-icon.svg +1 -0
- package/static/devtools/Images/largeIcons.svg +1 -0
- package/static/devtools/Images/lighthouse_logo.svg +1 -0
- package/static/devtools/Images/link_icon.svg +1 -0
- package/static/devtools/Images/mediumIcons.svg +1 -0
- package/static/devtools/Images/navigationControls.png +0 -0
- package/static/devtools/Images/navigationControls_2x.png +0 -0
- package/static/devtools/Images/network_panel_icon.svg +1 -0
- package/static/devtools/Images/nodeIcon.avif +0 -0
- package/static/devtools/Images/node_search_icon.svg +1 -0
- package/static/devtools/Images/popoverArrows.png +0 -0
- package/static/devtools/Images/profileGroupIcon.png +0 -0
- package/static/devtools/Images/profileIcon.png +0 -0
- package/static/devtools/Images/profileSmallIcon.png +0 -0
- package/static/devtools/Images/radioDot-dark-theme.png +0 -0
- package/static/devtools/Images/radioDot.png +0 -0
- package/static/devtools/Images/refresh_12x12_icon.svg +1 -0
- package/static/devtools/Images/resizeDiagonal.svg +1 -0
- package/static/devtools/Images/resizeHorizontal.svg +1 -0
- package/static/devtools/Images/resizeVertical.svg +1 -0
- package/static/devtools/Images/resourceCSSIcon.png +0 -0
- package/static/devtools/Images/resourceDocumentIcon.png +0 -0
- package/static/devtools/Images/resourceDocumentIconSmall.png +0 -0
- package/static/devtools/Images/resourceJSIcon.png +0 -0
- package/static/devtools/Images/resourcePlainIcon.png +0 -0
- package/static/devtools/Images/resourcePlainIconSmall.png +0 -0
- package/static/devtools/Images/resourcesTimeGraphIcon.avif +0 -0
- package/static/devtools/Images/searchNext.png +0 -0
- package/static/devtools/Images/searchPrev.png +0 -0
- package/static/devtools/Images/securityIcons.svg +1 -0
- package/static/devtools/Images/settings_14x14_icon.svg +1 -0
- package/static/devtools/Images/smallIcons.svg +1 -0
- package/static/devtools/Images/sources_panel_icon.svg +1 -0
- package/static/devtools/Images/speech.png +0 -0
- package/static/devtools/Images/toolbarResizerVertical.png +0 -0
- package/static/devtools/Images/touchCursor.png +0 -0
- package/static/devtools/Images/touchCursor_2x.png +0 -0
- package/static/devtools/Images/treeoutlineTriangles.svg +1 -0
- package/static/devtools/Images/warning_icon.svg +1 -0
- package/static/devtools/Images/whatsnew.avif +0 -0
- package/static/devtools/Tests.js +1654 -0
- package/static/devtools/accessibility/accessibility-legacy.js +1 -0
- package/static/devtools/accessibility/accessibility-meta.js +1 -0
- package/static/devtools/accessibility/accessibility.js +1 -0
- package/static/devtools/accessibility/accessibility_module.js +1 -0
- package/static/devtools/accessibility_test_runner/accessibility_test_runner.js +77 -0
- package/static/devtools/accessibility_test_runner/accessibility_test_runner_module.js +0 -0
- package/static/devtools/animation/animation-legacy.js +1 -0
- package/static/devtools/animation/animation-meta.js +1 -0
- package/static/devtools/animation/animation.js +1 -0
- package/static/devtools/animation/animation_module.js +1 -0
- package/static/devtools/application_test_runner/AppcacheTestRunner.js +220 -0
- package/static/devtools/application_test_runner/CacheStorageTestRunner.js +286 -0
- package/static/devtools/application_test_runner/IndexedDBTestRunner.js +476 -0
- package/static/devtools/application_test_runner/ResourceTreeTestRunner.js +99 -0
- package/static/devtools/application_test_runner/ResourcesTestRunner.js +167 -0
- package/static/devtools/application_test_runner/ServiceWorkersTestRunner.js +131 -0
- package/static/devtools/application_test_runner/application_test_runner.js +10 -0
- package/static/devtools/application_test_runner/application_test_runner_module.js +0 -0
- package/static/devtools/axe_core_test_runner/axe_core_test_runner.js +174 -0
- package/static/devtools/axe_core_test_runner/axe_core_test_runner_module.js +0 -0
- package/static/devtools/bindings/bindings-legacy.js +1 -0
- package/static/devtools/bindings/bindings.js +1 -0
- package/static/devtools/bindings_test_runner/AutomappingTestRunner.js +130 -0
- package/static/devtools/bindings_test_runner/BindingsTestRunner.js +238 -0
- package/static/devtools/bindings_test_runner/IsolatedFilesystemTestRunner.js +287 -0
- package/static/devtools/bindings_test_runner/OverridesTestRunner.js +26 -0
- package/static/devtools/bindings_test_runner/PersistenceTestRunner.js +109 -0
- package/static/devtools/bindings_test_runner/bindings_test_runner.js +9 -0
- package/static/devtools/bindings_test_runner/bindings_test_runner_module.js +0 -0
- package/static/devtools/browser_debugger/browser_debugger-legacy.js +1 -0
- package/static/devtools/browser_debugger/browser_debugger-meta.js +1 -0
- package/static/devtools/browser_debugger/browser_debugger.js +1 -0
- package/static/devtools/browser_debugger/browser_debugger_module.js +1 -0
- package/static/devtools/browser_sdk/browser_sdk-meta.js +1 -0
- package/static/devtools/browser_sdk/browser_sdk.js +1 -0
- package/static/devtools/changes/changes-legacy.js +1 -0
- package/static/devtools/changes/changes-meta.js +1 -0
- package/static/devtools/changes/changes.js +1 -0
- package/static/devtools/changes/changes_module.js +1 -0
- package/static/devtools/client_variations/client_variations.js +1 -0
- package/static/devtools/client_variations/client_variations_module.js +0 -0
- package/static/devtools/cm/cm.js +1 -0
- package/static/devtools/cm/cm_module.js +1 -0
- package/static/devtools/cm_headless/cm_headless.js +1 -0
- package/static/devtools/color_picker/color_picker-legacy.js +1 -0
- package/static/devtools/color_picker/color_picker.js +1 -0
- package/static/devtools/color_picker/color_picker_module.js +1 -0
- package/static/devtools/common/common-legacy.js +1 -0
- package/static/devtools/common/common.js +1 -0
- package/static/devtools/component_helpers/component_helpers.js +1 -0
- package/static/devtools/components/components-legacy.js +1 -0
- package/static/devtools/components/components.js +1 -0
- package/static/devtools/console/console-legacy.js +1 -0
- package/static/devtools/console/console-meta.js +1 -0
- package/static/devtools/console/console.js +6 -0
- package/static/devtools/console/console_module.js +1 -0
- package/static/devtools/console_counters/console_counters-legacy.js +1 -0
- package/static/devtools/console_counters/console_counters.js +1 -0
- package/static/devtools/console_test_runner/console_test_runner.js +696 -0
- package/static/devtools/console_test_runner/console_test_runner_module.js +0 -0
- package/static/devtools/cookie_table/cookie_table-legacy.js +1 -0
- package/static/devtools/cookie_table/cookie_table.js +1 -0
- package/static/devtools/cookie_table/cookie_table_module.js +1 -0
- package/static/devtools/coverage/coverage-legacy.js +1 -0
- package/static/devtools/coverage/coverage-meta.js +1 -0
- package/static/devtools/coverage/coverage.js +1 -0
- package/static/devtools/coverage/coverage_module.js +1 -0
- package/static/devtools/coverage_test_runner/coverage_test_runner.js +151 -0
- package/static/devtools/coverage_test_runner/coverage_test_runner_module.js +0 -0
- package/static/devtools/cpu_profiler_test_runner/cpu_profiler_test_runner.js +72 -0
- package/static/devtools/cpu_profiler_test_runner/cpu_profiler_test_runner_module.js +0 -0
- package/static/devtools/css_overview/css_overview-meta.js +1 -0
- package/static/devtools/css_overview/css_overview.js +146 -0
- package/static/devtools/css_overview/css_overview_module.js +1 -0
- package/static/devtools/data_grid/data_grid-legacy.js +1 -0
- package/static/devtools/data_grid/data_grid.js +1 -0
- package/static/devtools/data_grid/data_grid_module.js +1 -0
- package/static/devtools/data_grid_test_runner/data_grid_test_runner.js +78 -0
- package/static/devtools/data_grid_test_runner/data_grid_test_runner_module.js +0 -0
- package/static/devtools/developer_resources/developer_resources-legacy.js +1 -0
- package/static/devtools/developer_resources/developer_resources-meta.js +1 -0
- package/static/devtools/developer_resources/developer_resources.js +1 -0
- package/static/devtools/developer_resources/developer_resources_module.js +1 -0
- package/static/devtools/device_mode_test_runner/device_mode_test_runner.js +45 -0
- package/static/devtools/device_mode_test_runner/device_mode_test_runner_module.js +0 -0
- package/static/devtools/devtools_app.html +20 -0
- package/static/devtools/devtools_app.js +1 -0
- package/static/devtools/devtools_compatibility.js +1546 -0
- package/static/devtools/diff/diff-legacy.js +1 -0
- package/static/devtools/diff/diff.js +1 -0
- package/static/devtools/diff/diff_module.js +0 -0
- package/static/devtools/dom_extension/dom_extension.js +1 -0
- package/static/devtools/elements/elements-legacy.js +1 -0
- package/static/devtools/elements/elements-meta.js +1 -0
- package/static/devtools/elements/elements.js +469 -0
- package/static/devtools/elements/elements_module.js +1 -0
- package/static/devtools/elements_test_runner/EditDOMTestRunner.js +78 -0
- package/static/devtools/elements_test_runner/ElementsPanelShadowSelectionOnRefreshTestRunner.js +39 -0
- package/static/devtools/elements_test_runner/ElementsTestRunner.js +1280 -0
- package/static/devtools/elements_test_runner/SetOuterHTMLTestRunner.js +115 -0
- package/static/devtools/elements_test_runner/StylesUpdateLinksTestRunner.js +134 -0
- package/static/devtools/elements_test_runner/elements_test_runner.js +9 -0
- package/static/devtools/elements_test_runner/elements_test_runner_module.js +0 -0
- package/static/devtools/emulated_devices/emulated_devices_module.js +0 -0
- package/static/devtools/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPad-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPad-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
- package/static/devtools/emulation/emulation-legacy.js +1 -0
- package/static/devtools/emulation/emulation-meta.js +1 -0
- package/static/devtools/emulation/emulation.js +1 -0
- package/static/devtools/event_listeners/event_listeners-legacy.js +1 -0
- package/static/devtools/event_listeners/event_listeners.js +1 -0
- package/static/devtools/event_listeners/event_listeners_module.js +1 -0
- package/static/devtools/extensions/extensions-legacy.js +1 -0
- package/static/devtools/extensions/extensions.js +1 -0
- package/static/devtools/extensions_test_runner/ExtensionsNetworkTestRunner.js +27 -0
- package/static/devtools/extensions_test_runner/ExtensionsTestRunner.js +68 -0
- package/static/devtools/extensions_test_runner/extensions_test_runner.js +6 -0
- package/static/devtools/extensions_test_runner/extensions_test_runner_module.js +0 -0
- package/static/devtools/formatter/formatter-legacy.js +1 -0
- package/static/devtools/formatter/formatter.js +1 -0
- package/static/devtools/formatter/formatter_module.js +0 -0
- package/static/devtools/formatter_worker/FormatterActions.js +1 -0
- package/static/devtools/formatter_worker/formatter_worker-entrypoint.js +1 -0
- package/static/devtools/formatter_worker/formatter_worker.js +1 -0
- package/static/devtools/har_importer/har_importer-legacy.js +1 -0
- package/static/devtools/har_importer/har_importer.js +1 -0
- package/static/devtools/har_importer/har_importer_module.js +0 -0
- package/static/devtools/heap_profiler_test_runner/heap_profiler_test_runner.js +740 -0
- package/static/devtools/heap_profiler_test_runner/heap_profiler_test_runner_module.js +0 -0
- package/static/devtools/heap_snapshot_model/heap_snapshot_model-legacy.js +1 -0
- package/static/devtools/heap_snapshot_model/heap_snapshot_model.js +1 -0
- package/static/devtools/heap_snapshot_model/heap_snapshot_model_module.js +0 -0
- package/static/devtools/heap_snapshot_worker/heap_snapshot_worker-entrypoint.js +1 -0
- package/static/devtools/heap_snapshot_worker/heap_snapshot_worker-legacy.js +1 -0
- package/static/devtools/heap_snapshot_worker/heap_snapshot_worker.js +1 -0
- package/static/devtools/heap_snapshot_worker/heap_snapshot_worker_module.js +0 -0
- package/static/devtools/help/help-legacy.js +1 -0
- package/static/devtools/help/help-meta.js +1 -0
- package/static/devtools/help/help.js +1 -0
- package/static/devtools/help/help_module.js +1 -0
- package/static/devtools/host/host-legacy.js +1 -0
- package/static/devtools/host/host.js +1 -0
- package/static/devtools/i18n/i18n.js +1 -0
- package/static/devtools/i18n/i18n_locales-tsconfig.json +8 -0
- package/static/devtools/i18n/locales/en-US.json +3566 -0
- package/static/devtools/inline_editor/inline_editor-legacy.js +1 -0
- package/static/devtools/inline_editor/inline_editor.js +203 -0
- package/static/devtools/inline_editor/inline_editor_module.js +1 -0
- package/static/devtools/input/input-legacy.js +1 -0
- package/static/devtools/input/input-meta.js +1 -0
- package/static/devtools/input/input.js +1 -0
- package/static/devtools/input/input_module.js +1 -0
- package/static/devtools/inspector.html +20 -0
- package/static/devtools/inspector.js +1 -0
- package/static/devtools/inspector_main/inspector_main-legacy.js +1 -0
- package/static/devtools/inspector_main/inspector_main-meta.js +1 -0
- package/static/devtools/inspector_main/inspector_main.js +1 -0
- package/static/devtools/integration_test_runner.html +14 -0
- package/static/devtools/integration_test_runner.js +2 -0
- package/static/devtools/issues/issues-legacy.js +1 -0
- package/static/devtools/issues/issues-meta.js +1 -0
- package/static/devtools/issues/issues.js +67 -0
- package/static/devtools/issues/issues_module.js +1 -0
- package/static/devtools/javascript_metadata/javascript_metadata-legacy.js +1 -0
- package/static/devtools/javascript_metadata/javascript_metadata.js +1 -0
- package/static/devtools/javascript_metadata/javascript_metadata_module.js +0 -0
- package/static/devtools/js_app.html +20 -0
- package/static/devtools/js_app.js +1 -0
- package/static/devtools/js_main/js_main-legacy.js +1 -0
- package/static/devtools/js_main/js_main.js +1 -0
- package/static/devtools/js_profiler/js_profiler-meta.js +1 -0
- package/static/devtools/js_profiler/js_profiler.js +1 -0
- package/static/devtools/js_profiler/js_profiler_module.js +0 -0
- package/static/devtools/layer_viewer/layer_viewer-legacy.js +1 -0
- package/static/devtools/layer_viewer/layer_viewer.js +1 -0
- package/static/devtools/layer_viewer/layer_viewer_module.js +1 -0
- package/static/devtools/layers/layers-legacy.js +1 -0
- package/static/devtools/layers/layers-meta.js +1 -0
- package/static/devtools/layers/layers.js +1 -0
- package/static/devtools/layers/layers_module.js +0 -0
- package/static/devtools/layers_test_runner/layers_test_runner.js +156 -0
- package/static/devtools/layers_test_runner/layers_test_runner_module.js +0 -0
- package/static/devtools/lighthouse/lighthouse-legacy.js +1 -0
- package/static/devtools/lighthouse/lighthouse-meta.js +1 -0
- package/static/devtools/lighthouse/lighthouse.js +70 -0
- package/static/devtools/lighthouse/lighthouse_module.js +1 -0
- package/static/devtools/lighthouse_test_runner/lighthouse_test_runner.js +136 -0
- package/static/devtools/lighthouse_test_runner/lighthouse_test_runner_module.js +0 -0
- package/static/devtools/lighthouse_worker/LighthouseService.js +195 -0
- package/static/devtools/lighthouse_worker/lighthouse_worker.js +6 -0
- package/static/devtools/lighthouse_worker.js +1 -0
- package/static/devtools/linear_memory_inspector/linear_memory_inspector-legacy.js +1 -0
- package/static/devtools/linear_memory_inspector/linear_memory_inspector-meta.js +1 -0
- package/static/devtools/linear_memory_inspector/linear_memory_inspector.js +399 -0
- package/static/devtools/linear_memory_inspector/linear_memory_inspector_module.js +0 -0
- package/static/devtools/main/main-legacy.js +1 -0
- package/static/devtools/main/main.js +1 -0
- package/static/devtools/media/media-legacy.js +1 -0
- package/static/devtools/media/media-meta.js +1 -0
- package/static/devtools/media/media.js +1 -0
- package/static/devtools/media/media_module.js +1 -0
- package/static/devtools/mobile_throttling/mobile_throttling-legacy.js +1 -0
- package/static/devtools/mobile_throttling/mobile_throttling-meta.js +1 -0
- package/static/devtools/mobile_throttling/mobile_throttling.js +1 -0
- package/static/devtools/ndb_app.html +20 -0
- package/static/devtools/ndb_app.js +1 -0
- package/static/devtools/network/network-legacy.js +1 -0
- package/static/devtools/network/network-meta.js +1 -0
- package/static/devtools/network/network.js +72 -0
- package/static/devtools/network/network_module.js +1 -0
- package/static/devtools/network_test_runner/network_test_runner.js +280 -0
- package/static/devtools/network_test_runner/network_test_runner_module.js +0 -0
- package/static/devtools/node_app.html +20 -0
- package/static/devtools/node_app.js +1 -0
- package/static/devtools/node_debugger/node_debugger-meta.js +1 -0
- package/static/devtools/node_debugger/node_debugger.js +1 -0
- package/static/devtools/node_debugger/node_debugger_module.js +0 -0
- package/static/devtools/node_main/node_main-legacy.js +1 -0
- package/static/devtools/node_main/node_main-meta.js +1 -0
- package/static/devtools/node_main/node_main.js +1 -0
- package/static/devtools/object_ui/object_ui-legacy.js +1 -0
- package/static/devtools/object_ui/object_ui.js +3 -0
- package/static/devtools/object_ui/object_ui_module.js +1 -0
- package/static/devtools/perf_ui/perf_ui-legacy.js +1 -0
- package/static/devtools/perf_ui/perf_ui.js +152 -0
- package/static/devtools/perf_ui/perf_ui_module.js +1 -0
- package/static/devtools/performance_monitor/performance_monitor-legacy.js +1 -0
- package/static/devtools/performance_monitor/performance_monitor-meta.js +1 -0
- package/static/devtools/performance_monitor/performance_monitor.js +1 -0
- package/static/devtools/performance_monitor/performance_monitor_module.js +1 -0
- package/static/devtools/performance_test_runner/TimelineDataTestRunner.js +5375 -0
- package/static/devtools/performance_test_runner/TimelineTestRunner.js +446 -0
- package/static/devtools/performance_test_runner/performance_test_runner.js +6 -0
- package/static/devtools/performance_test_runner/performance_test_runner_module.js +0 -0
- package/static/devtools/persistence/persistence-legacy.js +1 -0
- package/static/devtools/persistence/persistence-meta.js +1 -0
- package/static/devtools/persistence/persistence.js +1 -0
- package/static/devtools/platform/platform.js +1 -0
- package/static/devtools/profiler/profiler-legacy.js +1 -0
- package/static/devtools/profiler/profiler-meta.js +1 -0
- package/static/devtools/profiler/profiler.js +8 -0
- package/static/devtools/profiler/profiler_module.js +1 -0
- package/static/devtools/protocol_client/protocol_client-legacy.js +1 -0
- package/static/devtools/protocol_client/protocol_client.js +1 -0
- package/static/devtools/protocol_monitor/protocol_monitor-legacy.js +1 -0
- package/static/devtools/protocol_monitor/protocol_monitor-meta.js +1 -0
- package/static/devtools/protocol_monitor/protocol_monitor.js +1 -0
- package/static/devtools/protocol_monitor/protocol_monitor_module.js +1 -0
- package/static/devtools/quick_open/quick_open-legacy.js +1 -0
- package/static/devtools/quick_open/quick_open.js +1 -0
- package/static/devtools/quick_open/quick_open_module.js +1 -0
- package/static/devtools/recorder/recorder.js +1 -0
- package/static/devtools/resources/resources-legacy.js +1 -0
- package/static/devtools/resources/resources-meta.js +1 -0
- package/static/devtools/resources/resources.js +28 -0
- package/static/devtools/resources/resources_module.js +1 -0
- package/static/devtools/root/root-legacy.js +1 -0
- package/static/devtools/root/root.js +1 -0
- package/static/devtools/screencast/screencast-legacy.js +1 -0
- package/static/devtools/screencast/screencast.js +1 -0
- package/static/devtools/sdk/sdk-legacy.js +1 -0
- package/static/devtools/sdk/sdk.js +2 -0
- package/static/devtools/sdk_test_runner/sdk_test_runner.js +297 -0
- package/static/devtools/sdk_test_runner/sdk_test_runner_module.js +0 -0
- package/static/devtools/search/search-legacy.js +1 -0
- package/static/devtools/search/search.js +1 -0
- package/static/devtools/search/search_module.js +1 -0
- package/static/devtools/security/security-legacy.js +1 -0
- package/static/devtools/security/security-meta.js +1 -0
- package/static/devtools/security/security.js +1 -0
- package/static/devtools/security/security_module.js +1 -0
- package/static/devtools/security_test_runner/security_test_runner.js +32 -0
- package/static/devtools/security_test_runner/security_test_runner_module.js +0 -0
- package/static/devtools/services/services-legacy.js +1 -0
- package/static/devtools/services/services.js +1 -0
- package/static/devtools/settings/settings-legacy.js +1 -0
- package/static/devtools/settings/settings-meta.js +1 -0
- package/static/devtools/settings/settings.js +1 -0
- package/static/devtools/settings/settings_module.js +1 -0
- package/static/devtools/shell.js +1 -0
- package/static/devtools/snippets/snippets-legacy.js +1 -0
- package/static/devtools/snippets/snippets.js +1 -0
- package/static/devtools/snippets/snippets_module.js +0 -0
- package/static/devtools/source_frame/source_frame-legacy.js +1 -0
- package/static/devtools/source_frame/source_frame.js +1 -0
- package/static/devtools/source_frame/source_frame_module.js +1 -0
- package/static/devtools/sources/sources-legacy.js +1 -0
- package/static/devtools/sources/sources-meta.js +1 -0
- package/static/devtools/sources/sources.js +13 -0
- package/static/devtools/sources/sources_module.js +1 -0
- package/static/devtools/sources_test_runner/AutocompleteTestRunner.js +46 -0
- package/static/devtools/sources_test_runner/DebuggerTestRunner.js +895 -0
- package/static/devtools/sources_test_runner/EditorTestRunner.js +237 -0
- package/static/devtools/sources_test_runner/LiveEditTestRunner.js +33 -0
- package/static/devtools/sources_test_runner/SearchTestRunner.js +158 -0
- package/static/devtools/sources_test_runner/SourcesTestRunner.js +173 -0
- package/static/devtools/sources_test_runner/sources_test_runner.js +10 -0
- package/static/devtools/sources_test_runner/sources_test_runner_module.js +0 -0
- package/static/devtools/startup/startup.js +1 -0
- package/static/devtools/test_runner/test_runner.js +1 -0
- package/static/devtools/text_editor/text_editor-legacy.js +1 -0
- package/static/devtools/text_editor/text_editor.js +1 -0
- package/static/devtools/text_editor/text_editor_module.js +1 -0
- package/static/devtools/text_utils/text_utils-legacy.js +1 -0
- package/static/devtools/text_utils/text_utils.js +1 -0
- package/static/devtools/theme_support/theme_support.js +1 -0
- package/static/devtools/third_party/acorn/acorn-tsconfig.json +8 -0
- package/static/devtools/third_party/acorn/acorn.js +1 -0
- package/static/devtools/third_party/acorn/package/dist/acorn.d.ts +209 -0
- package/static/devtools/third_party/acorn/package/dist/acorn.mjs +5261 -0
- package/static/devtools/third_party/acorn/package/dist/acorn.mjs.d.ts +2 -0
- package/static/devtools/third_party/acorn/package/dist/acorn.mjs.map +1 -0
- package/static/devtools/third_party/acorn-loose/acorn-loose-tsconfig.json +8 -0
- package/static/devtools/third_party/acorn-loose/package/dist/acorn-loose.d.ts +16 -0
- package/static/devtools/third_party/acorn-loose/package/dist/acorn-loose.mjs +1418 -0
- package/static/devtools/third_party/axe-core/axe.js +16423 -0
- package/static/devtools/third_party/chromium/chromium-tsconfig.json +8 -0
- package/static/devtools/third_party/chromium/client-variations/ClientVariations.d.ts +13 -0
- package/static/devtools/third_party/chromium/client-variations/ClientVariations.js +27 -0
- package/static/devtools/third_party/codemirror/codemirror-tsconfig.json +72 -0
- package/static/devtools/third_party/codemirror/package/addon/comment/comment.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/addon/comment/comment.js +211 -0
- package/static/devtools/third_party/codemirror/package/addon/edit/closebrackets.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/edit/closebrackets.js +201 -0
- package/static/devtools/third_party/codemirror/package/addon/edit/matchbrackets.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/edit/matchbrackets.js +158 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/brace-fold.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/brace-fold.js +105 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/foldcode.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/foldcode.js +157 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/foldgutter.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/foldgutter.js +163 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/multiplex.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/multiplex.js +131 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/overlay.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/overlay.js +90 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/simple.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/simple.js +216 -0
- package/static/devtools/third_party/codemirror/package/addon/runmode/runmode-standalone.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/runmode/runmode-standalone.js +333 -0
- package/static/devtools/third_party/codemirror/package/addon/selection/active-line.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/selection/active-line.js +72 -0
- package/static/devtools/third_party/codemirror/package/addon/selection/mark-selection.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/selection/mark-selection.js +119 -0
- package/static/devtools/third_party/codemirror/package/lib/codemirror.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/lib/codemirror.js +9800 -0
- package/static/devtools/third_party/codemirror/package/mode/clike/clike.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/clike/clike.js +935 -0
- package/static/devtools/third_party/codemirror/package/mode/clojure/clojure.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/clojure/clojure.js +292 -0
- package/static/devtools/third_party/codemirror/package/mode/coffeescript/coffeescript.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/coffeescript/coffeescript.js +359 -0
- package/static/devtools/third_party/codemirror/package/mode/css/css.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/css/css.js +864 -0
- package/static/devtools/third_party/codemirror/package/mode/htmlembedded/htmlembedded.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/htmlembedded/htmlembedded.js +37 -0
- package/static/devtools/third_party/codemirror/package/mode/htmlmixed/htmlmixed.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/htmlmixed/htmlmixed.js +153 -0
- package/static/devtools/third_party/codemirror/package/mode/javascript/javascript.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/javascript/javascript.js +942 -0
- package/static/devtools/third_party/codemirror/package/mode/jsx/jsx.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/jsx/jsx.js +148 -0
- package/static/devtools/third_party/codemirror/package/mode/livescript/livescript.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/livescript/livescript.js +280 -0
- package/static/devtools/third_party/codemirror/package/mode/markdown/markdown.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/markdown/markdown.js +886 -0
- package/static/devtools/third_party/codemirror/package/mode/php/php.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/php/php.js +234 -0
- package/static/devtools/third_party/codemirror/package/mode/python/python.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/python/python.js +399 -0
- package/static/devtools/third_party/codemirror/package/mode/shell/shell.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/shell/shell.js +168 -0
- package/static/devtools/third_party/codemirror/package/mode/wast/wast.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/wast/wast.js +41 -0
- package/static/devtools/third_party/codemirror/package/mode/xml/xml.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/xml/xml.js +413 -0
- package/static/devtools/third_party/i18n/bundle-tsconfig.json +8 -0
- package/static/devtools/third_party/i18n/i18n.d.ts +108 -0
- package/static/devtools/third_party/i18n/i18n.js +4336 -0
- package/static/devtools/third_party/lighthouse/lighthouse-dt-bundle.d.ts +1 -0
- package/static/devtools/third_party/lighthouse/lighthouse-dt-bundle.js +1140 -0
- package/static/devtools/third_party/lighthouse/lighthouse-tsconfig.json +10 -0
- package/static/devtools/third_party/lighthouse/locales/ar-XB.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ar.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/bg.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ca.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/cs.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/da.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/de.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/el.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/en-GB.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/en-US.json +2297 -0
- package/static/devtools/third_party/lighthouse/locales/en-XA.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/en-XL.json +2297 -0
- package/static/devtools/third_party/lighthouse/locales/es-419.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/es.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/fi.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/fil.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/fr.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/he.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/hi.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/hr.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/hu.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/id.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/it.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ja.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ko.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/lt.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/lv.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/nl.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/no.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/pl.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/pt-PT.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/pt.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ro.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ru.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sk.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sl.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sr-Latn.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sr.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sv.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ta.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/te.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/th.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/tr.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/uk.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/vi.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/zh-HK.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/zh-TW.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/zh.json +2066 -0
- package/static/devtools/third_party/lighthouse/report-assets/report-generator.d.ts +1 -0
- package/static/devtools/third_party/lighthouse/report-assets/report-generator.js +167 -0
- package/static/devtools/third_party/lighthouse/report-assets/report.d.ts +1 -0
- package/static/devtools/third_party/lighthouse/report-assets/report.js +5032 -0
- package/static/devtools/third_party/lit-html/lit-html-tsconfig.json +22 -0
- package/static/devtools/third_party/lit-html/lit-html.js +120 -0
- package/static/devtools/third_party/lit-html/package/directives/class-map.d.ts +28 -0
- package/static/devtools/third_party/lit-html/package/directives/class-map.js +101 -0
- package/static/devtools/third_party/lit-html/package/directives/class-map.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/directives/if-defined.d.ts +22 -0
- package/static/devtools/third_party/lit-html/package/directives/if-defined.js +37 -0
- package/static/devtools/third_party/lit-html/package/directives/if-defined.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/directives/live.d.ts +38 -0
- package/static/devtools/third_party/lit-html/package/directives/live.js +73 -0
- package/static/devtools/third_party/lit-html/package/directives/live.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/directives/repeat.d.ts +37 -0
- package/static/devtools/third_party/lit-html/package/directives/repeat.js +415 -0
- package/static/devtools/third_party/lit-html/package/directives/repeat.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/directives/style-map.d.ts +36 -0
- package/static/devtools/third_party/lit-html/package/directives/style-map.js +78 -0
- package/static/devtools/third_party/lit-html/package/directives/style-map.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/default-template-processor.d.ts +39 -0
- package/static/devtools/third_party/lit-html/package/lib/default-template-processor.js +52 -0
- package/static/devtools/third_party/lit-html/package/lib/default-template-processor.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/directive.d.ts +59 -0
- package/static/devtools/third_party/lit-html/package/lib/directive.js +63 -0
- package/static/devtools/third_party/lit-html/package/lib/directive.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/dom.d.ts +29 -0
- package/static/devtools/third_party/lit-html/package/lib/dom.js +44 -0
- package/static/devtools/third_party/lit-html/package/lib/dom.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/part.d.ts +46 -0
- package/static/devtools/third_party/lit-html/package/lib/part.js +23 -0
- package/static/devtools/third_party/lit-html/package/lib/part.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/parts.d.ts +148 -0
- package/static/devtools/third_party/lit-html/package/lib/parts.js +476 -0
- package/static/devtools/third_party/lit-html/package/lib/parts.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/render.d.ts +33 -0
- package/static/devtools/third_party/lit-html/package/lib/render.js +43 -0
- package/static/devtools/third_party/lit-html/package/lib/render.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/template-factory.d.ts +57 -0
- package/static/devtools/third_party/lit-html/package/lib/template-factory.js +48 -0
- package/static/devtools/third_party/lit-html/package/lib/template-factory.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/template-instance.d.ts +30 -0
- package/static/devtools/third_party/lit-html/package/lib/template-instance.js +134 -0
- package/static/devtools/third_party/lit-html/package/lib/template-instance.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/template-result.d.ts +42 -0
- package/static/devtools/third_party/lit-html/package/lib/template-result.js +131 -0
- package/static/devtools/third_party/lit-html/package/lib/template-result.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/template.d.ts +92 -0
- package/static/devtools/third_party/lit-html/package/lib/template.js +215 -0
- package/static/devtools/third_party/lit-html/package/lib/template.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lit-html.d.ts +42 -0
- package/static/devtools/third_party/lit-html/package/lit-html.js +59 -0
- package/static/devtools/third_party/lit-html/package/lit-html.js.map +1 -0
- package/static/devtools/third_party/marked/marked-tsconfig.json +8 -0
- package/static/devtools/third_party/marked/marked.js +1 -0
- package/static/devtools/third_party/marked/package/lib/marked.esm.d.ts +1 -0
- package/static/devtools/third_party/marked/package/lib/marked.esm.js +2584 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.d.ts +53 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.js +64 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.d.ts +176 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.js +356 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.d.ts +21 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +81 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +423 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +516 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts +39 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +76 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserWebSocketTransport.d.ts +26 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserWebSocketTransport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserWebSocketTransport.js +30 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +120 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js +266 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.d.ts +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.js +15 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +72 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +60 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts +181 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js +316 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts +174 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +647 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts +53 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.js +77 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.d.ts +33 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.js +873 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts +76 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.js +92 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EmulationManager.d.ts +25 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EmulationManager.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EmulationManager.js +33 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts +34 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js +37 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts +59 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.js +15 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts +89 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js +109 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Events.d.ts +82 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Events.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Events.js +83 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts +189 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.js +313 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts +60 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.js +66 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +735 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +962 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts +276 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js +421 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts +128 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js +150 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts +322 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.js +463 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +439 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +724 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts +62 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js +145 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts +80 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js +262 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts +152 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.js +31 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts +910 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +1343 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Product.d.ts +21 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Product.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Product.js +15 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts +135 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js +133 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PuppeteerViewport.d.ts +24 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PuppeteerViewport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PuppeteerViewport.js +0 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts +66 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.js +157 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/SecurityDetails.d.ts +61 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/SecurityDetails.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/SecurityDetails.js +72 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts +98 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.js +137 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/TimeoutSettings.d.ts +28 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/TimeoutSettings.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/TimeoutSettings.js +43 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.d.ts +47 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.js +94 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/USKeyboardLayout.d.ts +40 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/USKeyboardLayout.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/USKeyboardLayout.js +403 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts +102 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js +109 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.d.ts +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.js +24 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.d.ts +17 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.js +20 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.d.ts +66 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.js +288 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts +17 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/environment.js +16 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.js +39 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-web.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-web.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-web.js +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts +132 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js +468 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts +40 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js +197 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +42 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.js +0 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts +16 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js +469 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts +29 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.js +34 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts +31 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js +61 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts +156 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +183 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/install.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/install.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js +151 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.js +23 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node.js +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +19 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/web.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/web.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/web.js +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.d.ts +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.js +53 -0
- package/static/devtools/third_party/puppeteer/puppeteer-tsconfig.json +58 -0
- package/static/devtools/third_party/puppeteer/puppeteer.js +1 -0
- package/static/devtools/third_party/wasmparser/package/dist/esm/WasmDis.js +1595 -0
- package/static/devtools/third_party/wasmparser/package/dist/esm/WasmParser.js +3120 -0
- package/static/devtools/third_party/wasmparser/wasmparser-tsconfig.json +9 -0
- package/static/devtools/timeline/timeline-legacy.js +1 -0
- package/static/devtools/timeline/timeline-meta.js +1 -0
- package/static/devtools/timeline/timeline.js +1 -0
- package/static/devtools/timeline/timeline_module.js +1 -0
- package/static/devtools/timeline_model/timeline_model-legacy.js +1 -0
- package/static/devtools/timeline_model/timeline_model.js +1 -0
- package/static/devtools/timeline_model/timeline_model_module.js +0 -0
- package/static/devtools/toolbox.html +20 -0
- package/static/devtools/toolbox.js +1 -0
- package/static/devtools/toolbox_bootstrap/toolbox_bootstrap.js +1 -0
- package/static/devtools/ui/components/components.js +378 -0
- package/static/devtools/ui/ui-legacy.js +1 -0
- package/static/devtools/ui/ui.js +3 -0
- package/static/devtools/ui/utils/utils.js +1 -0
- package/static/devtools/wasmparser_worker/wasmparser_worker-entrypoint.js +1 -0
- package/static/devtools/wasmparser_worker/wasmparser_worker.js +1 -0
- package/static/devtools/web_audio/graph_visualizer/graph_visualizer.js +1 -0
- package/static/devtools/web_audio/web_audio-legacy.js +1 -0
- package/static/devtools/web_audio/web_audio-meta.js +1 -0
- package/static/devtools/web_audio/web_audio.js +23 -0
- package/static/devtools/web_audio/web_audio_module.js +1 -0
- package/static/devtools/webauthn/webauthn-legacy.js +1 -0
- package/static/devtools/webauthn/webauthn-meta.js +1 -0
- package/static/devtools/webauthn/webauthn.js +6 -0
- package/static/devtools/webauthn/webauthn_module.js +1 -0
- package/static/devtools/worker_app.html +20 -0
- package/static/devtools/worker_app.js +1 -0
- package/static/devtools/worker_main/worker_main-legacy.js +1 -0
- package/static/devtools/worker_main/worker_main.js +1 -0
- package/static/devtools/worker_service/worker_service.js +1 -0
- package/static/devtools/workspace/workspace-legacy.js +1 -0
- package/static/devtools/workspace/workspace.js +1 -0
- package/static/devtools/workspace_diff/workspace_diff-legacy.js +1 -0
- package/static/devtools/workspace_diff/workspace_diff.js +1 -0
- package/static/devtools/workspace_diff/workspace_diff_module.js +0 -0
- package/static/docs/swagger.json +2337 -279
- package/static/function/client.js +1037 -992
- package/build/routes/chromium/http/json-new.js +0 -23
- package/build/routes/chromium/http/json-version-get.response.json +0 -37
- package/build/routes/chromium/utils/cdp.d.ts +0 -2
- package/build/routes/chromium/utils/cdp.js +0 -14
- package/build/routes/chromium/ws/cdp-chromium.js +0 -10
- package/src/routes/chromium/http/json-list.ts +0 -50
- package/src/routes/chromium/utils/cdp.ts +0 -19
- package/build/routes/{chromium/http/content-post.query.json → chrome/http/content.post.query.json} +0 -0
- package/build/routes/{chromium/http/content-post.response.json → chrome/http/content.post.response.json} +0 -0
- package/build/routes/{chromium/http/download-post.body.json → chrome/http/download.post.body.json} +0 -0
- package/build/routes/{chromium/http/download-post.query.json → chrome/http/download.post.query.json} +0 -0
- package/build/routes/{chromium/http/download-post.response.json → chrome/http/download.post.response.json} +0 -0
- package/build/routes/{chromium/http/function-post.body.json → chrome/http/function.post.body.json} +0 -0
- package/build/routes/{chromium/http/function-post.query.json → chrome/http/function.post.query.json} +0 -0
- package/build/routes/{chromium/http/function-post.response.json → chrome/http/function.post.response.json} +0 -0
- package/build/routes/{chromium/http/json-list.response.json → chrome/http/json-list.get.response.json} +0 -0
- package/build/routes/{chromium/http/json-new.response.json → chrome/http/json-new.put.response.json} +0 -0
- package/build/routes/{chromium/http/json-protocol-get.response.json → chrome/http/json-protocol.get.response.json} +0 -0
- package/build/routes/{chromium/http/pdf-post.query.json → chrome/http/pdf.post.query.json} +0 -0
- package/build/routes/{chromium/http/pdf-post.response.json → chrome/http/pdf.post.response.json} +0 -0
- package/build/routes/{chromium/http/performance.body.json → chrome/http/performance.post.body.json} +0 -0
- package/build/routes/{chromium/http/performance.query.json → chrome/http/performance.post.query.json} +0 -0
- package/build/routes/{chromium/http/performance.response.json → chrome/http/performance.post.response.json} +0 -0
- package/build/routes/{chromium/http/scrape-post.query.json → chrome/http/scrape.post.query.json} +0 -0
- package/build/routes/{chromium/http/scrape-post.response.json → chrome/http/scrape.post.response.json} +0 -0
- package/build/routes/{chromium/http/screenshot-post.query.json → chrome/http/screenshot.post.query.json} +0 -0
- package/build/routes/{chromium/http/screenshot-post.response.json → chrome/http/screenshot.post.response.json} +0 -0
- package/build/routes/{chromium/utils/performance/child.d.ts → chrome/tests/content.spec.d.ts} +0 -0
- package/build/routes/{chromium/utils/performance/types.js → chrome/tests/download.spec.d.ts} +0 -0
- package/build/routes/{chromium/ws/cdp-chromium.query.json → chrome/ws/browser.query.json} +0 -0
- package/build/routes/{chromium/ws/playwright-chromium.query.json → chrome/ws/playwright.query.json} +0 -0
- package/build/routes/{firefox/ws/playwright-firefox.query.json → chromium/ws/playwright.query.json} +0 -0
- package/build/routes/{webkit/ws/playwright-webkit.query.json → firefox/ws/playwright.query.json} +0 -0
- package/build/routes/management/http/{config-get.d.ts → config.get.d.ts} +0 -0
- package/build/routes/management/http/{config-get.js → config.get.js} +0 -0
- package/build/routes/management/http/{config-get.response.json → config.get.response.json} +0 -0
- package/build/routes/management/http/{metrics-total-get.d.ts → metrics-total.get.d.ts} +0 -0
- package/build/routes/management/http/{metrics-total-get.js → metrics-total.get.js} +0 -0
- package/build/routes/management/http/{metrics-total-get.response.json → metrics-total.get.response.json} +0 -0
- package/build/routes/management/http/{metrics-get.d.ts → metrics.get.d.ts} +0 -0
- package/build/routes/management/http/{metrics-get.js → metrics.get.js} +0 -0
- package/build/routes/management/http/{metrics-get.response.json → metrics.get.response.json} +0 -0
- package/build/routes/management/http/{sessions-get.d.ts → sessions.get.d.ts} +0 -0
- package/build/routes/management/http/{sessions-get.js → sessions.get.js} +0 -0
- package/build/routes/management/http/{static-get.d.ts → static.get.d.ts} +0 -0
- package/build/{routes/chromium/http/json-protocol-get.d.ts → shared/json-protocol.http.d.ts} +1 -1
- package/build/{routes/chromium/http/json-version-get.d.ts → shared/json-version.http.d.ts} +1 -1
- /package/build/{routes/chromium → shared}/utils/function/client.d.ts +0 -0
- /package/build/{routes/chromium → shared}/utils/function/client.js +0 -0
- /package/build/{routes/chromium → shared}/utils/function/handler.d.ts +0 -0
- /package/build/{routes/chromium → shared}/utils/function/handler.js +0 -0
- /package/build/{routes/chromium → shared}/utils/performance/child.js +0 -0
- /package/build/{routes/chromium → shared}/utils/performance/main.d.ts +0 -0
- /package/build/{routes/chromium → shared}/utils/performance/types.d.ts +0 -0
- /package/src/routes/management/http/{config-get.ts → config.get.ts} +0 -0
- /package/src/routes/management/http/{metrics-total-get.ts → metrics-total.get.ts} +0 -0
- /package/src/routes/management/http/{metrics-get.ts → metrics.get.ts} +0 -0
- /package/src/routes/management/http/{sessions-get.ts → sessions.get.ts} +0 -0
- /package/src/{routes/chromium → shared}/utils/function/client.ts +0 -0
- /package/src/{routes/chromium → shared}/utils/performance/child.ts +0 -0
- /package/src/{routes/chromium → shared}/utils/performance/types.ts +0 -0
|
@@ -0,0 +1,1343 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2017 Google Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { isNode } from '../environment.js';
|
|
17
|
+
|
|
18
|
+
import { Accessibility } from './Accessibility.js';
|
|
19
|
+
import { assert } from './assert.js';
|
|
20
|
+
import { CDPSessionEmittedEvents, Connection, } from './Connection.js';
|
|
21
|
+
import { ConsoleMessage } from './ConsoleMessage.js';
|
|
22
|
+
import { Coverage } from './Coverage.js';
|
|
23
|
+
import { Dialog } from './Dialog.js';
|
|
24
|
+
import { EmulationManager } from './EmulationManager.js';
|
|
25
|
+
import { EventEmitter } from './EventEmitter.js';
|
|
26
|
+
import { FileChooser } from './FileChooser.js';
|
|
27
|
+
import { FrameManager, FrameManagerEmittedEvents, } from './FrameManager.js';
|
|
28
|
+
import { debugError , helper} from './helper.js';
|
|
29
|
+
import { Keyboard, Mouse, Touchscreen } from './Input.js';
|
|
30
|
+
import { createJSHandle } from './JSHandle.js';
|
|
31
|
+
import { NetworkManagerEmittedEvents } from './NetworkManager.js';
|
|
32
|
+
import { paperFormats } from './PDFOptions.js';
|
|
33
|
+
import { TimeoutSettings } from './TimeoutSettings.js';
|
|
34
|
+
import { Tracing } from './Tracing.js';
|
|
35
|
+
import { WebWorker } from './WebWorker.js';
|
|
36
|
+
|
|
37
|
+
class ScreenshotTaskQueue {
|
|
38
|
+
constructor() {
|
|
39
|
+
this._chain = Promise.resolve(undefined);
|
|
40
|
+
}
|
|
41
|
+
postTask(task) {
|
|
42
|
+
const result = this._chain.then(task);
|
|
43
|
+
this._chain = result.catch(() => { });
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Page provides methods to interact with a single tab or
|
|
49
|
+
* {@link https://developer.chrome.com/extensions/background_pages | extension background page} in Chromium.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
*
|
|
53
|
+
* One Browser instance might have multiple Page instances.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* This example creates a page, navigates it to a URL, and then * saves a screenshot:
|
|
57
|
+
* ```js
|
|
58
|
+
* const puppeteer = require('puppeteer');
|
|
59
|
+
*
|
|
60
|
+
* (async () => {
|
|
61
|
+
* const browser = await puppeteer.launch();
|
|
62
|
+
* const page = await browser.newPage();
|
|
63
|
+
* await page.goto('https://example.com');
|
|
64
|
+
* await page.screenshot({path: 'screenshot.png'});
|
|
65
|
+
* await browser.close();
|
|
66
|
+
* })();
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* The Page class extends from Puppeteer's {@link EventEmitter} class and will
|
|
70
|
+
* emit various events which are documented in the {@link PageEmittedEvents} enum.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* This example logs a message for a single page `load` event:
|
|
74
|
+
* ```js
|
|
75
|
+
* page.once('load', () => console.log('Page loaded!'));
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* To unsubscribe from events use the `off` method:
|
|
79
|
+
*
|
|
80
|
+
* ```js
|
|
81
|
+
* function logRequest(interceptedRequest) {
|
|
82
|
+
* console.log('A request was made:', interceptedRequest.url());
|
|
83
|
+
* }
|
|
84
|
+
* page.on('request', logRequest);
|
|
85
|
+
* // Sometime later...
|
|
86
|
+
* page.off('request', logRequest);
|
|
87
|
+
* ```
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
export class Page extends EventEmitter {
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
constructor(client, target, ignoreHTTPSErrors) {
|
|
95
|
+
super();
|
|
96
|
+
this._closed = false;
|
|
97
|
+
this._timeoutSettings = new TimeoutSettings();
|
|
98
|
+
this._pageBindings = new Map();
|
|
99
|
+
this._javascriptEnabled = true;
|
|
100
|
+
this._workers = new Map();
|
|
101
|
+
// TODO: improve this typedef - it's a function that takes a file chooser or
|
|
102
|
+
// something?
|
|
103
|
+
this._fileChooserInterceptors = new Set();
|
|
104
|
+
this._client = client;
|
|
105
|
+
this._target = target;
|
|
106
|
+
this._keyboard = new Keyboard(client);
|
|
107
|
+
this._mouse = new Mouse(client, this._keyboard);
|
|
108
|
+
this._touchscreen = new Touchscreen(client, this._keyboard);
|
|
109
|
+
this._accessibility = new Accessibility(client);
|
|
110
|
+
this._frameManager = new FrameManager(client, this, ignoreHTTPSErrors, this._timeoutSettings);
|
|
111
|
+
this._emulationManager = new EmulationManager(client);
|
|
112
|
+
this._tracing = new Tracing(client);
|
|
113
|
+
this._coverage = new Coverage(client);
|
|
114
|
+
this._screenshotTaskQueue = new ScreenshotTaskQueue();
|
|
115
|
+
this._viewport = null;
|
|
116
|
+
client.on('Target.attachedToTarget', (event) => {
|
|
117
|
+
if (event.targetInfo.type !== 'worker') {
|
|
118
|
+
// If we don't detach from service workers, they will never die.
|
|
119
|
+
client
|
|
120
|
+
.send('Target.detachFromTarget', {
|
|
121
|
+
sessionId: event.sessionId,
|
|
122
|
+
})
|
|
123
|
+
.catch(debugError);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const session = Connection.fromSession(client).session(event.sessionId);
|
|
127
|
+
const worker = new WebWorker(session, event.targetInfo.url, this._addConsoleMessage.bind(this), this._handleException.bind(this));
|
|
128
|
+
this._workers.set(event.sessionId, worker);
|
|
129
|
+
this.emit("workercreated" /* WorkerCreated */, worker);
|
|
130
|
+
});
|
|
131
|
+
client.on('Target.detachedFromTarget', (event) => {
|
|
132
|
+
const worker = this._workers.get(event.sessionId);
|
|
133
|
+
if (!worker)
|
|
134
|
+
return;
|
|
135
|
+
this.emit("workerdestroyed" /* WorkerDestroyed */, worker);
|
|
136
|
+
this._workers.delete(event.sessionId);
|
|
137
|
+
});
|
|
138
|
+
this._frameManager.on(FrameManagerEmittedEvents.FrameAttached, (event) => this.emit("frameattached" /* FrameAttached */, event));
|
|
139
|
+
this._frameManager.on(FrameManagerEmittedEvents.FrameDetached, (event) => this.emit("framedetached" /* FrameDetached */, event));
|
|
140
|
+
this._frameManager.on(FrameManagerEmittedEvents.FrameNavigated, (event) => this.emit("framenavigated" /* FrameNavigated */, event));
|
|
141
|
+
const networkManager = this._frameManager.networkManager();
|
|
142
|
+
networkManager.on(NetworkManagerEmittedEvents.Request, (event) => this.emit("request" /* Request */, event));
|
|
143
|
+
networkManager.on(NetworkManagerEmittedEvents.Response, (event) => this.emit("response" /* Response */, event));
|
|
144
|
+
networkManager.on(NetworkManagerEmittedEvents.RequestFailed, (event) => this.emit("requestfailed" /* RequestFailed */, event));
|
|
145
|
+
networkManager.on(NetworkManagerEmittedEvents.RequestFinished, (event) => this.emit("requestfinished" /* RequestFinished */, event));
|
|
146
|
+
this._fileChooserInterceptors = new Set();
|
|
147
|
+
client.on('Page.domContentEventFired', () => this.emit("domcontentloaded" /* DOMContentLoaded */));
|
|
148
|
+
client.on('Page.loadEventFired', () => this.emit("load" /* Load */));
|
|
149
|
+
client.on('Runtime.consoleAPICalled', (event) => this._onConsoleAPI(event));
|
|
150
|
+
client.on('Runtime.bindingCalled', (event) => this._onBindingCalled(event));
|
|
151
|
+
client.on('Page.javascriptDialogOpening', (event) => this._onDialog(event));
|
|
152
|
+
client.on('Runtime.exceptionThrown', (exception) => this._handleException(exception.exceptionDetails));
|
|
153
|
+
client.on('Inspector.targetCrashed', () => this._onTargetCrashed());
|
|
154
|
+
client.on('Performance.metrics', (event) => this._emitMetrics(event));
|
|
155
|
+
client.on('Log.entryAdded', (event) => this._onLogEntryAdded(event));
|
|
156
|
+
client.on('Page.fileChooserOpened', (event) => this._onFileChooser(event));
|
|
157
|
+
this._target._isClosedPromise.then(() => {
|
|
158
|
+
this.emit("close" /* Close */);
|
|
159
|
+
this._closed = true;
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* @internal
|
|
164
|
+
*/
|
|
165
|
+
static async create(client, target, ignoreHTTPSErrors, defaultViewport) {
|
|
166
|
+
const page = new Page(client, target, ignoreHTTPSErrors);
|
|
167
|
+
await page._initialize();
|
|
168
|
+
if (defaultViewport)
|
|
169
|
+
await page.setViewport(defaultViewport);
|
|
170
|
+
return page;
|
|
171
|
+
}
|
|
172
|
+
async _initialize() {
|
|
173
|
+
await Promise.all([
|
|
174
|
+
this._frameManager.initialize(),
|
|
175
|
+
this._client.send('Target.setAutoAttach', {
|
|
176
|
+
autoAttach: true,
|
|
177
|
+
waitForDebuggerOnStart: false,
|
|
178
|
+
flatten: true,
|
|
179
|
+
}),
|
|
180
|
+
this._client.send('Performance.enable'),
|
|
181
|
+
this._client.send('Log.enable'),
|
|
182
|
+
]);
|
|
183
|
+
}
|
|
184
|
+
async _onFileChooser(event) {
|
|
185
|
+
if (!this._fileChooserInterceptors.size)
|
|
186
|
+
return;
|
|
187
|
+
const frame = this._frameManager.frame(event.frameId);
|
|
188
|
+
const context = await frame.executionContext();
|
|
189
|
+
const element = await context._adoptBackendNodeId(event.backendNodeId);
|
|
190
|
+
const interceptors = Array.from(this._fileChooserInterceptors);
|
|
191
|
+
this._fileChooserInterceptors.clear();
|
|
192
|
+
const fileChooser = new FileChooser(element, event);
|
|
193
|
+
for (const interceptor of interceptors)
|
|
194
|
+
interceptor.call(null, fileChooser);
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* @returns `true` if the page has JavaScript enabled, `false` otherwise.
|
|
198
|
+
*/
|
|
199
|
+
isJavaScriptEnabled() {
|
|
200
|
+
return this._javascriptEnabled;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* @param options - Optional waiting parameters
|
|
204
|
+
* @returns Resolves after a page requests a file picker.
|
|
205
|
+
*/
|
|
206
|
+
async waitForFileChooser(options = {}) {
|
|
207
|
+
if (!this._fileChooserInterceptors.size)
|
|
208
|
+
await this._client.send('Page.setInterceptFileChooserDialog', {
|
|
209
|
+
enabled: true,
|
|
210
|
+
});
|
|
211
|
+
const { timeout = this._timeoutSettings.timeout() } = options;
|
|
212
|
+
let callback;
|
|
213
|
+
const promise = new Promise((x) => (callback = x));
|
|
214
|
+
this._fileChooserInterceptors.add(callback);
|
|
215
|
+
return helper
|
|
216
|
+
.waitWithTimeout(promise, 'waiting for file chooser', timeout)
|
|
217
|
+
.catch((error) => {
|
|
218
|
+
this._fileChooserInterceptors.delete(callback);
|
|
219
|
+
throw error;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Sets the page's geolocation.
|
|
224
|
+
*
|
|
225
|
+
* @remarks
|
|
226
|
+
* Consider using {@link BrowserContext.overridePermissions} to grant
|
|
227
|
+
* permissions for the page to read its geolocation.
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```js
|
|
231
|
+
* await page.setGeolocation({latitude: 59.95, longitude: 30.31667});
|
|
232
|
+
* ```
|
|
233
|
+
*/
|
|
234
|
+
async setGeolocation(options) {
|
|
235
|
+
const { longitude, latitude, accuracy = 0 } = options;
|
|
236
|
+
if (longitude < -180 || longitude > 180)
|
|
237
|
+
throw new Error(`Invalid longitude "${longitude}": precondition -180 <= LONGITUDE <= 180 failed.`);
|
|
238
|
+
if (latitude < -90 || latitude > 90)
|
|
239
|
+
throw new Error(`Invalid latitude "${latitude}": precondition -90 <= LATITUDE <= 90 failed.`);
|
|
240
|
+
if (accuracy < 0)
|
|
241
|
+
throw new Error(`Invalid accuracy "${accuracy}": precondition 0 <= ACCURACY failed.`);
|
|
242
|
+
await this._client.send('Emulation.setGeolocationOverride', {
|
|
243
|
+
longitude,
|
|
244
|
+
latitude,
|
|
245
|
+
accuracy,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* @returns A target this page was created from.
|
|
250
|
+
*/
|
|
251
|
+
target() {
|
|
252
|
+
return this._target;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* @returns The browser this page belongs to.
|
|
256
|
+
*/
|
|
257
|
+
browser() {
|
|
258
|
+
return this._target.browser();
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* @returns The browser context that the page belongs to
|
|
262
|
+
*/
|
|
263
|
+
browserContext() {
|
|
264
|
+
return this._target.browserContext();
|
|
265
|
+
}
|
|
266
|
+
_onTargetCrashed() {
|
|
267
|
+
this.emit('error', new Error('Page crashed!'));
|
|
268
|
+
}
|
|
269
|
+
_onLogEntryAdded(event) {
|
|
270
|
+
const { level, text, args, source, url, lineNumber } = event.entry;
|
|
271
|
+
if (args)
|
|
272
|
+
args.map((arg) => helper.releaseObject(this._client, arg));
|
|
273
|
+
if (source !== 'worker')
|
|
274
|
+
this.emit("console" /* Console */, new ConsoleMessage(level, text, [], [{ url, lineNumber }]));
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* @returns The page's main frame.
|
|
278
|
+
*/
|
|
279
|
+
mainFrame() {
|
|
280
|
+
return this._frameManager.mainFrame();
|
|
281
|
+
}
|
|
282
|
+
get keyboard() {
|
|
283
|
+
return this._keyboard;
|
|
284
|
+
}
|
|
285
|
+
get touchscreen() {
|
|
286
|
+
return this._touchscreen;
|
|
287
|
+
}
|
|
288
|
+
get coverage() {
|
|
289
|
+
return this._coverage;
|
|
290
|
+
}
|
|
291
|
+
get tracing() {
|
|
292
|
+
return this._tracing;
|
|
293
|
+
}
|
|
294
|
+
get accessibility() {
|
|
295
|
+
return this._accessibility;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* @returns An array of all frames attached to the page.
|
|
299
|
+
*/
|
|
300
|
+
frames() {
|
|
301
|
+
return this._frameManager.frames();
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* @returns all of the dedicated
|
|
305
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API | WebWorkers}
|
|
306
|
+
* associated with the page.
|
|
307
|
+
*/
|
|
308
|
+
workers() {
|
|
309
|
+
return Array.from(this._workers.values());
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* @param value - Whether to enable request interception.
|
|
313
|
+
*
|
|
314
|
+
* @remarks
|
|
315
|
+
* Activating request interception enables {@link HTTPRequest.abort},
|
|
316
|
+
* {@link HTTPRequest.continue} and {@link HTTPRequest.respond} methods. This
|
|
317
|
+
* provides the capability to modify network requests that are made by a page.
|
|
318
|
+
*
|
|
319
|
+
* Once request interception is enabled, every request will stall unless it's
|
|
320
|
+
* continued, responded or aborted.
|
|
321
|
+
*
|
|
322
|
+
* **NOTE** Enabling request interception disables page caching.
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* An example of a naïve request interceptor that aborts all image requests:
|
|
326
|
+
* ```js
|
|
327
|
+
* const puppeteer = require('puppeteer');
|
|
328
|
+
* (async () => {
|
|
329
|
+
* const browser = await puppeteer.launch();
|
|
330
|
+
* const page = await browser.newPage();
|
|
331
|
+
* await page.setRequestInterception(true);
|
|
332
|
+
* page.on('request', interceptedRequest => {
|
|
333
|
+
* if (interceptedRequest.url().endsWith('.png') ||
|
|
334
|
+
* interceptedRequest.url().endsWith('.jpg'))
|
|
335
|
+
* interceptedRequest.abort();
|
|
336
|
+
* else
|
|
337
|
+
* interceptedRequest.continue();
|
|
338
|
+
* });
|
|
339
|
+
* await page.goto('https://example.com');
|
|
340
|
+
* await browser.close();
|
|
341
|
+
* })();
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
async setRequestInterception(value) {
|
|
345
|
+
return this._frameManager.networkManager().setRequestInterception(value);
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* @param enabled - When `true`, enables offline mode for the page.
|
|
349
|
+
*/
|
|
350
|
+
setOfflineMode(enabled) {
|
|
351
|
+
return this._frameManager.networkManager().setOfflineMode(enabled);
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* @param timeout - Maximum navigation time in milliseconds.
|
|
355
|
+
*/
|
|
356
|
+
setDefaultNavigationTimeout(timeout) {
|
|
357
|
+
this._timeoutSettings.setDefaultNavigationTimeout(timeout);
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* @param timeout - Maximum time in milliseconds.
|
|
361
|
+
*/
|
|
362
|
+
setDefaultTimeout(timeout) {
|
|
363
|
+
this._timeoutSettings.setDefaultTimeout(timeout);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Runs `document.querySelector` within the page. If no element matches the
|
|
367
|
+
* selector, the return value resolves to `null`.
|
|
368
|
+
*
|
|
369
|
+
* @remarks
|
|
370
|
+
* Shortcut for {@link Frame.$ | Page.mainFrame().$(selector) }.
|
|
371
|
+
*
|
|
372
|
+
* @param selector - A
|
|
373
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
|
|
374
|
+
* to query page for.
|
|
375
|
+
*/
|
|
376
|
+
async $(selector) {
|
|
377
|
+
return this.mainFrame().$(selector);
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* @remarks
|
|
381
|
+
*
|
|
382
|
+
* The only difference between {@link Page.evaluate | page.evaluate} and
|
|
383
|
+
* `page.evaluateHandle` is that `evaluateHandle` will return the value
|
|
384
|
+
* wrapped in an in-page object.
|
|
385
|
+
*
|
|
386
|
+
* If the function passed to `page.evaluteHandle` returns a Promise, the
|
|
387
|
+
* function will wait for the promise to resolve and return its value.
|
|
388
|
+
*
|
|
389
|
+
* You can pass a string instead of a function (although functions are
|
|
390
|
+
* recommended as they are easier to debug and use with TypeScript):
|
|
391
|
+
*
|
|
392
|
+
* @example
|
|
393
|
+
* ```
|
|
394
|
+
* const aHandle = await page.evaluateHandle('document')
|
|
395
|
+
* ```
|
|
396
|
+
*
|
|
397
|
+
* @example
|
|
398
|
+
* {@link JSHandle} instances can be passed as arguments to the `pageFunction`:
|
|
399
|
+
* ```
|
|
400
|
+
* const aHandle = await page.evaluateHandle(() => document.body);
|
|
401
|
+
* const resultHandle = await page.evaluateHandle(body => body.innerHTML, aHandle);
|
|
402
|
+
* console.log(await resultHandle.jsonValue());
|
|
403
|
+
* await resultHandle.dispose();
|
|
404
|
+
* ```
|
|
405
|
+
*
|
|
406
|
+
* Most of the time this function returns a {@link JSHandle},
|
|
407
|
+
* but if `pageFunction` returns a reference to an element,
|
|
408
|
+
* you instead get an {@link ElementHandle} back:
|
|
409
|
+
*
|
|
410
|
+
* @example
|
|
411
|
+
* ```
|
|
412
|
+
* const button = await page.evaluateHandle(() => document.querySelector('button'));
|
|
413
|
+
* // can call `click` because `button` is an `ElementHandle`
|
|
414
|
+
* await button.click();
|
|
415
|
+
* ```
|
|
416
|
+
*
|
|
417
|
+
* The TypeScript definitions assume that `evaluateHandle` returns
|
|
418
|
+
* a `JSHandle`, but if you know it's going to return an
|
|
419
|
+
* `ElementHandle`, pass it as the generic argument:
|
|
420
|
+
*
|
|
421
|
+
* ```
|
|
422
|
+
* const button = await page.evaluateHandle<ElementHandle>(...);
|
|
423
|
+
* ```
|
|
424
|
+
*
|
|
425
|
+
* @param pageFunction - a function that is run within the page
|
|
426
|
+
* @param args - arguments to be passed to the pageFunction
|
|
427
|
+
*/
|
|
428
|
+
async evaluateHandle(pageFunction, ...args) {
|
|
429
|
+
const context = await this.mainFrame().executionContext();
|
|
430
|
+
return context.evaluateHandle(pageFunction, ...args);
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* This method iterates the JavaScript heap and finds all objects with the
|
|
434
|
+
* given prototype.
|
|
435
|
+
*
|
|
436
|
+
* @remarks
|
|
437
|
+
*
|
|
438
|
+
* @example
|
|
439
|
+
*
|
|
440
|
+
* ```js
|
|
441
|
+
* // Create a Map object
|
|
442
|
+
* await page.evaluate(() => window.map = new Map());
|
|
443
|
+
* // Get a handle to the Map object prototype
|
|
444
|
+
* const mapPrototype = await page.evaluateHandle(() => Map.prototype);
|
|
445
|
+
* // Query all map instances into an array
|
|
446
|
+
* const mapInstances = await page.queryObjects(mapPrototype);
|
|
447
|
+
* // Count amount of map objects in heap
|
|
448
|
+
* const count = await page.evaluate(maps => maps.length, mapInstances);
|
|
449
|
+
* await mapInstances.dispose();
|
|
450
|
+
* await mapPrototype.dispose();
|
|
451
|
+
* ```
|
|
452
|
+
* @param prototypeHandle - a handle to the object prototype.
|
|
453
|
+
*/
|
|
454
|
+
async queryObjects(prototypeHandle) {
|
|
455
|
+
const context = await this.mainFrame().executionContext();
|
|
456
|
+
return context.queryObjects(prototypeHandle);
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* This method runs `document.querySelector` within the page and passes the
|
|
460
|
+
* result as the first argument to the `pageFunction`.
|
|
461
|
+
*
|
|
462
|
+
* @remarks
|
|
463
|
+
*
|
|
464
|
+
* If no element is found matching `selector`, the method will throw an error.
|
|
465
|
+
*
|
|
466
|
+
* If `pageFunction` returns a promise `$eval` will wait for the promise to
|
|
467
|
+
* resolve and then return its value.
|
|
468
|
+
*
|
|
469
|
+
* @example
|
|
470
|
+
*
|
|
471
|
+
* ```
|
|
472
|
+
* const searchValue = await page.$eval('#search', el => el.value);
|
|
473
|
+
* const preloadHref = await page.$eval('link[rel=preload]', el => el.href);
|
|
474
|
+
* const html = await page.$eval('.main-container', el => el.outerHTML);
|
|
475
|
+
* ```
|
|
476
|
+
*
|
|
477
|
+
* If you are using TypeScript, you may have to provide an explicit type to the
|
|
478
|
+
* first argument of the `pageFunction`.
|
|
479
|
+
* By default it is typed as `Element`, but you may need to provide a more
|
|
480
|
+
* specific sub-type:
|
|
481
|
+
*
|
|
482
|
+
* @example
|
|
483
|
+
*
|
|
484
|
+
* ```
|
|
485
|
+
* // if you don't provide HTMLInputElement here, TS will error
|
|
486
|
+
* // as `value` is not on `Element`
|
|
487
|
+
* const searchValue = await page.$eval('#search', (el: HTMLInputElement) => el.value);
|
|
488
|
+
* ```
|
|
489
|
+
*
|
|
490
|
+
* The compiler should be able to infer the return type
|
|
491
|
+
* from the `pageFunction` you provide. If it is unable to, you can use the generic
|
|
492
|
+
* type to tell the compiler what return type you expect from `$eval`:
|
|
493
|
+
*
|
|
494
|
+
* @example
|
|
495
|
+
*
|
|
496
|
+
* ```
|
|
497
|
+
* // The compiler can infer the return type in this case, but if it can't
|
|
498
|
+
* // or if you want to be more explicit, provide it as the generic type.
|
|
499
|
+
* const searchValue = await page.$eval<string>(
|
|
500
|
+
* '#search', (el: HTMLInputElement) => el.value
|
|
501
|
+
* );
|
|
502
|
+
* ```
|
|
503
|
+
*
|
|
504
|
+
* @param selector - the
|
|
505
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
|
|
506
|
+
* to query for
|
|
507
|
+
* @param pageFunction - the function to be evaluated in the page context.
|
|
508
|
+
* Will be passed the result of `document.querySelector(selector)` as its
|
|
509
|
+
* first argument.
|
|
510
|
+
* @param args - any additional arguments to pass through to `pageFunction`.
|
|
511
|
+
*
|
|
512
|
+
* @returns The result of calling `pageFunction`. If it returns an element it
|
|
513
|
+
* is wrapped in an {@link ElementHandle}, else the raw value itself is
|
|
514
|
+
* returned.
|
|
515
|
+
*/
|
|
516
|
+
async $eval(selector, pageFunction, ...args) {
|
|
517
|
+
return this.mainFrame().$eval(selector, pageFunction, ...args);
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* This method runs `Array.from(document.querySelectorAll(selector))` within
|
|
521
|
+
* the page and passes the result as the first argument to the `pageFunction`.
|
|
522
|
+
*
|
|
523
|
+
* @remarks
|
|
524
|
+
*
|
|
525
|
+
* If `pageFunction` returns a promise `$$eval` will wait for the promise to
|
|
526
|
+
* resolve and then return its value.
|
|
527
|
+
*
|
|
528
|
+
* @example
|
|
529
|
+
*
|
|
530
|
+
* ```
|
|
531
|
+
* // get the amount of divs on the page
|
|
532
|
+
* const divCount = await page.$$eval('div', divs => divs.length);
|
|
533
|
+
*
|
|
534
|
+
* // get the text content of all the `.options` elements:
|
|
535
|
+
* const options = await page.$$eval('div > span.options', options => {
|
|
536
|
+
* return options.map(option => option.textContent)
|
|
537
|
+
* });
|
|
538
|
+
* ```
|
|
539
|
+
*
|
|
540
|
+
* If you are using TypeScript, you may have to provide an explicit type to the
|
|
541
|
+
* first argument of the `pageFunction`.
|
|
542
|
+
* By default it is typed as `Element[]`, but you may need to provide a more
|
|
543
|
+
* specific sub-type:
|
|
544
|
+
*
|
|
545
|
+
* @example
|
|
546
|
+
*
|
|
547
|
+
* ```
|
|
548
|
+
* // if you don't provide HTMLInputElement here, TS will error
|
|
549
|
+
* // as `value` is not on `Element`
|
|
550
|
+
* await page.$$eval('input', (elements: HTMLInputElement[]) => {
|
|
551
|
+
* return elements.map(e => e.value);
|
|
552
|
+
* });
|
|
553
|
+
* ```
|
|
554
|
+
*
|
|
555
|
+
* The compiler should be able to infer the return type
|
|
556
|
+
* from the `pageFunction` you provide. If it is unable to, you can use the generic
|
|
557
|
+
* type to tell the compiler what return type you expect from `$$eval`:
|
|
558
|
+
*
|
|
559
|
+
* @example
|
|
560
|
+
*
|
|
561
|
+
* ```
|
|
562
|
+
* // The compiler can infer the return type in this case, but if it can't
|
|
563
|
+
* // or if you want to be more explicit, provide it as the generic type.
|
|
564
|
+
* const allInputValues = await page.$$eval<string[]>(
|
|
565
|
+
* 'input', (elements: HTMLInputElement[]) => elements.map(e => e.textContent)
|
|
566
|
+
* );
|
|
567
|
+
* ```
|
|
568
|
+
*
|
|
569
|
+
* @param selector the
|
|
570
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
|
|
571
|
+
* to query for
|
|
572
|
+
* @param pageFunction the function to be evaluated in the page context. Will
|
|
573
|
+
* be passed the result of `Array.from(document.querySelectorAll(selector))`
|
|
574
|
+
* as its first argument.
|
|
575
|
+
* @param args any additional arguments to pass through to `pageFunction`.
|
|
576
|
+
*
|
|
577
|
+
* @returns The result of calling `pageFunction`. If it returns an element it
|
|
578
|
+
* is wrapped in an {@link ElementHandle}, else the raw value itself is
|
|
579
|
+
* returned.
|
|
580
|
+
*/
|
|
581
|
+
async $$eval(selector, pageFunction, ...args) {
|
|
582
|
+
return this.mainFrame().$$eval(selector, pageFunction, ...args);
|
|
583
|
+
}
|
|
584
|
+
async $$(selector) {
|
|
585
|
+
return this.mainFrame().$$(selector);
|
|
586
|
+
}
|
|
587
|
+
async $x(expression) {
|
|
588
|
+
return this.mainFrame().$x(expression);
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* If no URLs are specified, this method returns cookies for the current page
|
|
592
|
+
* URL. If URLs are specified, only cookies for those URLs are returned.
|
|
593
|
+
*/
|
|
594
|
+
async cookies(...urls) {
|
|
595
|
+
const originalCookies = (await this._client.send('Network.getCookies', {
|
|
596
|
+
urls: urls.length ? urls : [this.url()],
|
|
597
|
+
})).cookies;
|
|
598
|
+
const unsupportedCookieAttributes = ['priority'];
|
|
599
|
+
const filterUnsupportedAttributes = (cookie) => {
|
|
600
|
+
for (const attr of unsupportedCookieAttributes)
|
|
601
|
+
delete cookie[attr];
|
|
602
|
+
return cookie;
|
|
603
|
+
};
|
|
604
|
+
return originalCookies.map(filterUnsupportedAttributes);
|
|
605
|
+
}
|
|
606
|
+
async deleteCookie(...cookies) {
|
|
607
|
+
const pageURL = this.url();
|
|
608
|
+
for (const cookie of cookies) {
|
|
609
|
+
const item = Object.assign({}, cookie);
|
|
610
|
+
if (!cookie.url && pageURL.startsWith('http'))
|
|
611
|
+
item.url = pageURL;
|
|
612
|
+
await this._client.send('Network.deleteCookies', item);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
async setCookie(...cookies) {
|
|
616
|
+
const pageURL = this.url();
|
|
617
|
+
const startsWithHTTP = pageURL.startsWith('http');
|
|
618
|
+
const items = cookies.map((cookie) => {
|
|
619
|
+
const item = Object.assign({}, cookie);
|
|
620
|
+
if (!item.url && startsWithHTTP)
|
|
621
|
+
item.url = pageURL;
|
|
622
|
+
assert(item.url !== 'about:blank', `Blank page can not have cookie "${item.name}"`);
|
|
623
|
+
assert(!String.prototype.startsWith.call(item.url || '', 'data:'), `Data URL page can not have cookie "${item.name}"`);
|
|
624
|
+
return item;
|
|
625
|
+
});
|
|
626
|
+
await this.deleteCookie(...items);
|
|
627
|
+
if (items.length)
|
|
628
|
+
await this._client.send('Network.setCookies', { cookies: items });
|
|
629
|
+
}
|
|
630
|
+
async addScriptTag(options) {
|
|
631
|
+
return this.mainFrame().addScriptTag(options);
|
|
632
|
+
}
|
|
633
|
+
async addStyleTag(options) {
|
|
634
|
+
return this.mainFrame().addStyleTag(options);
|
|
635
|
+
}
|
|
636
|
+
async exposeFunction(name, puppeteerFunction) {
|
|
637
|
+
if (this._pageBindings.has(name))
|
|
638
|
+
throw new Error(`Failed to add page binding with name ${name}: window['${name}'] already exists!`);
|
|
639
|
+
this._pageBindings.set(name, puppeteerFunction);
|
|
640
|
+
const expression = helper.pageBindingInitString('exposedFun', name);
|
|
641
|
+
await this._client.send('Runtime.addBinding', { name: name });
|
|
642
|
+
await this._client.send('Page.addScriptToEvaluateOnNewDocument', {
|
|
643
|
+
source: expression,
|
|
644
|
+
});
|
|
645
|
+
await Promise.all(this.frames().map((frame) => frame.evaluate(expression).catch(debugError)));
|
|
646
|
+
}
|
|
647
|
+
async authenticate(credentials) {
|
|
648
|
+
return this._frameManager.networkManager().authenticate(credentials);
|
|
649
|
+
}
|
|
650
|
+
async setExtraHTTPHeaders(headers) {
|
|
651
|
+
return this._frameManager.networkManager().setExtraHTTPHeaders(headers);
|
|
652
|
+
}
|
|
653
|
+
async setUserAgent(userAgent) {
|
|
654
|
+
return this._frameManager.networkManager().setUserAgent(userAgent);
|
|
655
|
+
}
|
|
656
|
+
async metrics() {
|
|
657
|
+
const response = await this._client.send('Performance.getMetrics');
|
|
658
|
+
return this._buildMetricsObject(response.metrics);
|
|
659
|
+
}
|
|
660
|
+
_emitMetrics(event) {
|
|
661
|
+
this.emit("metrics" /* Metrics */, {
|
|
662
|
+
title: event.title,
|
|
663
|
+
metrics: this._buildMetricsObject(event.metrics),
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
_buildMetricsObject(metrics) {
|
|
667
|
+
const result = {};
|
|
668
|
+
for (const metric of metrics || []) {
|
|
669
|
+
if (supportedMetrics.has(metric.name))
|
|
670
|
+
result[metric.name] = metric.value;
|
|
671
|
+
}
|
|
672
|
+
return result;
|
|
673
|
+
}
|
|
674
|
+
_handleException(exceptionDetails) {
|
|
675
|
+
const message = helper.getExceptionMessage(exceptionDetails);
|
|
676
|
+
const err = new Error(message);
|
|
677
|
+
err.stack = ''; // Don't report clientside error with a node stack attached
|
|
678
|
+
this.emit("pageerror" /* PageError */, err);
|
|
679
|
+
}
|
|
680
|
+
async _onConsoleAPI(event) {
|
|
681
|
+
if (event.executionContextId === 0) {
|
|
682
|
+
// DevTools protocol stores the last 1000 console messages. These
|
|
683
|
+
// messages are always reported even for removed execution contexts. In
|
|
684
|
+
// this case, they are marked with executionContextId = 0 and are
|
|
685
|
+
// reported upon enabling Runtime agent.
|
|
686
|
+
//
|
|
687
|
+
// Ignore these messages since:
|
|
688
|
+
// - there's no execution context we can use to operate with message
|
|
689
|
+
// arguments
|
|
690
|
+
// - these messages are reported before Puppeteer clients can subscribe
|
|
691
|
+
// to the 'console'
|
|
692
|
+
// page event.
|
|
693
|
+
//
|
|
694
|
+
// @see https://github.com/puppeteer/puppeteer/issues/3865
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
const context = this._frameManager.executionContextById(event.executionContextId);
|
|
698
|
+
const values = event.args.map((arg) => createJSHandle(context, arg));
|
|
699
|
+
this._addConsoleMessage(event.type, values, event.stackTrace);
|
|
700
|
+
}
|
|
701
|
+
async _onBindingCalled(event) {
|
|
702
|
+
let payload;
|
|
703
|
+
try {
|
|
704
|
+
payload = JSON.parse(event.payload);
|
|
705
|
+
}
|
|
706
|
+
catch {
|
|
707
|
+
// The binding was either called by something in the page or it was
|
|
708
|
+
// called before our wrapper was initialized.
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
const { type, name, seq, args } = payload;
|
|
712
|
+
if (type !== 'exposedFun' || !this._pageBindings.has(name))
|
|
713
|
+
return;
|
|
714
|
+
let expression = null;
|
|
715
|
+
try {
|
|
716
|
+
const result = await this._pageBindings.get(name)(...args);
|
|
717
|
+
expression = helper.pageBindingDeliverResultString(name, seq, result);
|
|
718
|
+
}
|
|
719
|
+
catch (error) {
|
|
720
|
+
if (error instanceof Error)
|
|
721
|
+
expression = helper.pageBindingDeliverErrorString(name, seq, error.message, error.stack);
|
|
722
|
+
else
|
|
723
|
+
expression = helper.pageBindingDeliverErrorValueString(name, seq, error);
|
|
724
|
+
}
|
|
725
|
+
this._client
|
|
726
|
+
.send('Runtime.evaluate', {
|
|
727
|
+
expression,
|
|
728
|
+
contextId: event.executionContextId,
|
|
729
|
+
})
|
|
730
|
+
.catch(debugError);
|
|
731
|
+
}
|
|
732
|
+
_addConsoleMessage(type, args, stackTrace) {
|
|
733
|
+
if (!this.listenerCount("console" /* Console */)) {
|
|
734
|
+
args.forEach((arg) => arg.dispose());
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
const textTokens = [];
|
|
738
|
+
for (const arg of args) {
|
|
739
|
+
const remoteObject = arg._remoteObject;
|
|
740
|
+
if (remoteObject.objectId)
|
|
741
|
+
textTokens.push(arg.toString());
|
|
742
|
+
else
|
|
743
|
+
textTokens.push(helper.valueFromRemoteObject(remoteObject));
|
|
744
|
+
}
|
|
745
|
+
const stackTraceLocations = [];
|
|
746
|
+
if (stackTrace) {
|
|
747
|
+
for (const callFrame of stackTrace.callFrames) {
|
|
748
|
+
stackTraceLocations.push({
|
|
749
|
+
url: callFrame.url,
|
|
750
|
+
lineNumber: callFrame.lineNumber,
|
|
751
|
+
columnNumber: callFrame.columnNumber,
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
const message = new ConsoleMessage(type, textTokens.join(' '), args, stackTraceLocations);
|
|
756
|
+
this.emit("console" /* Console */, message);
|
|
757
|
+
}
|
|
758
|
+
_onDialog(event) {
|
|
759
|
+
let dialogType = null;
|
|
760
|
+
const validDialogTypes = new Set([
|
|
761
|
+
'alert',
|
|
762
|
+
'confirm',
|
|
763
|
+
'prompt',
|
|
764
|
+
'beforeunload',
|
|
765
|
+
]);
|
|
766
|
+
if (validDialogTypes.has(event.type)) {
|
|
767
|
+
dialogType = event.type;
|
|
768
|
+
}
|
|
769
|
+
assert(dialogType, 'Unknown javascript dialog type: ' + event.type);
|
|
770
|
+
const dialog = new Dialog(this._client, dialogType, event.message, event.defaultPrompt);
|
|
771
|
+
this.emit("dialog" /* Dialog */, dialog);
|
|
772
|
+
}
|
|
773
|
+
url() {
|
|
774
|
+
return this.mainFrame().url();
|
|
775
|
+
}
|
|
776
|
+
async content() {
|
|
777
|
+
return await this._frameManager.mainFrame().content();
|
|
778
|
+
}
|
|
779
|
+
async setContent(html, options = {}) {
|
|
780
|
+
await this._frameManager.mainFrame().setContent(html, options);
|
|
781
|
+
}
|
|
782
|
+
async goto(url, options = {}) {
|
|
783
|
+
return await this._frameManager.mainFrame().goto(url, options);
|
|
784
|
+
}
|
|
785
|
+
async reload(options) {
|
|
786
|
+
const result = await Promise.all([
|
|
787
|
+
this.waitForNavigation(options),
|
|
788
|
+
this._client.send('Page.reload'),
|
|
789
|
+
]);
|
|
790
|
+
return result[0];
|
|
791
|
+
}
|
|
792
|
+
async waitForNavigation(options = {}) {
|
|
793
|
+
return await this._frameManager.mainFrame().waitForNavigation(options);
|
|
794
|
+
}
|
|
795
|
+
_sessionClosePromise() {
|
|
796
|
+
if (!this._disconnectPromise)
|
|
797
|
+
this._disconnectPromise = new Promise((fulfill) => this._client.once(CDPSessionEmittedEvents.Disconnected, () => fulfill(new Error('Target closed'))));
|
|
798
|
+
return this._disconnectPromise;
|
|
799
|
+
}
|
|
800
|
+
async waitForRequest(urlOrPredicate, options = {}) {
|
|
801
|
+
const { timeout = this._timeoutSettings.timeout() } = options;
|
|
802
|
+
return helper.waitForEvent(this._frameManager.networkManager(), NetworkManagerEmittedEvents.Request, (request) => {
|
|
803
|
+
if (helper.isString(urlOrPredicate))
|
|
804
|
+
return urlOrPredicate === request.url();
|
|
805
|
+
if (typeof urlOrPredicate === 'function')
|
|
806
|
+
return !!urlOrPredicate(request);
|
|
807
|
+
return false;
|
|
808
|
+
}, timeout, this._sessionClosePromise());
|
|
809
|
+
}
|
|
810
|
+
async waitForResponse(urlOrPredicate, options = {}) {
|
|
811
|
+
const { timeout = this._timeoutSettings.timeout() } = options;
|
|
812
|
+
return helper.waitForEvent(this._frameManager.networkManager(), NetworkManagerEmittedEvents.Response, (response) => {
|
|
813
|
+
if (helper.isString(urlOrPredicate))
|
|
814
|
+
return urlOrPredicate === response.url();
|
|
815
|
+
if (typeof urlOrPredicate === 'function')
|
|
816
|
+
return !!urlOrPredicate(response);
|
|
817
|
+
return false;
|
|
818
|
+
}, timeout, this._sessionClosePromise());
|
|
819
|
+
}
|
|
820
|
+
async goBack(options = {}) {
|
|
821
|
+
return this._go(-1, options);
|
|
822
|
+
}
|
|
823
|
+
async goForward(options = {}) {
|
|
824
|
+
return this._go(+1, options);
|
|
825
|
+
}
|
|
826
|
+
async _go(delta, options) {
|
|
827
|
+
const history = await this._client.send('Page.getNavigationHistory');
|
|
828
|
+
const entry = history.entries[history.currentIndex + delta];
|
|
829
|
+
if (!entry)
|
|
830
|
+
return null;
|
|
831
|
+
const result = await Promise.all([
|
|
832
|
+
this.waitForNavigation(options),
|
|
833
|
+
this._client.send('Page.navigateToHistoryEntry', { entryId: entry.id }),
|
|
834
|
+
]);
|
|
835
|
+
return result[0];
|
|
836
|
+
}
|
|
837
|
+
async bringToFront() {
|
|
838
|
+
await this._client.send('Page.bringToFront');
|
|
839
|
+
}
|
|
840
|
+
async emulate(options) {
|
|
841
|
+
await Promise.all([
|
|
842
|
+
this.setViewport(options.viewport),
|
|
843
|
+
this.setUserAgent(options.userAgent),
|
|
844
|
+
]);
|
|
845
|
+
}
|
|
846
|
+
async setJavaScriptEnabled(enabled) {
|
|
847
|
+
if (this._javascriptEnabled === enabled)
|
|
848
|
+
return;
|
|
849
|
+
this._javascriptEnabled = enabled;
|
|
850
|
+
await this._client.send('Emulation.setScriptExecutionDisabled', {
|
|
851
|
+
value: !enabled,
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
async setBypassCSP(enabled) {
|
|
855
|
+
await this._client.send('Page.setBypassCSP', { enabled });
|
|
856
|
+
}
|
|
857
|
+
async emulateMediaType(type) {
|
|
858
|
+
assert(type === 'screen' || type === 'print' || type === null, 'Unsupported media type: ' + type);
|
|
859
|
+
await this._client.send('Emulation.setEmulatedMedia', {
|
|
860
|
+
media: type || '',
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
async emulateMediaFeatures(features) {
|
|
864
|
+
if (features === null)
|
|
865
|
+
await this._client.send('Emulation.setEmulatedMedia', { features: null });
|
|
866
|
+
if (Array.isArray(features)) {
|
|
867
|
+
features.every((mediaFeature) => {
|
|
868
|
+
const name = mediaFeature.name;
|
|
869
|
+
assert(/^prefers-(?:color-scheme|reduced-motion)$/.test(name), 'Unsupported media feature: ' + name);
|
|
870
|
+
return true;
|
|
871
|
+
});
|
|
872
|
+
await this._client.send('Emulation.setEmulatedMedia', {
|
|
873
|
+
features: features,
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
async emulateTimezone(timezoneId) {
|
|
878
|
+
try {
|
|
879
|
+
await this._client.send('Emulation.setTimezoneOverride', {
|
|
880
|
+
timezoneId: timezoneId || '',
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
catch (error) {
|
|
884
|
+
if (error.message.includes('Invalid timezone'))
|
|
885
|
+
throw new Error(`Invalid timezone ID: ${timezoneId}`);
|
|
886
|
+
throw error;
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Emulates the idle state.
|
|
891
|
+
* If no arguments set, clears idle state emulation.
|
|
892
|
+
*
|
|
893
|
+
* @example
|
|
894
|
+
* ```js
|
|
895
|
+
* // set idle emulation
|
|
896
|
+
* await page.emulateIdleState({isUserActive: true, isScreenUnlocked: false});
|
|
897
|
+
*
|
|
898
|
+
* // do some checks here
|
|
899
|
+
* ...
|
|
900
|
+
*
|
|
901
|
+
* // clear idle emulation
|
|
902
|
+
* await page.emulateIdleState();
|
|
903
|
+
* ```
|
|
904
|
+
*
|
|
905
|
+
* @param overrides Mock idle state. If not set, clears idle overrides
|
|
906
|
+
* @param isUserActive Mock isUserActive
|
|
907
|
+
* @param isScreenUnlocked Mock isScreenUnlocked
|
|
908
|
+
*/
|
|
909
|
+
async emulateIdleState(overrides) {
|
|
910
|
+
if (overrides) {
|
|
911
|
+
await this._client.send('Emulation.setIdleOverride', {
|
|
912
|
+
isUserActive: overrides.isUserActive,
|
|
913
|
+
isScreenUnlocked: overrides.isScreenUnlocked,
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
else {
|
|
917
|
+
await this._client.send('Emulation.clearIdleOverride');
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Simulates the given vision deficiency on the page.
|
|
922
|
+
*
|
|
923
|
+
* @example
|
|
924
|
+
* ```js
|
|
925
|
+
* const puppeteer = require('puppeteer');
|
|
926
|
+
*
|
|
927
|
+
* (async () => {
|
|
928
|
+
* const browser = await puppeteer.launch();
|
|
929
|
+
* const page = await browser.newPage();
|
|
930
|
+
* await page.goto('https://v8.dev/blog/10-years');
|
|
931
|
+
*
|
|
932
|
+
* await page.emulateVisionDeficiency('achromatopsia');
|
|
933
|
+
* await page.screenshot({ path: 'achromatopsia.png' });
|
|
934
|
+
*
|
|
935
|
+
* await page.emulateVisionDeficiency('deuteranopia');
|
|
936
|
+
* await page.screenshot({ path: 'deuteranopia.png' });
|
|
937
|
+
*
|
|
938
|
+
* await page.emulateVisionDeficiency('blurredVision');
|
|
939
|
+
* await page.screenshot({ path: 'blurred-vision.png' });
|
|
940
|
+
*
|
|
941
|
+
* await browser.close();
|
|
942
|
+
* })();
|
|
943
|
+
* ```
|
|
944
|
+
*
|
|
945
|
+
* @param type - the type of deficiency to simulate, or `'none'` to reset.
|
|
946
|
+
*/
|
|
947
|
+
async emulateVisionDeficiency(type) {
|
|
948
|
+
const visionDeficiencies = new Set([
|
|
949
|
+
'none',
|
|
950
|
+
'achromatopsia',
|
|
951
|
+
'blurredVision',
|
|
952
|
+
'deuteranopia',
|
|
953
|
+
'protanopia',
|
|
954
|
+
'tritanopia',
|
|
955
|
+
]);
|
|
956
|
+
try {
|
|
957
|
+
assert(!type || visionDeficiencies.has(type), `Unsupported vision deficiency: ${type}`);
|
|
958
|
+
await this._client.send('Emulation.setEmulatedVisionDeficiency', {
|
|
959
|
+
type: type || 'none',
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
catch (error) {
|
|
963
|
+
throw error;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
async setViewport(viewport) {
|
|
967
|
+
const needsReload = await this._emulationManager.emulateViewport(viewport);
|
|
968
|
+
this._viewport = viewport;
|
|
969
|
+
if (needsReload)
|
|
970
|
+
await this.reload();
|
|
971
|
+
}
|
|
972
|
+
viewport() {
|
|
973
|
+
return this._viewport;
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* @remarks
|
|
977
|
+
*
|
|
978
|
+
* Evaluates a function in the page's context and returns the result.
|
|
979
|
+
*
|
|
980
|
+
* If the function passed to `page.evaluteHandle` returns a Promise, the
|
|
981
|
+
* function will wait for the promise to resolve and return its value.
|
|
982
|
+
*
|
|
983
|
+
* @example
|
|
984
|
+
*
|
|
985
|
+
* ```js
|
|
986
|
+
* const result = await frame.evaluate(() => {
|
|
987
|
+
* return Promise.resolve(8 * 7);
|
|
988
|
+
* });
|
|
989
|
+
* console.log(result); // prints "56"
|
|
990
|
+
* ```
|
|
991
|
+
*
|
|
992
|
+
* You can pass a string instead of a function (although functions are
|
|
993
|
+
* recommended as they are easier to debug and use with TypeScript):
|
|
994
|
+
*
|
|
995
|
+
* @example
|
|
996
|
+
* ```
|
|
997
|
+
* const aHandle = await page.evaluate('1 + 2');
|
|
998
|
+
* ```
|
|
999
|
+
*
|
|
1000
|
+
* To get the best TypeScript experience, you should pass in as the
|
|
1001
|
+
* generic the type of `pageFunction`:
|
|
1002
|
+
*
|
|
1003
|
+
* ```
|
|
1004
|
+
* const aHandle = await page.evaluate<() => number>(() => 2);
|
|
1005
|
+
* ```
|
|
1006
|
+
*
|
|
1007
|
+
* @example
|
|
1008
|
+
*
|
|
1009
|
+
* {@link ElementHandle} instances (including {@link JSHandle}s) can be passed
|
|
1010
|
+
* as arguments to the `pageFunction`:
|
|
1011
|
+
*
|
|
1012
|
+
* ```
|
|
1013
|
+
* const bodyHandle = await page.$('body');
|
|
1014
|
+
* const html = await page.evaluate(body => body.innerHTML, bodyHandle);
|
|
1015
|
+
* await bodyHandle.dispose();
|
|
1016
|
+
* ```
|
|
1017
|
+
*
|
|
1018
|
+
* @param pageFunction - a function that is run within the page
|
|
1019
|
+
* @param args - arguments to be passed to the pageFunction
|
|
1020
|
+
*
|
|
1021
|
+
* @returns the return value of `pageFunction`.
|
|
1022
|
+
*/
|
|
1023
|
+
async evaluate(pageFunction, ...args) {
|
|
1024
|
+
return this._frameManager.mainFrame().evaluate(pageFunction, ...args);
|
|
1025
|
+
}
|
|
1026
|
+
async evaluateOnNewDocument(pageFunction, ...args) {
|
|
1027
|
+
const source = helper.evaluationString(pageFunction, ...args);
|
|
1028
|
+
await this._client.send('Page.addScriptToEvaluateOnNewDocument', {
|
|
1029
|
+
source,
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
async setCacheEnabled(enabled = true) {
|
|
1033
|
+
await this._frameManager.networkManager().setCacheEnabled(enabled);
|
|
1034
|
+
}
|
|
1035
|
+
async screenshot(options = {}) {
|
|
1036
|
+
let screenshotType = null;
|
|
1037
|
+
// options.type takes precedence over inferring the type from options.path
|
|
1038
|
+
// because it may be a 0-length file with no extension created beforehand
|
|
1039
|
+
// (i.e. as a temp file).
|
|
1040
|
+
if (options.type) {
|
|
1041
|
+
assert(options.type === 'png' || options.type === 'jpeg', 'Unknown options.type value: ' + options.type);
|
|
1042
|
+
screenshotType = options.type;
|
|
1043
|
+
}
|
|
1044
|
+
else if (options.path) {
|
|
1045
|
+
const filePath = options.path;
|
|
1046
|
+
const extension = filePath
|
|
1047
|
+
.slice(filePath.lastIndexOf('.') + 1)
|
|
1048
|
+
.toLowerCase();
|
|
1049
|
+
if (extension === 'png')
|
|
1050
|
+
screenshotType = 'png';
|
|
1051
|
+
else if (extension === 'jpg' || extension === 'jpeg')
|
|
1052
|
+
screenshotType = 'jpeg';
|
|
1053
|
+
assert(screenshotType, `Unsupported screenshot type for extension \`.${extension}\``);
|
|
1054
|
+
}
|
|
1055
|
+
if (!screenshotType)
|
|
1056
|
+
screenshotType = 'png';
|
|
1057
|
+
if (options.quality) {
|
|
1058
|
+
assert(screenshotType === 'jpeg', 'options.quality is unsupported for the ' +
|
|
1059
|
+
screenshotType +
|
|
1060
|
+
' screenshots');
|
|
1061
|
+
assert(typeof options.quality === 'number', 'Expected options.quality to be a number but found ' +
|
|
1062
|
+
typeof options.quality);
|
|
1063
|
+
assert(Number.isInteger(options.quality), 'Expected options.quality to be an integer');
|
|
1064
|
+
assert(options.quality >= 0 && options.quality <= 100, 'Expected options.quality to be between 0 and 100 (inclusive), got ' +
|
|
1065
|
+
options.quality);
|
|
1066
|
+
}
|
|
1067
|
+
assert(!options.clip || !options.fullPage, 'options.clip and options.fullPage are exclusive');
|
|
1068
|
+
if (options.clip) {
|
|
1069
|
+
assert(typeof options.clip.x === 'number', 'Expected options.clip.x to be a number but found ' +
|
|
1070
|
+
typeof options.clip.x);
|
|
1071
|
+
assert(typeof options.clip.y === 'number', 'Expected options.clip.y to be a number but found ' +
|
|
1072
|
+
typeof options.clip.y);
|
|
1073
|
+
assert(typeof options.clip.width === 'number', 'Expected options.clip.width to be a number but found ' +
|
|
1074
|
+
typeof options.clip.width);
|
|
1075
|
+
assert(typeof options.clip.height === 'number', 'Expected options.clip.height to be a number but found ' +
|
|
1076
|
+
typeof options.clip.height);
|
|
1077
|
+
assert(options.clip.width !== 0, 'Expected options.clip.width not to be 0.');
|
|
1078
|
+
assert(options.clip.height !== 0, 'Expected options.clip.height not to be 0.');
|
|
1079
|
+
}
|
|
1080
|
+
return this._screenshotTaskQueue.postTask(() => this._screenshotTask(screenshotType, options));
|
|
1081
|
+
}
|
|
1082
|
+
async _screenshotTask(format, options) {
|
|
1083
|
+
await this._client.send('Target.activateTarget', {
|
|
1084
|
+
targetId: this._target._targetId,
|
|
1085
|
+
});
|
|
1086
|
+
let clip = options.clip ? processClip(options.clip) : undefined;
|
|
1087
|
+
if (options.fullPage) {
|
|
1088
|
+
const metrics = await this._client.send('Page.getLayoutMetrics');
|
|
1089
|
+
const width = Math.ceil(metrics.contentSize.width);
|
|
1090
|
+
const height = Math.ceil(metrics.contentSize.height);
|
|
1091
|
+
// Overwrite clip for full page at all times.
|
|
1092
|
+
clip = { x: 0, y: 0, width, height, scale: 1 };
|
|
1093
|
+
const { isMobile = false, deviceScaleFactor = 1, isLandscape = false } = this._viewport || {};
|
|
1094
|
+
const screenOrientation = isLandscape
|
|
1095
|
+
? { angle: 90, type: 'landscapePrimary' }
|
|
1096
|
+
: { angle: 0, type: 'portraitPrimary' };
|
|
1097
|
+
await this._client.send('Emulation.setDeviceMetricsOverride', {
|
|
1098
|
+
mobile: isMobile,
|
|
1099
|
+
width,
|
|
1100
|
+
height,
|
|
1101
|
+
deviceScaleFactor,
|
|
1102
|
+
screenOrientation,
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
const shouldSetDefaultBackground = options.omitBackground && format === 'png';
|
|
1106
|
+
if (shouldSetDefaultBackground)
|
|
1107
|
+
await this._client.send('Emulation.setDefaultBackgroundColorOverride', {
|
|
1108
|
+
color: { r: 0, g: 0, b: 0, a: 0 },
|
|
1109
|
+
});
|
|
1110
|
+
const result = await this._client.send('Page.captureScreenshot', {
|
|
1111
|
+
format,
|
|
1112
|
+
quality: options.quality,
|
|
1113
|
+
clip,
|
|
1114
|
+
});
|
|
1115
|
+
if (shouldSetDefaultBackground)
|
|
1116
|
+
await this._client.send('Emulation.setDefaultBackgroundColorOverride');
|
|
1117
|
+
if (options.fullPage && this._viewport)
|
|
1118
|
+
await this.setViewport(this._viewport);
|
|
1119
|
+
const buffer = options.encoding === 'base64'
|
|
1120
|
+
? result.data
|
|
1121
|
+
: Buffer.from(result.data, 'base64');
|
|
1122
|
+
if (!isNode && options.path) {
|
|
1123
|
+
throw new Error('Screenshots can only be written to a file path in a Node environment.');
|
|
1124
|
+
}
|
|
1125
|
+
const fs = await helper.importFSModule();
|
|
1126
|
+
if (options.path)
|
|
1127
|
+
await fs.promises.writeFile(options.path, buffer);
|
|
1128
|
+
return buffer;
|
|
1129
|
+
function processClip(clip) {
|
|
1130
|
+
const x = Math.round(clip.x);
|
|
1131
|
+
const y = Math.round(clip.y);
|
|
1132
|
+
const width = Math.round(clip.width + clip.x - x);
|
|
1133
|
+
const height = Math.round(clip.height + clip.y - y);
|
|
1134
|
+
return { x, y, width, height, scale: 1 };
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
/**
|
|
1138
|
+
* Generatees a PDF of the page with the `print` CSS media type.
|
|
1139
|
+
* @remarks
|
|
1140
|
+
*
|
|
1141
|
+
* IMPORTANT: PDF generation is only supported in Chrome headless mode.
|
|
1142
|
+
*
|
|
1143
|
+
* To generate a PDF with the `screen` media type, call
|
|
1144
|
+
* {@link Page.emulateMediaType | `page.emulateMediaType('screen')`} before
|
|
1145
|
+
* calling `page.pdf()`.
|
|
1146
|
+
*
|
|
1147
|
+
* By default, `page.pdf()` generates a pdf with modified colors for printing.
|
|
1148
|
+
* Use the
|
|
1149
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust | `-webkit-print-color-adjust`}
|
|
1150
|
+
* property to force rendering of exact colors.
|
|
1151
|
+
*
|
|
1152
|
+
*
|
|
1153
|
+
* @param options - options for generating the PDF.
|
|
1154
|
+
*/
|
|
1155
|
+
async pdf(options = {}) {
|
|
1156
|
+
const { scale = 1, displayHeaderFooter = false, headerTemplate = '', footerTemplate = '', printBackground = false, landscape = false, pageRanges = '', preferCSSPageSize = false, margin = {}, path = null, } = options;
|
|
1157
|
+
let paperWidth = 8.5;
|
|
1158
|
+
let paperHeight = 11;
|
|
1159
|
+
if (options.format) {
|
|
1160
|
+
const format = paperFormats[options.format.toLowerCase()];
|
|
1161
|
+
assert(format, 'Unknown paper format: ' + options.format);
|
|
1162
|
+
paperWidth = format.width;
|
|
1163
|
+
paperHeight = format.height;
|
|
1164
|
+
}
|
|
1165
|
+
else {
|
|
1166
|
+
paperWidth = convertPrintParameterToInches(options.width) || paperWidth;
|
|
1167
|
+
paperHeight =
|
|
1168
|
+
convertPrintParameterToInches(options.height) || paperHeight;
|
|
1169
|
+
}
|
|
1170
|
+
const marginTop = convertPrintParameterToInches(margin.top) || 0;
|
|
1171
|
+
const marginLeft = convertPrintParameterToInches(margin.left) || 0;
|
|
1172
|
+
const marginBottom = convertPrintParameterToInches(margin.bottom) || 0;
|
|
1173
|
+
const marginRight = convertPrintParameterToInches(margin.right) || 0;
|
|
1174
|
+
const result = await this._client.send('Page.printToPDF', {
|
|
1175
|
+
transferMode: 'ReturnAsStream',
|
|
1176
|
+
landscape,
|
|
1177
|
+
displayHeaderFooter,
|
|
1178
|
+
headerTemplate,
|
|
1179
|
+
footerTemplate,
|
|
1180
|
+
printBackground,
|
|
1181
|
+
scale,
|
|
1182
|
+
paperWidth,
|
|
1183
|
+
paperHeight,
|
|
1184
|
+
marginTop,
|
|
1185
|
+
marginBottom,
|
|
1186
|
+
marginLeft,
|
|
1187
|
+
marginRight,
|
|
1188
|
+
pageRanges,
|
|
1189
|
+
preferCSSPageSize,
|
|
1190
|
+
});
|
|
1191
|
+
return await helper.readProtocolStream(this._client, result.stream, path);
|
|
1192
|
+
}
|
|
1193
|
+
async title() {
|
|
1194
|
+
return this.mainFrame().title();
|
|
1195
|
+
}
|
|
1196
|
+
async close(options = { runBeforeUnload: undefined }) {
|
|
1197
|
+
assert(!!this._client._connection, 'Protocol error: Connection closed. Most likely the page has been closed.');
|
|
1198
|
+
const runBeforeUnload = !!options.runBeforeUnload;
|
|
1199
|
+
if (runBeforeUnload) {
|
|
1200
|
+
await this._client.send('Page.close');
|
|
1201
|
+
}
|
|
1202
|
+
else {
|
|
1203
|
+
await this._client._connection.send('Target.closeTarget', {
|
|
1204
|
+
targetId: this._target._targetId,
|
|
1205
|
+
});
|
|
1206
|
+
await this._target._isClosedPromise;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
isClosed() {
|
|
1210
|
+
return this._closed;
|
|
1211
|
+
}
|
|
1212
|
+
get mouse() {
|
|
1213
|
+
return this._mouse;
|
|
1214
|
+
}
|
|
1215
|
+
click(selector, options = {}) {
|
|
1216
|
+
return this.mainFrame().click(selector, options);
|
|
1217
|
+
}
|
|
1218
|
+
focus(selector) {
|
|
1219
|
+
return this.mainFrame().focus(selector);
|
|
1220
|
+
}
|
|
1221
|
+
hover(selector) {
|
|
1222
|
+
return this.mainFrame().hover(selector);
|
|
1223
|
+
}
|
|
1224
|
+
select(selector, ...values) {
|
|
1225
|
+
return this.mainFrame().select(selector, ...values);
|
|
1226
|
+
}
|
|
1227
|
+
tap(selector) {
|
|
1228
|
+
return this.mainFrame().tap(selector);
|
|
1229
|
+
}
|
|
1230
|
+
type(selector, text, options) {
|
|
1231
|
+
return this.mainFrame().type(selector, text, options);
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* @remarks
|
|
1235
|
+
*
|
|
1236
|
+
* This method behaves differently depending on the first parameter. If it's a
|
|
1237
|
+
* `string`, it will be treated as a `selector` or `xpath` (if the string
|
|
1238
|
+
* starts with `//`). This method then is a shortcut for
|
|
1239
|
+
* {@link Page.waitForSelector} or {@link Page.waitForXPath}.
|
|
1240
|
+
*
|
|
1241
|
+
* If the first argument is a function this method is a shortcut for
|
|
1242
|
+
* {@link Page.waitForFunction}.
|
|
1243
|
+
*
|
|
1244
|
+
* If the first argument is a `number`, it's treated as a timeout in
|
|
1245
|
+
* milliseconds and the method returns a promise which resolves after the
|
|
1246
|
+
* timeout.
|
|
1247
|
+
*
|
|
1248
|
+
* @param selectorOrFunctionOrTimeout - a selector, predicate or timeout to
|
|
1249
|
+
* wait for.
|
|
1250
|
+
* @param options - optional waiting parameters.
|
|
1251
|
+
* @param args - arguments to pass to `pageFunction`.
|
|
1252
|
+
*
|
|
1253
|
+
* @deprecated Don't use this method directly. Instead use the more explicit
|
|
1254
|
+
* methods available: {@link Page.waitForSelector},
|
|
1255
|
+
* {@link Page.waitForXPath}, {@link Page.waitForFunction} or
|
|
1256
|
+
* {@link Page.waitForTimeout}.
|
|
1257
|
+
*/
|
|
1258
|
+
waitFor(selectorOrFunctionOrTimeout, options = {}, ...args) {
|
|
1259
|
+
return this.mainFrame().waitFor(selectorOrFunctionOrTimeout, options, ...args);
|
|
1260
|
+
}
|
|
1261
|
+
/**
|
|
1262
|
+
* Causes your script to wait for the given number of milliseconds.
|
|
1263
|
+
*
|
|
1264
|
+
* @remarks
|
|
1265
|
+
*
|
|
1266
|
+
* It's generally recommended to not wait for a number of seconds, but instead
|
|
1267
|
+
* use {@link Page.waitForSelector}, {@link Page.waitForXPath} or
|
|
1268
|
+
* {@link Page.waitForFunction} to wait for exactly the conditions you want.
|
|
1269
|
+
*
|
|
1270
|
+
* @example
|
|
1271
|
+
*
|
|
1272
|
+
* Wait for 1 second:
|
|
1273
|
+
*
|
|
1274
|
+
* ```
|
|
1275
|
+
* await page.waitForTimeout(1000);
|
|
1276
|
+
* ```
|
|
1277
|
+
*
|
|
1278
|
+
* @param milliseconds - the number of milliseconds to wait.
|
|
1279
|
+
*/
|
|
1280
|
+
waitForTimeout(milliseconds) {
|
|
1281
|
+
return this.mainFrame().waitForTimeout(milliseconds);
|
|
1282
|
+
}
|
|
1283
|
+
waitForSelector(selector, options = {}) {
|
|
1284
|
+
return this.mainFrame().waitForSelector(selector, options);
|
|
1285
|
+
}
|
|
1286
|
+
waitForXPath(xpath, options = {}) {
|
|
1287
|
+
return this.mainFrame().waitForXPath(xpath, options);
|
|
1288
|
+
}
|
|
1289
|
+
waitForFunction(pageFunction, options = {}, ...args) {
|
|
1290
|
+
return this.mainFrame().waitForFunction(pageFunction, options, ...args);
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
const supportedMetrics = new Set([
|
|
1294
|
+
'Timestamp',
|
|
1295
|
+
'Documents',
|
|
1296
|
+
'Frames',
|
|
1297
|
+
'JSEventListeners',
|
|
1298
|
+
'Nodes',
|
|
1299
|
+
'LayoutCount',
|
|
1300
|
+
'RecalcStyleCount',
|
|
1301
|
+
'LayoutDuration',
|
|
1302
|
+
'RecalcStyleDuration',
|
|
1303
|
+
'ScriptDuration',
|
|
1304
|
+
'TaskDuration',
|
|
1305
|
+
'JSHeapUsedSize',
|
|
1306
|
+
'JSHeapTotalSize',
|
|
1307
|
+
]);
|
|
1308
|
+
const unitToPixels = {
|
|
1309
|
+
px: 1,
|
|
1310
|
+
in: 96,
|
|
1311
|
+
cm: 37.8,
|
|
1312
|
+
mm: 3.78,
|
|
1313
|
+
};
|
|
1314
|
+
function convertPrintParameterToInches(parameter) {
|
|
1315
|
+
if (typeof parameter === 'undefined')
|
|
1316
|
+
return undefined;
|
|
1317
|
+
let pixels;
|
|
1318
|
+
if (helper.isNumber(parameter)) {
|
|
1319
|
+
// Treat numbers as pixel values to be aligned with phantom's paperSize.
|
|
1320
|
+
pixels = /** @type {number} */ parameter;
|
|
1321
|
+
}
|
|
1322
|
+
else if (helper.isString(parameter)) {
|
|
1323
|
+
const text = /** @type {string} */ parameter;
|
|
1324
|
+
let unit = text.substring(text.length - 2).toLowerCase();
|
|
1325
|
+
let valueText = '';
|
|
1326
|
+
if (unitToPixels.hasOwnProperty(unit)) {
|
|
1327
|
+
valueText = text.substring(0, text.length - 2);
|
|
1328
|
+
}
|
|
1329
|
+
else {
|
|
1330
|
+
// In case of unknown unit try to parse the whole parameter as number of pixels.
|
|
1331
|
+
// This is consistent with phantom's paperSize behavior.
|
|
1332
|
+
unit = 'px';
|
|
1333
|
+
valueText = text;
|
|
1334
|
+
}
|
|
1335
|
+
const value = Number(valueText);
|
|
1336
|
+
assert(!isNaN(value), 'Failed to parse parameter value: ' + text);
|
|
1337
|
+
pixels = value * unitToPixels[unit];
|
|
1338
|
+
}
|
|
1339
|
+
else {
|
|
1340
|
+
throw new Error('page.pdf() Cannot handle parameter type: ' + typeof parameter);
|
|
1341
|
+
}
|
|
1342
|
+
return pixels / 96;
|
|
1343
|
+
}
|