@browserless.io/browserless 2.2.0-beta-6 → 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/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/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
|
@@ -42,8 +42,8 @@ builtinScriptlets.push({
|
|
|
42
42
|
fn: safeSelf,
|
|
43
43
|
});
|
|
44
44
|
function safeSelf() {
|
|
45
|
-
if ( scriptletGlobals.
|
|
46
|
-
return scriptletGlobals.
|
|
45
|
+
if ( scriptletGlobals.safeSelf ) {
|
|
46
|
+
return scriptletGlobals.safeSelf;
|
|
47
47
|
}
|
|
48
48
|
const self = globalThis;
|
|
49
49
|
const safe = {
|
|
@@ -55,7 +55,10 @@ function safeSelf() {
|
|
|
55
55
|
'Math_max': Math.max,
|
|
56
56
|
'Math_min': Math.min,
|
|
57
57
|
'Math_random': Math.random,
|
|
58
|
+
'Object': Object,
|
|
58
59
|
'Object_defineProperty': Object.defineProperty.bind(Object),
|
|
60
|
+
'Object_fromEntries': Object.fromEntries.bind(Object),
|
|
61
|
+
'Object_getOwnPropertyDescriptor': Object.getOwnPropertyDescriptor.bind(Object),
|
|
59
62
|
'RegExp': self.RegExp,
|
|
60
63
|
'RegExp_test': self.RegExp.prototype.test,
|
|
61
64
|
'RegExp_exec': self.RegExp.prototype.exec,
|
|
@@ -70,11 +73,25 @@ function safeSelf() {
|
|
|
70
73
|
'JSON_parse': (...args) => safe.JSON_parseFn.call(safe.JSON, ...args),
|
|
71
74
|
'JSON_stringify': (...args) => safe.JSON_stringifyFn.call(safe.JSON, ...args),
|
|
72
75
|
'log': console.log.bind(console),
|
|
76
|
+
// Properties
|
|
77
|
+
logLevel: 0,
|
|
78
|
+
// Methods
|
|
79
|
+
makeLogPrefix(...args) {
|
|
80
|
+
return this.sendToLogger && `[${args.join(' \u205D ')}]` || '';
|
|
81
|
+
},
|
|
73
82
|
uboLog(...args) {
|
|
74
|
-
if (
|
|
75
|
-
if ( args
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
if ( this.sendToLogger === undefined ) { return; }
|
|
84
|
+
if ( args === undefined || args[0] === '' ) { return; }
|
|
85
|
+
return this.sendToLogger('info', ...args);
|
|
86
|
+
|
|
87
|
+
},
|
|
88
|
+
uboErr(...args) {
|
|
89
|
+
if ( this.sendToLogger === undefined ) { return; }
|
|
90
|
+
if ( args === undefined || args[0] === '' ) { return; }
|
|
91
|
+
return this.sendToLogger('error', ...args);
|
|
92
|
+
},
|
|
93
|
+
escapeRegexChars(s) {
|
|
94
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
78
95
|
},
|
|
79
96
|
initPattern(pattern, options = {}) {
|
|
80
97
|
if ( pattern === '' ) {
|
|
@@ -96,8 +113,7 @@ function safeSelf() {
|
|
|
96
113
|
}
|
|
97
114
|
if ( options.flags !== undefined ) {
|
|
98
115
|
return {
|
|
99
|
-
re: new this.RegExp(
|
|
100
|
-
/[.*+?^${}()|[\]\\]/g, '\\$&'),
|
|
116
|
+
re: new this.RegExp(this.escapeRegexChars(pattern),
|
|
101
117
|
options.flags
|
|
102
118
|
),
|
|
103
119
|
expect,
|
|
@@ -116,7 +132,7 @@ function safeSelf() {
|
|
|
116
132
|
if ( pattern === '' ) { return /^/; }
|
|
117
133
|
const match = /^\/(.+)\/([gimsu]*)$/.exec(pattern);
|
|
118
134
|
if ( match === null ) {
|
|
119
|
-
const reStr =
|
|
135
|
+
const reStr = this.escapeRegexChars(pattern);
|
|
120
136
|
return new RegExp(verbatim ? `^${reStr}$` : reStr, flags);
|
|
121
137
|
}
|
|
122
138
|
try {
|
|
@@ -137,10 +153,42 @@ function safeSelf() {
|
|
|
137
153
|
}
|
|
138
154
|
return out;
|
|
139
155
|
}, []);
|
|
140
|
-
return
|
|
156
|
+
return this.Object_fromEntries(entries);
|
|
141
157
|
},
|
|
142
158
|
};
|
|
143
|
-
scriptletGlobals.
|
|
159
|
+
scriptletGlobals.safeSelf = safe;
|
|
160
|
+
if ( scriptletGlobals.bcSecret === undefined ) { return safe; }
|
|
161
|
+
// This is executed only when the logger is opened
|
|
162
|
+
const bc = new self.BroadcastChannel(scriptletGlobals.bcSecret);
|
|
163
|
+
let bcBuffer = [];
|
|
164
|
+
safe.logLevel = scriptletGlobals.logLevel || 1;
|
|
165
|
+
safe.sendToLogger = (type, ...args) => {
|
|
166
|
+
if ( args.length === 0 ) { return; }
|
|
167
|
+
const text = `[${document.location.hostname || document.location.href}]${args.join(' ')}`;
|
|
168
|
+
if ( bcBuffer === undefined ) {
|
|
169
|
+
return bc.postMessage({ what: 'messageToLogger', type, text });
|
|
170
|
+
}
|
|
171
|
+
bcBuffer.push({ type, text });
|
|
172
|
+
};
|
|
173
|
+
bc.onmessage = ev => {
|
|
174
|
+
const msg = ev.data;
|
|
175
|
+
switch ( msg ) {
|
|
176
|
+
case 'iamready!':
|
|
177
|
+
if ( bcBuffer === undefined ) { break; }
|
|
178
|
+
bcBuffer.forEach(({ type, text }) =>
|
|
179
|
+
bc.postMessage({ what: 'messageToLogger', type, text })
|
|
180
|
+
);
|
|
181
|
+
bcBuffer = undefined;
|
|
182
|
+
break;
|
|
183
|
+
case 'setScriptletLogLevelToOne':
|
|
184
|
+
safe.logLevel = 1;
|
|
185
|
+
break;
|
|
186
|
+
case 'setScriptletLogLevelToTwo':
|
|
187
|
+
safe.logLevel = 2;
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
bc.postMessage('areyouready?');
|
|
144
192
|
return safe;
|
|
145
193
|
}
|
|
146
194
|
|
|
@@ -176,18 +224,7 @@ builtinScriptlets.push({
|
|
|
176
224
|
});
|
|
177
225
|
function shouldDebug(details) {
|
|
178
226
|
if ( details instanceof Object === false ) { return false; }
|
|
179
|
-
return scriptletGlobals.
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/******************************************************************************/
|
|
183
|
-
|
|
184
|
-
builtinScriptlets.push({
|
|
185
|
-
name: 'should-log.fn',
|
|
186
|
-
fn: shouldLog,
|
|
187
|
-
});
|
|
188
|
-
function shouldLog(details) {
|
|
189
|
-
if ( details instanceof Object === false ) { return false; }
|
|
190
|
-
return scriptletGlobals.has('canDebug') && details.log;
|
|
227
|
+
return scriptletGlobals.canDebug && details.debug;
|
|
191
228
|
}
|
|
192
229
|
|
|
193
230
|
/******************************************************************************/
|
|
@@ -292,12 +329,12 @@ function generateContentFn(directive) {
|
|
|
292
329
|
return Promise.resolve(randomize(len | 0));
|
|
293
330
|
}
|
|
294
331
|
}
|
|
295
|
-
if ( directive.startsWith('war:') && scriptletGlobals.
|
|
332
|
+
if ( directive.startsWith('war:') && scriptletGlobals.warOrigin ) {
|
|
296
333
|
return new Promise(resolve => {
|
|
297
|
-
const warOrigin = scriptletGlobals.
|
|
334
|
+
const warOrigin = scriptletGlobals.warOrigin;
|
|
298
335
|
const warName = directive.slice(4);
|
|
299
336
|
const fullpath = [ warOrigin, '/', warName ];
|
|
300
|
-
const warSecret = scriptletGlobals.
|
|
337
|
+
const warSecret = scriptletGlobals.warSecret;
|
|
301
338
|
if ( warSecret !== undefined ) {
|
|
302
339
|
fullpath.push('?secret=', warSecret);
|
|
303
340
|
}
|
|
@@ -322,7 +359,6 @@ builtinScriptlets.push({
|
|
|
322
359
|
'get-exception-token.fn',
|
|
323
360
|
'safe-self.fn',
|
|
324
361
|
'should-debug.fn',
|
|
325
|
-
'should-log.fn',
|
|
326
362
|
],
|
|
327
363
|
});
|
|
328
364
|
// Issues to mind before changing anything:
|
|
@@ -335,6 +371,7 @@ function abortCurrentScriptCore(
|
|
|
335
371
|
if ( typeof target !== 'string' ) { return; }
|
|
336
372
|
if ( target === '' ) { return; }
|
|
337
373
|
const safe = safeSelf();
|
|
374
|
+
const logPrefix = safe.makeLogPrefix('abort-current-script', target, needle, context);
|
|
338
375
|
const reNeedle = safe.patternToRegex(needle);
|
|
339
376
|
const reContext = safe.patternToRegex(context);
|
|
340
377
|
const extraArgs = safe.getExtraArgs(Array.from(arguments), 3);
|
|
@@ -358,7 +395,6 @@ function abortCurrentScriptCore(
|
|
|
358
395
|
value = owner[prop];
|
|
359
396
|
desc = undefined;
|
|
360
397
|
}
|
|
361
|
-
const log = shouldLog(extraArgs);
|
|
362
398
|
const debug = shouldDebug(extraArgs);
|
|
363
399
|
const exceptionToken = getExceptionToken();
|
|
364
400
|
const scriptTexts = new WeakMap();
|
|
@@ -391,14 +427,19 @@ function abortCurrentScriptCore(
|
|
|
391
427
|
if ( debug === 'nomatch' || debug === 'all' ) { debugger; } // jshint ignore: line
|
|
392
428
|
return;
|
|
393
429
|
}
|
|
394
|
-
if (
|
|
430
|
+
if ( safe.logLevel > 1 && context !== '' ) {
|
|
431
|
+
safe.uboLog(logPrefix, `Matched src\n${e.src}`);
|
|
432
|
+
}
|
|
395
433
|
const scriptText = getScriptText(e);
|
|
396
434
|
if ( reNeedle.test(scriptText) === false ) {
|
|
397
435
|
if ( debug === 'nomatch' || debug === 'all' ) { debugger; } // jshint ignore: line
|
|
398
436
|
return;
|
|
399
437
|
}
|
|
400
|
-
if (
|
|
438
|
+
if ( safe.logLevel > 1 ) {
|
|
439
|
+
safe.uboLog(logPrefix, `Matched text\n${scriptText}`);
|
|
440
|
+
}
|
|
401
441
|
if ( debug === 'match' || debug === 'all' ) { debugger; } // jshint ignore: line
|
|
442
|
+
safe.uboLog(logPrefix, 'Aborted');
|
|
402
443
|
throw new ReferenceError(exceptionToken);
|
|
403
444
|
};
|
|
404
445
|
if ( debug === 'install' ) { debugger; } // jshint ignore: line
|
|
@@ -420,40 +461,97 @@ function abortCurrentScriptCore(
|
|
|
420
461
|
}
|
|
421
462
|
});
|
|
422
463
|
} catch(ex) {
|
|
423
|
-
|
|
464
|
+
safe.uboErr(logPrefix, `Error: ${ex}`);
|
|
424
465
|
}
|
|
425
466
|
}
|
|
426
467
|
|
|
427
468
|
/******************************************************************************/
|
|
428
469
|
|
|
429
470
|
builtinScriptlets.push({
|
|
430
|
-
name: '
|
|
431
|
-
fn:
|
|
471
|
+
name: 'validate-constant.fn',
|
|
472
|
+
fn: validateConstantFn,
|
|
432
473
|
dependencies: [
|
|
433
|
-
'run-at.fn',
|
|
434
474
|
'safe-self.fn',
|
|
435
475
|
],
|
|
436
476
|
});
|
|
477
|
+
function validateConstantFn(trusted, raw) {
|
|
478
|
+
const safe = safeSelf();
|
|
479
|
+
const extraArgs = safe.getExtraArgs(Array.from(arguments), 2);
|
|
480
|
+
let value;
|
|
481
|
+
if ( raw === 'undefined' ) {
|
|
482
|
+
value = undefined;
|
|
483
|
+
} else if ( raw === 'false' ) {
|
|
484
|
+
value = false;
|
|
485
|
+
} else if ( raw === 'true' ) {
|
|
486
|
+
value = true;
|
|
487
|
+
} else if ( raw === 'null' ) {
|
|
488
|
+
value = null;
|
|
489
|
+
} else if ( raw === "''" || raw === '' ) {
|
|
490
|
+
value = '';
|
|
491
|
+
} else if ( raw === '[]' || raw === 'emptyArr' ) {
|
|
492
|
+
value = [];
|
|
493
|
+
} else if ( raw === '{}' || raw === 'emptyObj' ) {
|
|
494
|
+
value = {};
|
|
495
|
+
} else if ( raw === 'noopFunc' ) {
|
|
496
|
+
value = function(){};
|
|
497
|
+
} else if ( raw === 'trueFunc' ) {
|
|
498
|
+
value = function(){ return true; };
|
|
499
|
+
} else if ( raw === 'falseFunc' ) {
|
|
500
|
+
value = function(){ return false; };
|
|
501
|
+
} else if ( /^-?\d+$/.test(raw) ) {
|
|
502
|
+
value = parseInt(raw);
|
|
503
|
+
if ( isNaN(raw) ) { return; }
|
|
504
|
+
if ( Math.abs(raw) > 0x7FFF ) { return; }
|
|
505
|
+
} else if ( trusted ) {
|
|
506
|
+
if ( raw.startsWith('{') && raw.endsWith('}') ) {
|
|
507
|
+
try { value = safe.JSON_parse(raw).value; } catch(ex) { return; }
|
|
508
|
+
}
|
|
509
|
+
} else {
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
if ( extraArgs.as !== undefined ) {
|
|
513
|
+
if ( extraArgs.as === 'function' ) {
|
|
514
|
+
return ( ) => value;
|
|
515
|
+
} else if ( extraArgs.as === 'callback' ) {
|
|
516
|
+
return ( ) => (( ) => value);
|
|
517
|
+
} else if ( extraArgs.as === 'resolved' ) {
|
|
518
|
+
return Promise.resolve(value);
|
|
519
|
+
} else if ( extraArgs.as === 'rejected' ) {
|
|
520
|
+
return Promise.reject(value);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
return value;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/******************************************************************************/
|
|
437
527
|
|
|
438
|
-
|
|
528
|
+
builtinScriptlets.push({
|
|
529
|
+
name: 'set-constant.fn',
|
|
530
|
+
fn: setConstantFn,
|
|
531
|
+
dependencies: [
|
|
532
|
+
'run-at.fn',
|
|
533
|
+
'safe-self.fn',
|
|
534
|
+
'validate-constant.fn',
|
|
535
|
+
],
|
|
536
|
+
});
|
|
537
|
+
function setConstantFn(
|
|
439
538
|
trusted = false,
|
|
440
539
|
chain = '',
|
|
441
|
-
|
|
540
|
+
rawValue = ''
|
|
442
541
|
) {
|
|
443
542
|
if ( chain === '' ) { return; }
|
|
444
543
|
const safe = safeSelf();
|
|
544
|
+
const logPrefix = safe.makeLogPrefix('set-constant', chain, rawValue);
|
|
445
545
|
const extraArgs = safe.getExtraArgs(Array.from(arguments), 3);
|
|
446
|
-
function setConstant(chain,
|
|
546
|
+
function setConstant(chain, rawValue) {
|
|
447
547
|
const trappedProp = (( ) => {
|
|
448
548
|
const pos = chain.lastIndexOf('.');
|
|
449
549
|
if ( pos === -1 ) { return chain; }
|
|
450
550
|
return chain.slice(pos+1);
|
|
451
551
|
})();
|
|
452
|
-
if ( trappedProp === '' ) { return; }
|
|
453
|
-
const thisScript = document.currentScript;
|
|
454
552
|
const cloakFunc = fn => {
|
|
455
553
|
safe.Object_defineProperty(fn, 'name', { value: trappedProp });
|
|
456
|
-
|
|
554
|
+
return new Proxy(fn, {
|
|
457
555
|
defineProperty(target, prop) {
|
|
458
556
|
if ( prop !== 'toString' ) {
|
|
459
557
|
return Reflect.defineProperty(...arguments);
|
|
@@ -475,50 +573,12 @@ function setConstantCore(
|
|
|
475
573
|
return Reflect.get(...arguments);
|
|
476
574
|
},
|
|
477
575
|
});
|
|
478
|
-
return proxy;
|
|
479
576
|
};
|
|
480
|
-
if (
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
cValue = true;
|
|
486
|
-
} else if ( cValue === 'null' ) {
|
|
487
|
-
cValue = null;
|
|
488
|
-
} else if ( cValue === "''" || cValue === '' ) {
|
|
489
|
-
cValue = '';
|
|
490
|
-
} else if ( cValue === '[]' || cValue === 'emptyArr' ) {
|
|
491
|
-
cValue = [];
|
|
492
|
-
} else if ( cValue === '{}' || cValue === 'emptyObj' ) {
|
|
493
|
-
cValue = {};
|
|
494
|
-
} else if ( cValue === 'noopFunc' ) {
|
|
495
|
-
cValue = cloakFunc(function(){});
|
|
496
|
-
} else if ( cValue === 'trueFunc' ) {
|
|
497
|
-
cValue = cloakFunc(function(){ return true; });
|
|
498
|
-
} else if ( cValue === 'falseFunc' ) {
|
|
499
|
-
cValue = cloakFunc(function(){ return false; });
|
|
500
|
-
} else if ( /^-?\d+$/.test(cValue) ) {
|
|
501
|
-
cValue = parseInt(cValue);
|
|
502
|
-
if ( isNaN(cValue) ) { return; }
|
|
503
|
-
if ( Math.abs(cValue) > 0x7FFF ) { return; }
|
|
504
|
-
} else if ( trusted ) {
|
|
505
|
-
if ( cValue.startsWith('{') && cValue.endsWith('}') ) {
|
|
506
|
-
try { cValue = safe.JSON_parse(cValue).value; } catch(ex) { return; }
|
|
507
|
-
}
|
|
508
|
-
} else {
|
|
509
|
-
return;
|
|
510
|
-
}
|
|
511
|
-
if ( extraArgs.as !== undefined ) {
|
|
512
|
-
const value = cValue;
|
|
513
|
-
if ( extraArgs.as === 'function' ) {
|
|
514
|
-
cValue = ( ) => value;
|
|
515
|
-
} else if ( extraArgs.as === 'callback' ) {
|
|
516
|
-
cValue = ( ) => (( ) => value);
|
|
517
|
-
} else if ( extraArgs.as === 'resolved' ) {
|
|
518
|
-
cValue = Promise.resolve(value);
|
|
519
|
-
} else if ( extraArgs.as === 'rejected' ) {
|
|
520
|
-
cValue = Promise.reject(value);
|
|
521
|
-
}
|
|
577
|
+
if ( trappedProp === '' ) { return; }
|
|
578
|
+
const thisScript = document.currentScript;
|
|
579
|
+
let normalValue = validateConstantFn(trusted, rawValue);
|
|
580
|
+
if ( rawValue === 'noopFunc' || rawValue === 'trueFunc' || rawValue === 'falseFunc' ) {
|
|
581
|
+
normalValue = cloakFunc(normalValue);
|
|
522
582
|
}
|
|
523
583
|
let aborted = false;
|
|
524
584
|
const mustAbort = function(v) {
|
|
@@ -526,18 +586,21 @@ function setConstantCore(
|
|
|
526
586
|
if ( aborted ) { return true; }
|
|
527
587
|
aborted =
|
|
528
588
|
(v !== undefined && v !== null) &&
|
|
529
|
-
(
|
|
530
|
-
(typeof v !== typeof
|
|
589
|
+
(normalValue !== undefined && normalValue !== null) &&
|
|
590
|
+
(typeof v !== typeof normalValue);
|
|
591
|
+
if ( aborted ) {
|
|
592
|
+
safe.uboLog(logPrefix, `Aborted because value set to ${v}`);
|
|
593
|
+
}
|
|
531
594
|
return aborted;
|
|
532
595
|
};
|
|
533
596
|
// https://github.com/uBlockOrigin/uBlock-issues/issues/156
|
|
534
597
|
// Support multiple trappers for the same property.
|
|
535
598
|
const trapProp = function(owner, prop, configurable, handler) {
|
|
536
|
-
if ( handler.init(configurable ? owner[prop] :
|
|
537
|
-
const odesc =
|
|
599
|
+
if ( handler.init(configurable ? owner[prop] : normalValue) === false ) { return; }
|
|
600
|
+
const odesc = safe.Object_getOwnPropertyDescriptor(owner, prop);
|
|
538
601
|
let prevGetter, prevSetter;
|
|
539
|
-
if ( odesc instanceof Object ) {
|
|
540
|
-
owner[prop] =
|
|
602
|
+
if ( odesc instanceof safe.Object ) {
|
|
603
|
+
owner[prop] = normalValue;
|
|
541
604
|
if ( odesc.get instanceof Function ) {
|
|
542
605
|
prevGetter = odesc.get;
|
|
543
606
|
}
|
|
@@ -552,7 +615,7 @@ function setConstantCore(
|
|
|
552
615
|
if ( prevGetter !== undefined ) {
|
|
553
616
|
prevGetter();
|
|
554
617
|
}
|
|
555
|
-
return handler.getter();
|
|
618
|
+
return handler.getter();
|
|
556
619
|
},
|
|
557
620
|
set(a) {
|
|
558
621
|
if ( prevSetter !== undefined ) {
|
|
@@ -561,7 +624,9 @@ function setConstantCore(
|
|
|
561
624
|
handler.setter(a);
|
|
562
625
|
}
|
|
563
626
|
});
|
|
627
|
+
safe.uboLog(logPrefix, 'Trap installed');
|
|
564
628
|
} catch(ex) {
|
|
629
|
+
safe.uboErr(logPrefix, ex);
|
|
565
630
|
}
|
|
566
631
|
};
|
|
567
632
|
const trapChain = function(owner, chain) {
|
|
@@ -575,13 +640,15 @@ function setConstantCore(
|
|
|
575
640
|
return true;
|
|
576
641
|
},
|
|
577
642
|
getter: function() {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
643
|
+
if ( document.currentScript === thisScript ) {
|
|
644
|
+
return this.v;
|
|
645
|
+
}
|
|
646
|
+
safe.uboLog(logPrefix, 'Property read');
|
|
647
|
+
return normalValue;
|
|
581
648
|
},
|
|
582
649
|
setter: function(a) {
|
|
583
650
|
if ( mustAbort(a) === false ) { return; }
|
|
584
|
-
|
|
651
|
+
normalValue = a;
|
|
585
652
|
}
|
|
586
653
|
});
|
|
587
654
|
return;
|
|
@@ -589,7 +656,7 @@ function setConstantCore(
|
|
|
589
656
|
const prop = chain.slice(0, pos);
|
|
590
657
|
const v = owner[prop];
|
|
591
658
|
chain = chain.slice(pos + 1);
|
|
592
|
-
if ( v instanceof Object || typeof v === 'object' && v !== null ) {
|
|
659
|
+
if ( v instanceof safe.Object || typeof v === 'object' && v !== null ) {
|
|
593
660
|
trapChain(v, chain);
|
|
594
661
|
return;
|
|
595
662
|
}
|
|
@@ -604,7 +671,7 @@ function setConstantCore(
|
|
|
604
671
|
},
|
|
605
672
|
setter: function(a) {
|
|
606
673
|
this.v = a;
|
|
607
|
-
if ( a instanceof Object ) {
|
|
674
|
+
if ( a instanceof safe.Object ) {
|
|
608
675
|
trapChain(a, chain);
|
|
609
676
|
}
|
|
610
677
|
}
|
|
@@ -613,7 +680,7 @@ function setConstantCore(
|
|
|
613
680
|
trapChain(window, chain);
|
|
614
681
|
}
|
|
615
682
|
runAt(( ) => {
|
|
616
|
-
setConstant(chain,
|
|
683
|
+
setConstant(chain, rawValue);
|
|
617
684
|
}, extraArgs.runAt);
|
|
618
685
|
}
|
|
619
686
|
|
|
@@ -633,18 +700,18 @@ function replaceNodeTextFn(
|
|
|
633
700
|
replacement = ''
|
|
634
701
|
) {
|
|
635
702
|
const safe = safeSelf();
|
|
703
|
+
const logPrefix = safe.makeLogPrefix('replace-node-text.fn', ...Array.from(arguments));
|
|
636
704
|
const reNodeName = safe.patternToRegex(nodeName, 'i', true);
|
|
637
705
|
const rePattern = safe.patternToRegex(pattern, 'gms');
|
|
638
706
|
const extraArgs = safe.getExtraArgs(Array.from(arguments), 3);
|
|
639
|
-
const shouldLog = scriptletGlobals.has('canDebug') && extraArgs.log || 0;
|
|
640
707
|
const reCondition = safe.patternToRegex(extraArgs.condition || '', 'ms');
|
|
641
708
|
const stop = (takeRecord = true) => {
|
|
642
709
|
if ( takeRecord ) {
|
|
643
710
|
handleMutations(observer.takeRecords());
|
|
644
711
|
}
|
|
645
712
|
observer.disconnect();
|
|
646
|
-
if (
|
|
647
|
-
safe.uboLog(
|
|
713
|
+
if ( safe.logLevel > 1 ) {
|
|
714
|
+
safe.uboLog(logPrefix, 'Quitting');
|
|
648
715
|
}
|
|
649
716
|
};
|
|
650
717
|
let sedCount = extraArgs.sedCount || 0;
|
|
@@ -659,10 +726,10 @@ function replaceNodeTextFn(
|
|
|
659
726
|
? before.replace(rePattern, replacement)
|
|
660
727
|
: replacement;
|
|
661
728
|
node.textContent = after;
|
|
662
|
-
if (
|
|
663
|
-
safe.uboLog(
|
|
664
|
-
safe.uboLog('replace-node-text.fn after:\n', after);
|
|
729
|
+
if ( safe.logLevel > 1 ) {
|
|
730
|
+
safe.uboLog(logPrefix, `Text before:\n${before.trim()}`);
|
|
665
731
|
}
|
|
732
|
+
safe.uboLog(logPrefix, `Text after:\n${after.trim()}`);
|
|
666
733
|
return sedCount === 0 || (sedCount -= 1) !== 0;
|
|
667
734
|
};
|
|
668
735
|
const handleMutations = mutations => {
|
|
@@ -690,9 +757,7 @@ function replaceNodeTextFn(
|
|
|
690
757
|
if ( handleNode(node) ) { continue; }
|
|
691
758
|
stop(); break;
|
|
692
759
|
}
|
|
693
|
-
|
|
694
|
-
safe.uboLog(`replace-node-text-core.fn ${count} nodes present before installing mutation observer`);
|
|
695
|
-
}
|
|
760
|
+
safe.uboLog(logPrefix, `${count} nodes present before installing mutation observer`);
|
|
696
761
|
}
|
|
697
762
|
if ( extraArgs.stay ) { return; }
|
|
698
763
|
runAt(( ) => {
|
|
@@ -713,8 +778,6 @@ builtinScriptlets.push({
|
|
|
713
778
|
dependencies: [
|
|
714
779
|
'matches-stack-trace.fn',
|
|
715
780
|
'object-find-owner.fn',
|
|
716
|
-
'safe-self.fn',
|
|
717
|
-
'should-log.fn',
|
|
718
781
|
],
|
|
719
782
|
});
|
|
720
783
|
// When no "prune paths" argument is provided, the scriptlet is
|
|
@@ -731,15 +794,12 @@ function objectPruneFn(
|
|
|
731
794
|
extraArgs = {}
|
|
732
795
|
) {
|
|
733
796
|
if ( typeof rawPrunePaths !== 'string' ) { return; }
|
|
734
|
-
const safe = safeSelf();
|
|
735
797
|
const prunePaths = rawPrunePaths !== ''
|
|
736
798
|
? rawPrunePaths.split(/ +/)
|
|
737
799
|
: [];
|
|
738
800
|
const needlePaths = prunePaths.length !== 0 && rawNeedlePaths !== ''
|
|
739
801
|
? rawNeedlePaths.split(/ +/)
|
|
740
802
|
: [];
|
|
741
|
-
const logLevel = shouldLog({ log: rawPrunePaths === '' || extraArgs.log });
|
|
742
|
-
const reLogNeedle = safe.patternToRegex(logLevel === true ? rawNeedlePaths : '');
|
|
743
803
|
if ( stackNeedleDetails.matchAll !== true ) {
|
|
744
804
|
if ( matchesStackTrace(stackNeedleDetails, extraArgs.logstack) === false ) {
|
|
745
805
|
return;
|
|
@@ -754,14 +814,6 @@ function objectPruneFn(
|
|
|
754
814
|
}
|
|
755
815
|
return true;
|
|
756
816
|
};
|
|
757
|
-
objectPruneFn.logJson = (json, msg, reNeedle) => {
|
|
758
|
-
if ( reNeedle.test(json) === false ) { return; }
|
|
759
|
-
safeSelf().uboLog(`objectPrune()`, msg, location.hostname, json);
|
|
760
|
-
};
|
|
761
|
-
}
|
|
762
|
-
const jsonBefore = logLevel ? safe.JSON_stringify(obj, null, 2) : '';
|
|
763
|
-
if ( logLevel === true || logLevel === 'all' ) {
|
|
764
|
-
objectPruneFn.logJson(jsonBefore, `prune:"${rawPrunePaths}" log:"${logLevel}"`, reLogNeedle);
|
|
765
817
|
}
|
|
766
818
|
if ( prunePaths.length === 0 ) { return; }
|
|
767
819
|
let outcome = 'nomatch';
|
|
@@ -772,9 +824,6 @@ function objectPruneFn(
|
|
|
772
824
|
}
|
|
773
825
|
}
|
|
774
826
|
}
|
|
775
|
-
if ( logLevel === outcome ) {
|
|
776
|
-
objectPruneFn.logJson(jsonBefore, `prune:"${rawPrunePaths}" log:"${logLevel}"`, reLogNeedle);
|
|
777
|
-
}
|
|
778
827
|
if ( outcome === 'match' ) { return obj; }
|
|
779
828
|
}
|
|
780
829
|
|
|
@@ -832,9 +881,63 @@ function objectFindOwnerFn(
|
|
|
832
881
|
|
|
833
882
|
/******************************************************************************/
|
|
834
883
|
|
|
884
|
+
builtinScriptlets.push({
|
|
885
|
+
name: 'get-all-cookies.fn',
|
|
886
|
+
fn: getAllCookiesFn,
|
|
887
|
+
});
|
|
888
|
+
function getAllCookiesFn() {
|
|
889
|
+
return document.cookie.split(/\s*;\s*/).map(s => {
|
|
890
|
+
const pos = s.indexOf('=');
|
|
891
|
+
if ( pos === 0 ) { return; }
|
|
892
|
+
if ( pos === -1 ) { return `${s.trim()}=`; }
|
|
893
|
+
const key = s.slice(0, pos).trim();
|
|
894
|
+
const value = s.slice(pos+1).trim();
|
|
895
|
+
return { key, value };
|
|
896
|
+
}).filter(s => s !== undefined);
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
/******************************************************************************/
|
|
900
|
+
|
|
901
|
+
builtinScriptlets.push({
|
|
902
|
+
name: 'get-all-local-storage.fn',
|
|
903
|
+
fn: getAllLocalStorageFn,
|
|
904
|
+
});
|
|
905
|
+
function getAllLocalStorageFn(which = 'localStorage') {
|
|
906
|
+
const storage = self[which];
|
|
907
|
+
const out = [];
|
|
908
|
+
for ( let i = 0; i < storage.length; i++ ) {
|
|
909
|
+
const key = storage.key(i);
|
|
910
|
+
const value = storage.getItem(key);
|
|
911
|
+
return { key, value };
|
|
912
|
+
}
|
|
913
|
+
return out;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
/******************************************************************************/
|
|
917
|
+
|
|
918
|
+
builtinScriptlets.push({
|
|
919
|
+
name: 'get-cookie.fn',
|
|
920
|
+
fn: getCookieFn,
|
|
921
|
+
});
|
|
922
|
+
function getCookieFn(
|
|
923
|
+
name = ''
|
|
924
|
+
) {
|
|
925
|
+
for ( const s of document.cookie.split(/\s*;\s*/) ) {
|
|
926
|
+
const pos = s.indexOf('=');
|
|
927
|
+
if ( pos === -1 ) { continue; }
|
|
928
|
+
if ( s.slice(0, pos) !== name ) { continue; }
|
|
929
|
+
return s.slice(pos+1).trim();
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/******************************************************************************/
|
|
934
|
+
|
|
835
935
|
builtinScriptlets.push({
|
|
836
936
|
name: 'set-cookie.fn',
|
|
837
937
|
fn: setCookieFn,
|
|
938
|
+
dependencies: [
|
|
939
|
+
'get-cookie.fn',
|
|
940
|
+
],
|
|
838
941
|
});
|
|
839
942
|
function setCookieFn(
|
|
840
943
|
trusted = false,
|
|
@@ -844,16 +947,7 @@ function setCookieFn(
|
|
|
844
947
|
path = '',
|
|
845
948
|
options = {},
|
|
846
949
|
) {
|
|
847
|
-
const
|
|
848
|
-
for ( const s of document.cookie.split(/\s*;\s*/) ) {
|
|
849
|
-
const pos = s.indexOf('=');
|
|
850
|
-
if ( pos === -1 ) { continue; }
|
|
851
|
-
if ( s.slice(0, pos) !== name ) { continue; }
|
|
852
|
-
return s.slice(pos+1);
|
|
853
|
-
}
|
|
854
|
-
};
|
|
855
|
-
|
|
856
|
-
const cookieBefore = getCookieValue(name);
|
|
950
|
+
const cookieBefore = getCookieFn(name);
|
|
857
951
|
if ( cookieBefore !== undefined && options.dontOverwrite ) { return; }
|
|
858
952
|
if ( cookieBefore === value && options.reload ) { return; }
|
|
859
953
|
|
|
@@ -881,9 +975,12 @@ function setCookieFn(
|
|
|
881
975
|
} catch(_) {
|
|
882
976
|
}
|
|
883
977
|
|
|
884
|
-
|
|
978
|
+
const done = getCookieFn(name) === value;
|
|
979
|
+
if ( done && options.reload ) {
|
|
885
980
|
window.location.reload();
|
|
886
981
|
}
|
|
982
|
+
|
|
983
|
+
return done;
|
|
887
984
|
}
|
|
888
985
|
|
|
889
986
|
/******************************************************************************/
|
|
@@ -1070,7 +1167,7 @@ function matchObjectProperties(propNeedles, ...objs) {
|
|
|
1070
1167
|
let value = haystack[prop];
|
|
1071
1168
|
if ( value === undefined ) { continue; }
|
|
1072
1169
|
if ( typeof value !== 'string' ) {
|
|
1073
|
-
try { value =
|
|
1170
|
+
try { value = safe.JSON_stringify(value); }
|
|
1074
1171
|
catch(ex) { }
|
|
1075
1172
|
if ( typeof value !== 'string' ) { continue; }
|
|
1076
1173
|
}
|
|
@@ -1090,7 +1187,6 @@ builtinScriptlets.push({
|
|
|
1090
1187
|
'object-prune.fn',
|
|
1091
1188
|
'parse-properties-to-match.fn',
|
|
1092
1189
|
'safe-self.fn',
|
|
1093
|
-
'should-log.fn',
|
|
1094
1190
|
],
|
|
1095
1191
|
});
|
|
1096
1192
|
function jsonPruneFetchResponseFn(
|
|
@@ -1098,23 +1194,22 @@ function jsonPruneFetchResponseFn(
|
|
|
1098
1194
|
rawNeedlePaths = ''
|
|
1099
1195
|
) {
|
|
1100
1196
|
const safe = safeSelf();
|
|
1197
|
+
const logPrefix = safe.makeLogPrefix('json-prune-fetch-response', rawPrunePaths, rawNeedlePaths);
|
|
1101
1198
|
const extraArgs = safe.getExtraArgs(Array.from(arguments), 2);
|
|
1102
|
-
const logLevel = shouldLog({ log: rawPrunePaths === '' || extraArgs.log, });
|
|
1103
|
-
const log = logLevel ? ((...args) => { safe.uboLog(...args); }) : (( ) => { });
|
|
1104
1199
|
const propNeedles = parsePropertiesToMatch(extraArgs.propsToMatch, 'url');
|
|
1105
1200
|
const stackNeedle = safe.initPattern(extraArgs.stackToMatch || '', { canNegate: true });
|
|
1106
1201
|
const applyHandler = function(target, thisArg, args) {
|
|
1107
1202
|
const fetchPromise = Reflect.apply(target, thisArg, args);
|
|
1108
|
-
if ( logLevel === true ) {
|
|
1109
|
-
log('json-prune-fetch-response:', JSON.stringify(Array.from(args)).slice(1,-1));
|
|
1110
|
-
}
|
|
1111
1203
|
if ( rawPrunePaths === '' ) { return fetchPromise; }
|
|
1112
1204
|
let outcome = 'match';
|
|
1113
1205
|
if ( propNeedles.size !== 0 ) {
|
|
1114
1206
|
const objs = [ args[0] instanceof Object ? args[0] : { url: args[0] } ];
|
|
1115
1207
|
if ( objs[0] instanceof Request ) {
|
|
1116
|
-
try {
|
|
1117
|
-
|
|
1208
|
+
try {
|
|
1209
|
+
objs[0] = safe.Request_clone.call(objs[0]);
|
|
1210
|
+
} catch(ex) {
|
|
1211
|
+
safe.uboErr(logPrefix, 'Error:', ex);
|
|
1212
|
+
}
|
|
1118
1213
|
}
|
|
1119
1214
|
if ( args[1] instanceof Object ) {
|
|
1120
1215
|
objs.push(args[1]);
|
|
@@ -1122,15 +1217,11 @@ function jsonPruneFetchResponseFn(
|
|
|
1122
1217
|
if ( matchObjectProperties(propNeedles, ...objs) === false ) {
|
|
1123
1218
|
outcome = 'nomatch';
|
|
1124
1219
|
}
|
|
1125
|
-
if ( outcome === logLevel || logLevel === 'all' ) {
|
|
1126
|
-
log(
|
|
1127
|
-
`json-prune-fetch-response (${outcome})`,
|
|
1128
|
-
`\n\tfetchPropsToMatch: ${JSON.stringify(Array.from(propNeedles)).slice(1,-1)}`,
|
|
1129
|
-
'\n\tprops:', ...objs,
|
|
1130
|
-
);
|
|
1131
|
-
}
|
|
1132
1220
|
}
|
|
1133
1221
|
if ( outcome === 'nomatch' ) { return fetchPromise; }
|
|
1222
|
+
if ( safe.logLevel > 1 ) {
|
|
1223
|
+
safe.uboLog(logPrefix, `Matched optional "propsToMatch"\n${extraArgs.propsToMatch}`);
|
|
1224
|
+
}
|
|
1134
1225
|
return fetchPromise.then(responseBefore => {
|
|
1135
1226
|
const response = responseBefore.clone();
|
|
1136
1227
|
return response.json().then(objBefore => {
|
|
@@ -1143,6 +1234,7 @@ function jsonPruneFetchResponseFn(
|
|
|
1143
1234
|
extraArgs
|
|
1144
1235
|
);
|
|
1145
1236
|
if ( typeof objAfter !== 'object' ) { return responseBefore; }
|
|
1237
|
+
safe.uboLog(logPrefix, 'Pruned');
|
|
1146
1238
|
const responseAfter = Response.json(objAfter, {
|
|
1147
1239
|
status: responseBefore.status,
|
|
1148
1240
|
statusText: responseBefore.statusText,
|
|
@@ -1156,11 +1248,11 @@ function jsonPruneFetchResponseFn(
|
|
|
1156
1248
|
});
|
|
1157
1249
|
return responseAfter;
|
|
1158
1250
|
}).catch(reason => {
|
|
1159
|
-
|
|
1251
|
+
safe.uboErr(logPrefix, 'Error:', reason);
|
|
1160
1252
|
return responseBefore;
|
|
1161
1253
|
});
|
|
1162
1254
|
}).catch(reason => {
|
|
1163
|
-
|
|
1255
|
+
safe.uboErr(logPrefix, 'Error:', reason);
|
|
1164
1256
|
return fetchPromise;
|
|
1165
1257
|
});
|
|
1166
1258
|
};
|
|
@@ -1178,7 +1270,6 @@ builtinScriptlets.push({
|
|
|
1178
1270
|
'match-object-properties.fn',
|
|
1179
1271
|
'parse-properties-to-match.fn',
|
|
1180
1272
|
'safe-self.fn',
|
|
1181
|
-
'should-log.fn',
|
|
1182
1273
|
],
|
|
1183
1274
|
});
|
|
1184
1275
|
function replaceFetchResponseFn(
|
|
@@ -1189,27 +1280,24 @@ function replaceFetchResponseFn(
|
|
|
1189
1280
|
) {
|
|
1190
1281
|
if ( trusted !== true ) { return; }
|
|
1191
1282
|
const safe = safeSelf();
|
|
1192
|
-
const
|
|
1193
|
-
const logLevel = shouldLog({
|
|
1194
|
-
log: pattern === '' || extraArgs.log,
|
|
1195
|
-
});
|
|
1196
|
-
const log = logLevel ? ((...args) => { safe.uboLog(...args); }) : (( ) => { });
|
|
1283
|
+
const logPrefix = safe.makeLogPrefix('replace-fetch-response', pattern, replacement, propsToMatch);
|
|
1197
1284
|
if ( pattern === '*' ) { pattern = '.*'; }
|
|
1198
1285
|
const rePattern = safe.patternToRegex(pattern);
|
|
1199
1286
|
const propNeedles = parsePropertiesToMatch(propsToMatch, 'url');
|
|
1200
1287
|
self.fetch = new Proxy(self.fetch, {
|
|
1201
1288
|
apply: function(target, thisArg, args) {
|
|
1202
|
-
if ( logLevel === true ) {
|
|
1203
|
-
log('replace-fetch-response:', JSON.stringify(Array.from(args)).slice(1,-1));
|
|
1204
|
-
}
|
|
1205
1289
|
const fetchPromise = Reflect.apply(target, thisArg, args);
|
|
1206
1290
|
if ( pattern === '' ) { return fetchPromise; }
|
|
1207
1291
|
let outcome = 'match';
|
|
1208
1292
|
if ( propNeedles.size !== 0 ) {
|
|
1209
1293
|
const objs = [ args[0] instanceof Object ? args[0] : { url: args[0] } ];
|
|
1210
1294
|
if ( objs[0] instanceof Request ) {
|
|
1211
|
-
try {
|
|
1212
|
-
|
|
1295
|
+
try {
|
|
1296
|
+
objs[0] = safe.Request_clone.call(objs[0]);
|
|
1297
|
+
}
|
|
1298
|
+
catch(ex) {
|
|
1299
|
+
safe.uboErr(logPrefix, ex);
|
|
1300
|
+
}
|
|
1213
1301
|
}
|
|
1214
1302
|
if ( args[1] instanceof Object ) {
|
|
1215
1303
|
objs.push(args[1]);
|
|
@@ -1217,28 +1305,18 @@ function replaceFetchResponseFn(
|
|
|
1217
1305
|
if ( matchObjectProperties(propNeedles, ...objs) === false ) {
|
|
1218
1306
|
outcome = 'nomatch';
|
|
1219
1307
|
}
|
|
1220
|
-
if ( outcome === logLevel || logLevel === 'all' ) {
|
|
1221
|
-
log(
|
|
1222
|
-
`replace-fetch-response (${outcome})`,
|
|
1223
|
-
`\n\tpropsToMatch: ${JSON.stringify(Array.from(propNeedles)).slice(1,-1)}`,
|
|
1224
|
-
'\n\tprops:', ...args,
|
|
1225
|
-
);
|
|
1226
|
-
}
|
|
1227
1308
|
}
|
|
1228
1309
|
if ( outcome === 'nomatch' ) { return fetchPromise; }
|
|
1310
|
+
if ( safe.logLevel > 1 ) {
|
|
1311
|
+
safe.uboLog(logPrefix, `Matched "propsToMatch"\n${propsToMatch}`);
|
|
1312
|
+
}
|
|
1229
1313
|
return fetchPromise.then(responseBefore => {
|
|
1230
1314
|
const response = responseBefore.clone();
|
|
1231
1315
|
return response.text().then(textBefore => {
|
|
1232
1316
|
const textAfter = textBefore.replace(rePattern, replacement);
|
|
1233
1317
|
const outcome = textAfter !== textBefore ? 'match' : 'nomatch';
|
|
1234
|
-
if ( outcome === logLevel || logLevel === 'all' ) {
|
|
1235
|
-
log(
|
|
1236
|
-
`replace-fetch-response (${outcome})`,
|
|
1237
|
-
`\n\tpattern: ${pattern}`,
|
|
1238
|
-
`\n\treplacement: ${replacement}`,
|
|
1239
|
-
);
|
|
1240
|
-
}
|
|
1241
1318
|
if ( outcome === 'nomatch' ) { return responseBefore; }
|
|
1319
|
+
safe.uboLog(logPrefix, 'Replaced');
|
|
1242
1320
|
const responseAfter = new Response(textAfter, {
|
|
1243
1321
|
status: responseBefore.status,
|
|
1244
1322
|
statusText: responseBefore.statusText,
|
|
@@ -1252,17 +1330,48 @@ function replaceFetchResponseFn(
|
|
|
1252
1330
|
});
|
|
1253
1331
|
return responseAfter;
|
|
1254
1332
|
}).catch(reason => {
|
|
1255
|
-
|
|
1333
|
+
safe.uboErr(logPrefix, reason);
|
|
1256
1334
|
return responseBefore;
|
|
1257
1335
|
});
|
|
1258
1336
|
}).catch(reason => {
|
|
1259
|
-
|
|
1337
|
+
safe.uboErr(logPrefix, reason);
|
|
1260
1338
|
return fetchPromise;
|
|
1261
1339
|
});
|
|
1262
1340
|
}
|
|
1263
1341
|
});
|
|
1264
1342
|
}
|
|
1265
1343
|
|
|
1344
|
+
/******************************************************************************/
|
|
1345
|
+
|
|
1346
|
+
builtinScriptlets.push({
|
|
1347
|
+
name: 'proxy-apply.fn',
|
|
1348
|
+
fn: proxyApplyFn,
|
|
1349
|
+
dependencies: [
|
|
1350
|
+
'safe-self.fn',
|
|
1351
|
+
],
|
|
1352
|
+
});
|
|
1353
|
+
function proxyApplyFn(
|
|
1354
|
+
target = '',
|
|
1355
|
+
handler = ''
|
|
1356
|
+
) {
|
|
1357
|
+
let context = globalThis;
|
|
1358
|
+
let prop = target;
|
|
1359
|
+
for (;;) {
|
|
1360
|
+
const pos = prop.indexOf('.');
|
|
1361
|
+
if ( pos === -1 ) { break; }
|
|
1362
|
+
context = context[prop.slice(0, pos)];
|
|
1363
|
+
if ( context instanceof Object === false ) { return; }
|
|
1364
|
+
prop = prop.slice(pos+1);
|
|
1365
|
+
}
|
|
1366
|
+
const fn = context[prop];
|
|
1367
|
+
if ( typeof fn !== 'function' ) { return; }
|
|
1368
|
+
if ( fn.prototype && fn.prototype.constructor === fn ) {
|
|
1369
|
+
context[prop] = new Proxy(fn, { construct: handler });
|
|
1370
|
+
return (...args) => { return Reflect.construct(...args); };
|
|
1371
|
+
}
|
|
1372
|
+
context[prop] = new Proxy(fn, { apply: handler });
|
|
1373
|
+
return (...args) => { return Reflect.apply(...args); };
|
|
1374
|
+
}
|
|
1266
1375
|
|
|
1267
1376
|
/*******************************************************************************
|
|
1268
1377
|
|
|
@@ -1303,6 +1412,7 @@ builtinScriptlets.push({
|
|
|
1303
1412
|
fn: abortOnPropertyRead,
|
|
1304
1413
|
dependencies: [
|
|
1305
1414
|
'get-exception-token.fn',
|
|
1415
|
+
'safe-self.fn',
|
|
1306
1416
|
],
|
|
1307
1417
|
});
|
|
1308
1418
|
function abortOnPropertyRead(
|
|
@@ -1310,8 +1420,11 @@ function abortOnPropertyRead(
|
|
|
1310
1420
|
) {
|
|
1311
1421
|
if ( typeof chain !== 'string' ) { return; }
|
|
1312
1422
|
if ( chain === '' ) { return; }
|
|
1423
|
+
const safe = safeSelf();
|
|
1424
|
+
const logPrefix = safe.makeLogPrefix('abort-on-property-read', chain);
|
|
1313
1425
|
const exceptionToken = getExceptionToken();
|
|
1314
1426
|
const abort = function() {
|
|
1427
|
+
safe.uboLog(logPrefix, 'Aborted');
|
|
1315
1428
|
throw new ReferenceError(exceptionToken);
|
|
1316
1429
|
};
|
|
1317
1430
|
const makeProxy = function(owner, chain) {
|
|
@@ -1359,6 +1472,7 @@ builtinScriptlets.push({
|
|
|
1359
1472
|
fn: abortOnPropertyWrite,
|
|
1360
1473
|
dependencies: [
|
|
1361
1474
|
'get-exception-token.fn',
|
|
1475
|
+
'safe-self.fn',
|
|
1362
1476
|
],
|
|
1363
1477
|
});
|
|
1364
1478
|
function abortOnPropertyWrite(
|
|
@@ -1366,6 +1480,8 @@ function abortOnPropertyWrite(
|
|
|
1366
1480
|
) {
|
|
1367
1481
|
if ( typeof prop !== 'string' ) { return; }
|
|
1368
1482
|
if ( prop === '' ) { return; }
|
|
1483
|
+
const safe = safeSelf();
|
|
1484
|
+
const logPrefix = safe.makeLogPrefix('abort-on-property-write', prop);
|
|
1369
1485
|
const exceptionToken = getExceptionToken();
|
|
1370
1486
|
let owner = window;
|
|
1371
1487
|
for (;;) {
|
|
@@ -1378,6 +1494,7 @@ function abortOnPropertyWrite(
|
|
|
1378
1494
|
delete owner[prop];
|
|
1379
1495
|
Object.defineProperty(owner, prop, {
|
|
1380
1496
|
set: function() {
|
|
1497
|
+
safe.uboLog(logPrefix, 'Aborted');
|
|
1381
1498
|
throw new ReferenceError(exceptionToken);
|
|
1382
1499
|
}
|
|
1383
1500
|
});
|
|
@@ -1462,7 +1579,6 @@ builtinScriptlets.push({
|
|
|
1462
1579
|
'run-at.fn',
|
|
1463
1580
|
'safe-self.fn',
|
|
1464
1581
|
'should-debug.fn',
|
|
1465
|
-
'should-log.fn',
|
|
1466
1582
|
],
|
|
1467
1583
|
});
|
|
1468
1584
|
// https://github.com/uBlockOrigin/uAssets/issues/9123#issuecomment-848255120
|
|
@@ -1472,32 +1588,68 @@ function addEventListenerDefuser(
|
|
|
1472
1588
|
) {
|
|
1473
1589
|
const safe = safeSelf();
|
|
1474
1590
|
const extraArgs = safe.getExtraArgs(Array.from(arguments), 2);
|
|
1591
|
+
const logPrefix = safe.makeLogPrefix('prevent-addEventListener', type, pattern);
|
|
1475
1592
|
const reType = safe.patternToRegex(type, undefined, true);
|
|
1476
1593
|
const rePattern = safe.patternToRegex(pattern);
|
|
1477
|
-
const log = shouldLog(extraArgs);
|
|
1478
1594
|
const debug = shouldDebug(extraArgs);
|
|
1595
|
+
const targetSelector = extraArgs.elements || undefined;
|
|
1596
|
+
const elementMatches = elem => {
|
|
1597
|
+
if ( elem && elem.matches && elem.matches(targetSelector) ) { return true; }
|
|
1598
|
+
const elems = Array.from(document.querySelectorAll(targetSelector));
|
|
1599
|
+
return elems.includes(elem);
|
|
1600
|
+
};
|
|
1601
|
+
const elementDetails = elem => {
|
|
1602
|
+
if ( elem instanceof Window ) { return 'window'; }
|
|
1603
|
+
if ( elem instanceof Document ) { return 'document'; }
|
|
1604
|
+
if ( elem instanceof Element === false ) { return '?'; }
|
|
1605
|
+
const parts = [];
|
|
1606
|
+
if ( elem.id !== '' ) { parts.push(`#${CSS.escape(elem.id)}`); }
|
|
1607
|
+
for ( let i = 0; i < elem.classList.length; i++ ) {
|
|
1608
|
+
parts.push(`.${CSS.escape(elem.classList.item(i))}`);
|
|
1609
|
+
}
|
|
1610
|
+
for ( let i = 0; i < elem.attributes.length; i++ ) {
|
|
1611
|
+
const attr = elem.attributes.item(i);
|
|
1612
|
+
if ( attr.name === 'id' ) { continue; }
|
|
1613
|
+
if ( attr.name === 'class' ) { continue; }
|
|
1614
|
+
parts.push(`[${CSS.escape(attr.name)}="${attr.value}"]`);
|
|
1615
|
+
}
|
|
1616
|
+
return parts.join('');
|
|
1617
|
+
};
|
|
1618
|
+
const shouldPrevent = (thisArg, type, handler) => {
|
|
1619
|
+
const matchesType = safe.RegExp_test.call(reType, type);
|
|
1620
|
+
const matchesHandler = safe.RegExp_test.call(rePattern, handler);
|
|
1621
|
+
const matchesEither = matchesType || matchesHandler;
|
|
1622
|
+
const matchesBoth = matchesType && matchesHandler;
|
|
1623
|
+
if ( debug === 1 && matchesBoth || debug === 2 && matchesEither ) {
|
|
1624
|
+
debugger; // jshint ignore:line
|
|
1625
|
+
}
|
|
1626
|
+
if ( matchesBoth && targetSelector !== undefined ) {
|
|
1627
|
+
if ( elementMatches(thisArg) === false ) { return false; }
|
|
1628
|
+
}
|
|
1629
|
+
return matchesBoth;
|
|
1630
|
+
};
|
|
1479
1631
|
const trapEddEventListeners = ( ) => {
|
|
1480
1632
|
const eventListenerHandler = {
|
|
1481
1633
|
apply: function(target, thisArg, args) {
|
|
1482
|
-
let
|
|
1634
|
+
let t, h;
|
|
1483
1635
|
try {
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1636
|
+
t = String(args[0]);
|
|
1637
|
+
if ( typeof args[1] === 'function' ) {
|
|
1638
|
+
h = String(safe.Function_toString(args[1]));
|
|
1639
|
+
} else if ( typeof args[1] === 'object' && args[1] !== null ) {
|
|
1640
|
+
if ( typeof args[1].handleEvent === 'function' ) {
|
|
1641
|
+
h = String(safe.Function_toString(args[1].handleEvent));
|
|
1642
|
+
}
|
|
1643
|
+
} else {
|
|
1644
|
+
h = String(args[1]);
|
|
1645
|
+
}
|
|
1488
1646
|
} catch(ex) {
|
|
1489
1647
|
}
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
if ( log === 1 && matchesBoth || log === 2 && matchesEither || log === 3 ) {
|
|
1495
|
-
safe.uboLog(`addEventListener('${type}', ${handler})`);
|
|
1496
|
-
}
|
|
1497
|
-
if ( debug === 1 && matchesBoth || debug === 2 && matchesEither ) {
|
|
1498
|
-
debugger; // jshint ignore:line
|
|
1648
|
+
if ( type === '' && pattern === '' ) {
|
|
1649
|
+
safe.uboLog(logPrefix, `Called: ${t}\n${h}\n${elementDetails(thisArg)}`);
|
|
1650
|
+
} else if ( shouldPrevent(thisArg, t, h) ) {
|
|
1651
|
+
return safe.uboLog(logPrefix, `Prevented: ${t}\n${h}\n${elementDetails(thisArg)}`);
|
|
1499
1652
|
}
|
|
1500
|
-
if ( matchesBoth ) { return; }
|
|
1501
1653
|
return Reflect.apply(target, thisArg, args);
|
|
1502
1654
|
},
|
|
1503
1655
|
get(target, prop, receiver) {
|
|
@@ -1533,19 +1685,28 @@ function jsonPrune(
|
|
|
1533
1685
|
stackNeedle = ''
|
|
1534
1686
|
) {
|
|
1535
1687
|
const safe = safeSelf();
|
|
1688
|
+
const logPrefix = safe.makeLogPrefix('json-prune', rawPrunePaths, rawNeedlePaths, stackNeedle);
|
|
1536
1689
|
const stackNeedleDetails = safe.initPattern(stackNeedle, { canNegate: true });
|
|
1537
1690
|
const extraArgs = safe.getExtraArgs(Array.from(arguments), 3);
|
|
1538
1691
|
JSON.parse = new Proxy(JSON.parse, {
|
|
1539
1692
|
apply: function(target, thisArg, args) {
|
|
1540
1693
|
const objBefore = Reflect.apply(target, thisArg, args);
|
|
1694
|
+
if ( rawPrunePaths === '' ) {
|
|
1695
|
+
safe.uboLog(logPrefix, safe.JSON_stringify(objBefore, null, 2));
|
|
1696
|
+
}
|
|
1541
1697
|
const objAfter = objectPruneFn(
|
|
1542
1698
|
objBefore,
|
|
1543
1699
|
rawPrunePaths,
|
|
1544
1700
|
rawNeedlePaths,
|
|
1545
1701
|
stackNeedleDetails,
|
|
1546
1702
|
extraArgs
|
|
1547
|
-
|
|
1548
|
-
|
|
1703
|
+
);
|
|
1704
|
+
if ( objAfter === undefined ) { return objBefore; }
|
|
1705
|
+
safe.uboLog(logPrefix, 'Pruned');
|
|
1706
|
+
if ( safe.logLevel > 1 ) {
|
|
1707
|
+
safe.uboLog(logPrefix, `After pruning:\n${safe.JSON_stringify(objAfter, null, 2)}`);
|
|
1708
|
+
}
|
|
1709
|
+
return objAfter;
|
|
1549
1710
|
},
|
|
1550
1711
|
});
|
|
1551
1712
|
}
|
|
@@ -1579,7 +1740,6 @@ builtinScriptlets.push({
|
|
|
1579
1740
|
'object-prune.fn',
|
|
1580
1741
|
'parse-properties-to-match.fn',
|
|
1581
1742
|
'safe-self.fn',
|
|
1582
|
-
'should-log.fn',
|
|
1583
1743
|
],
|
|
1584
1744
|
});
|
|
1585
1745
|
function jsonPruneXhrResponse(
|
|
@@ -1587,10 +1747,9 @@ function jsonPruneXhrResponse(
|
|
|
1587
1747
|
rawNeedlePaths = ''
|
|
1588
1748
|
) {
|
|
1589
1749
|
const safe = safeSelf();
|
|
1750
|
+
const logPrefix = safe.makeLogPrefix('json-prune-xhr-response', rawPrunePaths, rawNeedlePaths);
|
|
1590
1751
|
const xhrInstances = new WeakMap();
|
|
1591
1752
|
const extraArgs = safe.getExtraArgs(Array.from(arguments), 2);
|
|
1592
|
-
const logLevel = shouldLog({ log: rawPrunePaths === '' || extraArgs.log, });
|
|
1593
|
-
const log = logLevel ? ((...args) => { safe.uboLog(...args); }) : (( ) => { });
|
|
1594
1753
|
const propNeedles = parsePropertiesToMatch(extraArgs.propsToMatch, 'url');
|
|
1595
1754
|
const stackNeedle = safe.initPattern(extraArgs.stackToMatch || '', { canNegate: true });
|
|
1596
1755
|
self.XMLHttpRequest = class extends self.XMLHttpRequest {
|
|
@@ -1602,10 +1761,10 @@ function jsonPruneXhrResponse(
|
|
|
1602
1761
|
outcome = 'nomatch';
|
|
1603
1762
|
}
|
|
1604
1763
|
}
|
|
1605
|
-
if ( outcome === logLevel || outcome === 'all' ) {
|
|
1606
|
-
log(`xhr.open(${method}, ${url}, ${args.join(', ')})`);
|
|
1607
|
-
}
|
|
1608
1764
|
if ( outcome === 'match' ) {
|
|
1765
|
+
if ( safe.logLevel > 1 ) {
|
|
1766
|
+
safe.uboLog(logPrefix, `Matched optional "propsToMatch", "${extraArgs.propsToMatch}"`);
|
|
1767
|
+
}
|
|
1609
1768
|
xhrInstances.set(this, xhrDetails);
|
|
1610
1769
|
}
|
|
1611
1770
|
return super.open(method, url, ...args);
|
|
@@ -1630,8 +1789,10 @@ function jsonPruneXhrResponse(
|
|
|
1630
1789
|
if ( typeof innerResponse === 'object' ) {
|
|
1631
1790
|
objBefore = innerResponse;
|
|
1632
1791
|
} else if ( typeof innerResponse === 'string' ) {
|
|
1633
|
-
try {
|
|
1634
|
-
|
|
1792
|
+
try {
|
|
1793
|
+
objBefore = safe.JSON_parse(innerResponse);
|
|
1794
|
+
} catch(ex) {
|
|
1795
|
+
}
|
|
1635
1796
|
}
|
|
1636
1797
|
if ( typeof objBefore !== 'object' ) {
|
|
1637
1798
|
return (xhrDetails.response = innerResponse);
|
|
@@ -1648,6 +1809,7 @@ function jsonPruneXhrResponse(
|
|
|
1648
1809
|
outerResponse = typeof innerResponse === 'string'
|
|
1649
1810
|
? safe.JSON_stringify(objAfter)
|
|
1650
1811
|
: objAfter;
|
|
1812
|
+
safe.uboLog(logPrefix, 'Pruned');
|
|
1651
1813
|
} else {
|
|
1652
1814
|
outerResponse = innerResponse;
|
|
1653
1815
|
}
|
|
@@ -1826,9 +1988,9 @@ function noEvalIf(
|
|
|
1826
1988
|
/******************************************************************************/
|
|
1827
1989
|
|
|
1828
1990
|
builtinScriptlets.push({
|
|
1829
|
-
name: '
|
|
1991
|
+
name: 'prevent-fetch.js',
|
|
1830
1992
|
aliases: [
|
|
1831
|
-
'
|
|
1993
|
+
'no-fetch-if.js',
|
|
1832
1994
|
],
|
|
1833
1995
|
fn: noFetchIf,
|
|
1834
1996
|
dependencies: [
|
|
@@ -1842,6 +2004,7 @@ function noFetchIf(
|
|
|
1842
2004
|
) {
|
|
1843
2005
|
if ( typeof propsToMatch !== 'string' ) { return; }
|
|
1844
2006
|
const safe = safeSelf();
|
|
2007
|
+
const logPrefix = safe.makeLogPrefix('prevent-fetch', propsToMatch, responseBody);
|
|
1845
2008
|
const needles = [];
|
|
1846
2009
|
for ( const condition of propsToMatch.split(/\s+/) ) {
|
|
1847
2010
|
if ( condition === '' ) { continue; }
|
|
@@ -1856,7 +2019,6 @@ function noFetchIf(
|
|
|
1856
2019
|
}
|
|
1857
2020
|
needles.push({ key, re: safe.patternToRegex(value) });
|
|
1858
2021
|
}
|
|
1859
|
-
const log = needles.length === 0 ? console.log.bind(console) : undefined;
|
|
1860
2022
|
self.fetch = new Proxy(self.fetch, {
|
|
1861
2023
|
apply: function(target, thisArg, args) {
|
|
1862
2024
|
const details = args[0] instanceof self.Request
|
|
@@ -1868,17 +2030,16 @@ function noFetchIf(
|
|
|
1868
2030
|
for ( const prop in details ) {
|
|
1869
2031
|
let v = details[prop];
|
|
1870
2032
|
if ( typeof v !== 'string' ) {
|
|
1871
|
-
try { v =
|
|
2033
|
+
try { v = safe.JSON_stringify(v); }
|
|
1872
2034
|
catch(ex) { }
|
|
1873
2035
|
}
|
|
1874
2036
|
if ( typeof v !== 'string' ) { continue; }
|
|
1875
2037
|
props.set(prop, v);
|
|
1876
2038
|
}
|
|
1877
|
-
if (
|
|
1878
|
-
const out = Array.from(props)
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
log(`uBO: fetch(${out})`);
|
|
2039
|
+
if ( propsToMatch === '' && responseBody === '' ) {
|
|
2040
|
+
const out = Array.from(props).map(a => `${a[0]}:${a[1]}`);
|
|
2041
|
+
safe.uboLog(logPrefix, `Called: ${out.join('\n')}`);
|
|
2042
|
+
return Reflect.apply(target, thisArg, args);
|
|
1882
2043
|
}
|
|
1883
2044
|
proceed = needles.length === 0;
|
|
1884
2045
|
for ( const { key, re } of needles ) {
|
|
@@ -1902,21 +2063,23 @@ function noFetchIf(
|
|
|
1902
2063
|
responseType = desURL.origin !== document.location.origin
|
|
1903
2064
|
? 'cors'
|
|
1904
2065
|
: 'basic';
|
|
1905
|
-
} catch(
|
|
2066
|
+
} catch(ex) {
|
|
2067
|
+
safe.uboErr(logPrefix, `Error: ${ex}`);
|
|
1906
2068
|
}
|
|
1907
2069
|
}
|
|
1908
2070
|
return generateContentFn(responseBody).then(text => {
|
|
2071
|
+
safe.uboLog(logPrefix, `Prevented with response "${text}"`);
|
|
1909
2072
|
const response = new Response(text, {
|
|
1910
2073
|
statusText: 'OK',
|
|
1911
2074
|
headers: {
|
|
1912
2075
|
'Content-Length': text.length,
|
|
1913
2076
|
}
|
|
1914
2077
|
});
|
|
1915
|
-
|
|
2078
|
+
safe.Object_defineProperty(response, 'url', {
|
|
1916
2079
|
value: details.url
|
|
1917
2080
|
});
|
|
1918
2081
|
if ( responseType !== '' ) {
|
|
1919
|
-
|
|
2082
|
+
safe.Object_defineProperty(response, 'type', {
|
|
1920
2083
|
value: responseType
|
|
1921
2084
|
});
|
|
1922
2085
|
}
|
|
@@ -1937,6 +2100,7 @@ builtinScriptlets.push({
|
|
|
1937
2100
|
world: 'ISOLATED',
|
|
1938
2101
|
dependencies: [
|
|
1939
2102
|
'run-at.fn',
|
|
2103
|
+
'safe-self.fn',
|
|
1940
2104
|
],
|
|
1941
2105
|
});
|
|
1942
2106
|
// https://www.reddit.com/r/uBlockOrigin/comments/q0frv0/while_reading_a_sports_article_i_was_redirected/hf7wo9v/
|
|
@@ -1944,9 +2108,12 @@ function preventRefresh(
|
|
|
1944
2108
|
arg1 = ''
|
|
1945
2109
|
) {
|
|
1946
2110
|
if ( typeof arg1 !== 'string' ) { return; }
|
|
2111
|
+
const safe = safeSelf();
|
|
2112
|
+
const logPrefix = safe.makeLogPrefix('prevent-refresh', arg1);
|
|
1947
2113
|
const defuse = ( ) => {
|
|
1948
2114
|
const meta = document.querySelector('meta[http-equiv="refresh" i][content]');
|
|
1949
2115
|
if ( meta === null ) { return; }
|
|
2116
|
+
safe.uboLog(logPrefix, `Prevented "${meta.textContent}"`);
|
|
1950
2117
|
const s = arg1 === ''
|
|
1951
2118
|
? meta.getAttribute('content')
|
|
1952
2119
|
: arg1;
|
|
@@ -2146,13 +2313,13 @@ builtinScriptlets.push({
|
|
|
2146
2313
|
],
|
|
2147
2314
|
fn: setConstant,
|
|
2148
2315
|
dependencies: [
|
|
2149
|
-
'set-constant
|
|
2316
|
+
'set-constant.fn'
|
|
2150
2317
|
],
|
|
2151
2318
|
});
|
|
2152
2319
|
function setConstant(
|
|
2153
2320
|
...args
|
|
2154
2321
|
) {
|
|
2155
|
-
|
|
2322
|
+
setConstantFn(false, ...args);
|
|
2156
2323
|
}
|
|
2157
2324
|
|
|
2158
2325
|
/******************************************************************************/
|
|
@@ -2175,6 +2342,7 @@ function noSetIntervalIf(
|
|
|
2175
2342
|
) {
|
|
2176
2343
|
if ( typeof needle !== 'string' ) { return; }
|
|
2177
2344
|
const safe = safeSelf();
|
|
2345
|
+
const logPrefix = safe.makeLogPrefix('prevent-setInterval', needle, delay);
|
|
2178
2346
|
const needleNot = needle.charAt(0) === '!';
|
|
2179
2347
|
if ( needleNot ) { needle = needle.slice(1); }
|
|
2180
2348
|
if ( delay === '' ) { delay = undefined; }
|
|
@@ -2184,9 +2352,6 @@ function noSetIntervalIf(
|
|
|
2184
2352
|
if ( delayNot ) { delay = delay.slice(1); }
|
|
2185
2353
|
delay = parseInt(delay, 10);
|
|
2186
2354
|
}
|
|
2187
|
-
const log = needleNot === false && needle === '' && delay === undefined
|
|
2188
|
-
? console.log
|
|
2189
|
-
: undefined;
|
|
2190
2355
|
const reNeedle = safe.patternToRegex(needle);
|
|
2191
2356
|
self.setInterval = new Proxy(self.setInterval, {
|
|
2192
2357
|
apply: function(target, thisArg, args) {
|
|
@@ -2194,19 +2359,20 @@ function noSetIntervalIf(
|
|
|
2194
2359
|
? String(safe.Function_toString(args[0]))
|
|
2195
2360
|
: String(args[0]);
|
|
2196
2361
|
const b = args[1];
|
|
2197
|
-
if (
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
}
|
|
2362
|
+
if ( needle === '' && delay === undefined ) {
|
|
2363
|
+
safe.uboLog(logPrefix, `Called:\n${a}\n${b}`);
|
|
2364
|
+
return Reflect.apply(target, thisArg, args);
|
|
2365
|
+
}
|
|
2366
|
+
let defuse;
|
|
2367
|
+
if ( needle !== '' ) {
|
|
2368
|
+
defuse = reNeedle.test(a) !== needleNot;
|
|
2369
|
+
}
|
|
2370
|
+
if ( defuse !== false && delay !== undefined ) {
|
|
2371
|
+
defuse = (b === delay || isNaN(b) && isNaN(delay) ) !== delayNot;
|
|
2372
|
+
}
|
|
2373
|
+
if ( defuse ) {
|
|
2374
|
+
args[0] = function(){};
|
|
2375
|
+
safe.uboLog(logPrefix, `Prevented:\n${a}\n${b}`);
|
|
2210
2376
|
}
|
|
2211
2377
|
return Reflect.apply(target, thisArg, args);
|
|
2212
2378
|
},
|
|
@@ -2239,6 +2405,7 @@ function noSetTimeoutIf(
|
|
|
2239
2405
|
) {
|
|
2240
2406
|
if ( typeof needle !== 'string' ) { return; }
|
|
2241
2407
|
const safe = safeSelf();
|
|
2408
|
+
const logPrefix = safe.makeLogPrefix('prevent-setTimeout', needle, delay);
|
|
2242
2409
|
const needleNot = needle.charAt(0) === '!';
|
|
2243
2410
|
if ( needleNot ) { needle = needle.slice(1); }
|
|
2244
2411
|
if ( delay === '' ) { delay = undefined; }
|
|
@@ -2248,9 +2415,6 @@ function noSetTimeoutIf(
|
|
|
2248
2415
|
if ( delayNot ) { delay = delay.slice(1); }
|
|
2249
2416
|
delay = parseInt(delay, 10);
|
|
2250
2417
|
}
|
|
2251
|
-
const log = needleNot === false && needle === '' && delay === undefined
|
|
2252
|
-
? console.log
|
|
2253
|
-
: undefined;
|
|
2254
2418
|
const reNeedle = safe.patternToRegex(needle);
|
|
2255
2419
|
self.setTimeout = new Proxy(self.setTimeout, {
|
|
2256
2420
|
apply: function(target, thisArg, args) {
|
|
@@ -2258,19 +2422,20 @@ function noSetTimeoutIf(
|
|
|
2258
2422
|
? String(safe.Function_toString(args[0]))
|
|
2259
2423
|
: String(args[0]);
|
|
2260
2424
|
const b = args[1];
|
|
2261
|
-
if (
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
}
|
|
2425
|
+
if ( needle === '' && delay === undefined ) {
|
|
2426
|
+
safe.uboLog(logPrefix, `Called:\n${a}\n${b}`);
|
|
2427
|
+
return Reflect.apply(target, thisArg, args);
|
|
2428
|
+
}
|
|
2429
|
+
let defuse;
|
|
2430
|
+
if ( needle !== '' ) {
|
|
2431
|
+
defuse = reNeedle.test(a) !== needleNot;
|
|
2432
|
+
}
|
|
2433
|
+
if ( defuse !== false && delay !== undefined ) {
|
|
2434
|
+
defuse = (b === delay || isNaN(b) && isNaN(delay) ) !== delayNot;
|
|
2435
|
+
}
|
|
2436
|
+
if ( defuse ) {
|
|
2437
|
+
args[0] = function(){};
|
|
2438
|
+
safe.uboLog(logPrefix, `Prevented:\n${a}\n${b}`);
|
|
2274
2439
|
}
|
|
2275
2440
|
return Reflect.apply(target, thisArg, args);
|
|
2276
2441
|
},
|
|
@@ -2371,10 +2536,11 @@ function noXhrIf(
|
|
|
2371
2536
|
directive = ''
|
|
2372
2537
|
) {
|
|
2373
2538
|
if ( typeof propsToMatch !== 'string' ) { return; }
|
|
2539
|
+
const safe = safeSelf();
|
|
2540
|
+
const logPrefix = safe.makeLogPrefix('prevent-xhr', propsToMatch, directive);
|
|
2374
2541
|
const xhrInstances = new WeakMap();
|
|
2375
2542
|
const propNeedles = parsePropertiesToMatch(propsToMatch, 'url');
|
|
2376
|
-
const
|
|
2377
|
-
const warOrigin = scriptletGlobals.get('warOrigin');
|
|
2543
|
+
const warOrigin = scriptletGlobals.warOrigin;
|
|
2378
2544
|
const headers = {
|
|
2379
2545
|
'date': '',
|
|
2380
2546
|
'content-type': '',
|
|
@@ -2382,15 +2548,15 @@ function noXhrIf(
|
|
|
2382
2548
|
};
|
|
2383
2549
|
self.XMLHttpRequest = class extends self.XMLHttpRequest {
|
|
2384
2550
|
open(method, url, ...args) {
|
|
2385
|
-
if ( log !== undefined ) {
|
|
2386
|
-
log(`uBO: xhr.open(${method}, ${url}, ${args.join(', ')})`);
|
|
2387
|
-
return super.open(method, url, ...args);
|
|
2388
|
-
}
|
|
2389
2551
|
xhrInstances.delete(this);
|
|
2390
2552
|
if ( warOrigin !== undefined && url.startsWith(warOrigin) ) {
|
|
2391
2553
|
return super.open(method, url, ...args);
|
|
2392
2554
|
}
|
|
2393
2555
|
const haystack = { method, url };
|
|
2556
|
+
if ( propsToMatch === '' && directive === '' ) {
|
|
2557
|
+
safe.uboLog(logPrefix, `Called: ${safe.JSON_stringify(haystack, null, 2)}`);
|
|
2558
|
+
return super.open(method, url, ...args);
|
|
2559
|
+
}
|
|
2394
2560
|
if ( matchObjectProperties(propNeedles, haystack) ) {
|
|
2395
2561
|
xhrInstances.set(this, haystack);
|
|
2396
2562
|
}
|
|
@@ -2468,6 +2634,7 @@ function noXhrIf(
|
|
|
2468
2634
|
details.xhr.dispatchEvent(new Event('readystatechange'));
|
|
2469
2635
|
details.xhr.dispatchEvent(new Event('load'));
|
|
2470
2636
|
details.xhr.dispatchEvent(new Event('loadend'));
|
|
2637
|
+
safe.uboLog(logPrefix, `Prevented with response:\n${details.xhr.response}`);
|
|
2471
2638
|
});
|
|
2472
2639
|
}
|
|
2473
2640
|
getResponseHeader(headerName) {
|
|
@@ -2507,7 +2674,6 @@ builtinScriptlets.push({
|
|
|
2507
2674
|
fn: noWindowOpenIf,
|
|
2508
2675
|
dependencies: [
|
|
2509
2676
|
'safe-self.fn',
|
|
2510
|
-
'should-log.fn',
|
|
2511
2677
|
],
|
|
2512
2678
|
});
|
|
2513
2679
|
function noWindowOpenIf(
|
|
@@ -2516,6 +2682,7 @@ function noWindowOpenIf(
|
|
|
2516
2682
|
decoy = ''
|
|
2517
2683
|
) {
|
|
2518
2684
|
const safe = safeSelf();
|
|
2685
|
+
const logPrefix = safe.makeLogPrefix('no-window-open-if', pattern, delay, decoy);
|
|
2519
2686
|
const targetMatchResult = pattern.startsWith('!') === false;
|
|
2520
2687
|
if ( targetMatchResult === false ) {
|
|
2521
2688
|
pattern = pattern.slice(1);
|
|
@@ -2525,8 +2692,6 @@ function noWindowOpenIf(
|
|
|
2525
2692
|
if ( isNaN(autoRemoveAfter) ) {
|
|
2526
2693
|
autoRemoveAfter = -1;
|
|
2527
2694
|
}
|
|
2528
|
-
const extraArgs = safe.getExtraArgs(Array.from(arguments), 3);
|
|
2529
|
-
const logLevel = shouldLog(extraArgs);
|
|
2530
2695
|
const createDecoy = function(tag, urlProp, url) {
|
|
2531
2696
|
const decoyElem = document.createElement(tag);
|
|
2532
2697
|
decoyElem[urlProp] = url;
|
|
@@ -2541,12 +2706,13 @@ function noWindowOpenIf(
|
|
|
2541
2706
|
window.open = new Proxy(window.open, {
|
|
2542
2707
|
apply: function(target, thisArg, args) {
|
|
2543
2708
|
const haystack = args.join(' ');
|
|
2544
|
-
if ( logLevel ) {
|
|
2545
|
-
safe.uboLog('window.open:', haystack);
|
|
2546
|
-
}
|
|
2547
2709
|
if ( rePattern.test(haystack) !== targetMatchResult ) {
|
|
2710
|
+
if ( safe.logLevel > 1 ) {
|
|
2711
|
+
safe.uboLog(logPrefix, `Allowed (${args.join(', ')})`);
|
|
2712
|
+
}
|
|
2548
2713
|
return Reflect.apply(target, thisArg, args);
|
|
2549
2714
|
}
|
|
2715
|
+
safe.uboLog(logPrefix, `Prevented (${args.join(', ')})`);
|
|
2550
2716
|
if ( autoRemoveAfter < 0 ) { return null; }
|
|
2551
2717
|
const decoyElem = decoy === 'obj'
|
|
2552
2718
|
? createDecoy('object', 'data', ...args)
|
|
@@ -2568,14 +2734,14 @@ function noWindowOpenIf(
|
|
|
2568
2734
|
},
|
|
2569
2735
|
});
|
|
2570
2736
|
}
|
|
2571
|
-
if ( logLevel ) {
|
|
2737
|
+
if ( safe.logLevel !== 0 ) {
|
|
2572
2738
|
popup = new Proxy(popup, {
|
|
2573
2739
|
get: function(target, prop) {
|
|
2574
|
-
safe.uboLog('window.open / get', prop, '===', target[prop]);
|
|
2740
|
+
safe.uboLog(logPrefix, 'window.open / get', prop, '===', target[prop]);
|
|
2575
2741
|
return Reflect.get(...arguments);
|
|
2576
2742
|
},
|
|
2577
2743
|
set: function(target, prop, value) {
|
|
2578
|
-
safe.uboLog('window.open / set', prop, '=', value);
|
|
2744
|
+
safe.uboLog(logPrefix, 'window.open / set', prop, '=', value);
|
|
2579
2745
|
return Reflect.set(...arguments);
|
|
2580
2746
|
},
|
|
2581
2747
|
});
|
|
@@ -2757,31 +2923,6 @@ function noWebrtc() {
|
|
|
2757
2923
|
|
|
2758
2924
|
/******************************************************************************/
|
|
2759
2925
|
|
|
2760
|
-
builtinScriptlets.push({
|
|
2761
|
-
name: 'golem.de.js',
|
|
2762
|
-
fn: golemDe,
|
|
2763
|
-
});
|
|
2764
|
-
// https://github.com/uBlockOrigin/uAssets/issues/88
|
|
2765
|
-
function golemDe() {
|
|
2766
|
-
const rael = window.addEventListener;
|
|
2767
|
-
window.addEventListener = function(a, b) {
|
|
2768
|
-
rael(...arguments);
|
|
2769
|
-
let haystack;
|
|
2770
|
-
try {
|
|
2771
|
-
haystack = b.toString();
|
|
2772
|
-
} catch(ex) {
|
|
2773
|
-
}
|
|
2774
|
-
if (
|
|
2775
|
-
typeof haystack === 'string' &&
|
|
2776
|
-
/^\s*function\s*\(\)\s*\{\s*window\.clearTimeout\(r\)\s*\}\s*$/.test(haystack)
|
|
2777
|
-
) {
|
|
2778
|
-
b();
|
|
2779
|
-
}
|
|
2780
|
-
}.bind(window);
|
|
2781
|
-
}
|
|
2782
|
-
|
|
2783
|
-
/******************************************************************************/
|
|
2784
|
-
|
|
2785
2926
|
builtinScriptlets.push({
|
|
2786
2927
|
name: 'disable-newtab-links.js',
|
|
2787
2928
|
fn: disableNewtabLinks,
|
|
@@ -2884,7 +3025,6 @@ builtinScriptlets.push({
|
|
|
2884
3025
|
fn: xmlPrune,
|
|
2885
3026
|
dependencies: [
|
|
2886
3027
|
'safe-self.fn',
|
|
2887
|
-
'should-log.fn',
|
|
2888
3028
|
],
|
|
2889
3029
|
});
|
|
2890
3030
|
function xmlPrune(
|
|
@@ -2895,9 +3035,9 @@ function xmlPrune(
|
|
|
2895
3035
|
if ( typeof selector !== 'string' ) { return; }
|
|
2896
3036
|
if ( selector === '' ) { return; }
|
|
2897
3037
|
const safe = safeSelf();
|
|
3038
|
+
const logPrefix = safe.makeLogPrefix('xml-prune', selector, selectorCheck, urlPattern);
|
|
2898
3039
|
const reUrl = safe.patternToRegex(urlPattern);
|
|
2899
3040
|
const extraArgs = safe.getExtraArgs(Array.from(arguments), 3);
|
|
2900
|
-
const log = shouldLog(extraArgs) ? ((...args) => { safe.uboLog(...args); }) : (( ) => { });
|
|
2901
3041
|
const queryAll = (xmlDoc, selector) => {
|
|
2902
3042
|
const isXpath = /^xpath\(.+\)$/.test(selector);
|
|
2903
3043
|
if ( isXpath === false ) {
|
|
@@ -2924,21 +3064,21 @@ function xmlPrune(
|
|
|
2924
3064
|
}
|
|
2925
3065
|
if ( extraArgs.logdoc ) {
|
|
2926
3066
|
const serializer = new XMLSerializer();
|
|
2927
|
-
|
|
3067
|
+
safe.uboLog(logPrefix, `Document is\n\t${serializer.serializeToString(xmlDoc)}`);
|
|
2928
3068
|
}
|
|
2929
3069
|
const items = queryAll(xmlDoc, selector);
|
|
2930
3070
|
if ( items.length === 0 ) { return xmlDoc; }
|
|
2931
|
-
|
|
3071
|
+
safe.uboLog(logPrefix, `Removing ${items.length} items`);
|
|
2932
3072
|
for ( const item of items ) {
|
|
2933
3073
|
if ( item.nodeType === 1 ) {
|
|
2934
3074
|
item.remove();
|
|
2935
3075
|
} else if ( item.nodeType === 2 ) {
|
|
2936
3076
|
item.ownerElement.removeAttribute(item.nodeName);
|
|
2937
3077
|
}
|
|
2938
|
-
|
|
3078
|
+
safe.uboLog(logPrefix, `${item.constructor.name}.${item.nodeName} removed`);
|
|
2939
3079
|
}
|
|
2940
3080
|
} catch(ex) {
|
|
2941
|
-
|
|
3081
|
+
safe.uboErr(logPrefix, `Error: ${ex}`);
|
|
2942
3082
|
}
|
|
2943
3083
|
return xmlDoc;
|
|
2944
3084
|
};
|
|
@@ -3030,7 +3170,6 @@ builtinScriptlets.push({
|
|
|
3030
3170
|
fn: m3uPrune,
|
|
3031
3171
|
dependencies: [
|
|
3032
3172
|
'safe-self.fn',
|
|
3033
|
-
'should-log.fn',
|
|
3034
3173
|
],
|
|
3035
3174
|
});
|
|
3036
3175
|
// https://en.wikipedia.org/wiki/M3U
|
|
@@ -3040,9 +3179,8 @@ function m3uPrune(
|
|
|
3040
3179
|
) {
|
|
3041
3180
|
if ( typeof m3uPattern !== 'string' ) { return; }
|
|
3042
3181
|
const safe = safeSelf();
|
|
3043
|
-
const
|
|
3044
|
-
const
|
|
3045
|
-
const uboLog = logLevel ? ((...args) => safe.uboLog(...args)) : (( ) => { });
|
|
3182
|
+
const logPrefix = safe.makeLogPrefix('m3u-prune', m3uPattern, urlPattern);
|
|
3183
|
+
const toLog = [];
|
|
3046
3184
|
const regexFromArg = arg => {
|
|
3047
3185
|
if ( arg === '' ) { return /^/; }
|
|
3048
3186
|
const match = /^\/(.+)\/([gms]*)$/.exec(arg);
|
|
@@ -3061,22 +3199,22 @@ function m3uPrune(
|
|
|
3061
3199
|
if ( lines[i].startsWith('#EXT-X-CUE:TYPE="SpliceOut"') === false ) {
|
|
3062
3200
|
return false;
|
|
3063
3201
|
}
|
|
3064
|
-
|
|
3202
|
+
toLog.push(`\t${lines[i]}`);
|
|
3065
3203
|
lines[i] = undefined; i += 1;
|
|
3066
3204
|
if ( lines[i].startsWith('#EXT-X-ASSET:CAID') ) {
|
|
3067
|
-
|
|
3205
|
+
toLog.push(`\t${lines[i]}`);
|
|
3068
3206
|
lines[i] = undefined; i += 1;
|
|
3069
3207
|
}
|
|
3070
3208
|
if ( lines[i].startsWith('#EXT-X-SCTE35:') ) {
|
|
3071
|
-
|
|
3209
|
+
toLog.push(`\t${lines[i]}`);
|
|
3072
3210
|
lines[i] = undefined; i += 1;
|
|
3073
3211
|
}
|
|
3074
3212
|
if ( lines[i].startsWith('#EXT-X-CUE-IN') ) {
|
|
3075
|
-
|
|
3213
|
+
toLog.push(`\t${lines[i]}`);
|
|
3076
3214
|
lines[i] = undefined; i += 1;
|
|
3077
3215
|
}
|
|
3078
3216
|
if ( lines[i].startsWith('#EXT-X-SCTE35:') ) {
|
|
3079
|
-
|
|
3217
|
+
toLog.push(`\t${lines[i]}`);
|
|
3080
3218
|
lines[i] = undefined; i += 1;
|
|
3081
3219
|
}
|
|
3082
3220
|
return true;
|
|
@@ -3084,10 +3222,10 @@ function m3uPrune(
|
|
|
3084
3222
|
const pruneInfBlock = (lines, i) => {
|
|
3085
3223
|
if ( lines[i].startsWith('#EXTINF') === false ) { return false; }
|
|
3086
3224
|
if ( reM3u.test(lines[i+1]) === false ) { return false; }
|
|
3087
|
-
|
|
3225
|
+
toLog.push('Discarding', `\t${lines[i]}, \t${lines[i+1]}`);
|
|
3088
3226
|
lines[i] = lines[i+1] = undefined; i += 2;
|
|
3089
3227
|
if ( lines[i].startsWith('#EXT-X-DISCONTINUITY') ) {
|
|
3090
|
-
|
|
3228
|
+
toLog.push(`\t${lines[i]}`);
|
|
3091
3229
|
lines[i] = undefined; i += 1;
|
|
3092
3230
|
}
|
|
3093
3231
|
return true;
|
|
@@ -3124,9 +3262,7 @@ function m3uPrune(
|
|
|
3124
3262
|
}
|
|
3125
3263
|
text = before.trim() + '\n' + after.trim();
|
|
3126
3264
|
reM3u.lastIndex = before.length + 1;
|
|
3127
|
-
|
|
3128
|
-
discard.split(/\n+/).map(s => `\t${s}`).join('\n')
|
|
3129
|
-
);
|
|
3265
|
+
toLog.push('Discarding', ...discard.split(/\n+/).map(s => `\t${s}`));
|
|
3130
3266
|
if ( reM3u.global === false ) { break; }
|
|
3131
3267
|
}
|
|
3132
3268
|
return text;
|
|
@@ -3151,13 +3287,18 @@ function m3uPrune(
|
|
|
3151
3287
|
return Reflect.apply(target, thisArg, args);
|
|
3152
3288
|
}
|
|
3153
3289
|
return realFetch(...args).then(realResponse =>
|
|
3154
|
-
realResponse.text().then(text =>
|
|
3155
|
-
new Response(pruner(text), {
|
|
3290
|
+
realResponse.text().then(text => {
|
|
3291
|
+
const response = new Response(pruner(text), {
|
|
3156
3292
|
status: realResponse.status,
|
|
3157
3293
|
statusText: realResponse.statusText,
|
|
3158
3294
|
headers: realResponse.headers,
|
|
3159
|
-
})
|
|
3160
|
-
|
|
3295
|
+
});
|
|
3296
|
+
if ( toLog.length !== 0 ) {
|
|
3297
|
+
toLog.unshift(logPrefix);
|
|
3298
|
+
safe.uboLog(toLog.join('\n'));
|
|
3299
|
+
}
|
|
3300
|
+
return response;
|
|
3301
|
+
})
|
|
3161
3302
|
);
|
|
3162
3303
|
}
|
|
3163
3304
|
});
|
|
@@ -3175,6 +3316,10 @@ function m3uPrune(
|
|
|
3175
3316
|
if ( textout === textin ) { return; }
|
|
3176
3317
|
Object.defineProperty(thisArg, 'response', { value: textout });
|
|
3177
3318
|
Object.defineProperty(thisArg, 'responseText', { value: textout });
|
|
3319
|
+
if ( toLog.length !== 0 ) {
|
|
3320
|
+
toLog.unshift(logPrefix);
|
|
3321
|
+
safe.uboLog(toLog.join('\n'));
|
|
3322
|
+
}
|
|
3178
3323
|
});
|
|
3179
3324
|
return Reflect.apply(target, thisArg, args);
|
|
3180
3325
|
}
|
|
@@ -3220,6 +3365,7 @@ builtinScriptlets.push({
|
|
|
3220
3365
|
world: 'ISOLATED',
|
|
3221
3366
|
dependencies: [
|
|
3222
3367
|
'run-at.fn',
|
|
3368
|
+
'safe-self.fn',
|
|
3223
3369
|
],
|
|
3224
3370
|
});
|
|
3225
3371
|
function hrefSanitizer(
|
|
@@ -3228,6 +3374,8 @@ function hrefSanitizer(
|
|
|
3228
3374
|
) {
|
|
3229
3375
|
if ( typeof selector !== 'string' ) { return; }
|
|
3230
3376
|
if ( selector === '' ) { return; }
|
|
3377
|
+
const safe = safeSelf();
|
|
3378
|
+
const logPrefix = safe.makeLogPrefix('href-sanitizer', selector, source);
|
|
3231
3379
|
if ( source === '' ) { source = 'text'; }
|
|
3232
3380
|
const sanitizeCopycats = (href, text) => {
|
|
3233
3381
|
let elems = [];
|
|
@@ -3239,6 +3387,7 @@ function hrefSanitizer(
|
|
|
3239
3387
|
for ( const elem of elems ) {
|
|
3240
3388
|
elem.setAttribute('href', text);
|
|
3241
3389
|
}
|
|
3390
|
+
return elems.length;
|
|
3242
3391
|
};
|
|
3243
3392
|
const validateURL = text => {
|
|
3244
3393
|
if ( text === '' ) { return ''; }
|
|
@@ -3287,7 +3436,8 @@ function hrefSanitizer(
|
|
|
3287
3436
|
if ( hrefAfter === '' ) { continue; }
|
|
3288
3437
|
if ( hrefAfter === href ) { continue; }
|
|
3289
3438
|
elem.setAttribute('href', hrefAfter);
|
|
3290
|
-
sanitizeCopycats(href, hrefAfter);
|
|
3439
|
+
const count = sanitizeCopycats(href, hrefAfter);
|
|
3440
|
+
safe.uboLog(logPrefix, `Sanitized ${count+1} links to\n${hrefAfter}`);
|
|
3291
3441
|
}
|
|
3292
3442
|
return true;
|
|
3293
3443
|
};
|
|
@@ -3402,15 +3552,15 @@ function spoofCSS(
|
|
|
3402
3552
|
propToValueMap.set(toCamelCase(args[i+0]), args[i+1]);
|
|
3403
3553
|
}
|
|
3404
3554
|
const safe = safeSelf();
|
|
3405
|
-
const
|
|
3555
|
+
const logPrefix = safe.makeLogPrefix('spoof-css', selector, ...args);
|
|
3556
|
+
const canDebug = scriptletGlobals.canDebug;
|
|
3406
3557
|
const shouldDebug = canDebug && propToValueMap.get('debug') || 0;
|
|
3407
|
-
const shouldLog = canDebug && propToValueMap.has('log') || 0;
|
|
3408
3558
|
const spoofStyle = (prop, real) => {
|
|
3409
3559
|
const normalProp = toCamelCase(prop);
|
|
3410
3560
|
const shouldSpoof = propToValueMap.has(normalProp);
|
|
3411
3561
|
const value = shouldSpoof ? propToValueMap.get(normalProp) : real;
|
|
3412
|
-
if (
|
|
3413
|
-
safe.uboLog(
|
|
3562
|
+
if ( shouldSpoof ) {
|
|
3563
|
+
safe.uboLog(logPrefix, `Spoofing ${prop} to ${value}`);
|
|
3414
3564
|
}
|
|
3415
3565
|
return value;
|
|
3416
3566
|
};
|
|
@@ -3524,6 +3674,8 @@ function setCookie(
|
|
|
3524
3674
|
path = ''
|
|
3525
3675
|
) {
|
|
3526
3676
|
if ( name === '' ) { return; }
|
|
3677
|
+
const safe = safeSelf();
|
|
3678
|
+
const logPrefix = safe.makeLogPrefix('set-cookie', name, value, path);
|
|
3527
3679
|
name = encodeURIComponent(name);
|
|
3528
3680
|
|
|
3529
3681
|
const validValues = [
|
|
@@ -3548,14 +3700,18 @@ function setCookie(
|
|
|
3548
3700
|
if ( n > 15 ) { return; }
|
|
3549
3701
|
}
|
|
3550
3702
|
|
|
3551
|
-
setCookieFn(
|
|
3703
|
+
const done = setCookieFn(
|
|
3552
3704
|
false,
|
|
3553
3705
|
name,
|
|
3554
3706
|
value,
|
|
3555
3707
|
'',
|
|
3556
3708
|
path,
|
|
3557
|
-
|
|
3709
|
+
safe.getExtraArgs(Array.from(arguments), 3)
|
|
3558
3710
|
);
|
|
3711
|
+
|
|
3712
|
+
if ( done ) {
|
|
3713
|
+
safe.uboLog(logPrefix, 'Done');
|
|
3714
|
+
}
|
|
3559
3715
|
}
|
|
3560
3716
|
|
|
3561
3717
|
// For compatibility with AdGuard
|
|
@@ -3641,6 +3797,7 @@ builtinScriptlets.push({
|
|
|
3641
3797
|
world: 'ISOLATED',
|
|
3642
3798
|
dependencies: [
|
|
3643
3799
|
'run-at.fn',
|
|
3800
|
+
'safe-self.fn',
|
|
3644
3801
|
],
|
|
3645
3802
|
});
|
|
3646
3803
|
function setAttr(
|
|
@@ -3648,9 +3805,11 @@ function setAttr(
|
|
|
3648
3805
|
attr = '',
|
|
3649
3806
|
value = ''
|
|
3650
3807
|
) {
|
|
3651
|
-
if ( typeof selector !== 'string' ) { return; }
|
|
3652
3808
|
if ( selector === '' ) { return; }
|
|
3809
|
+
if ( attr === '' ) { return; }
|
|
3653
3810
|
|
|
3811
|
+
const safe = safeSelf();
|
|
3812
|
+
const logPrefix = safe.makeLogPrefix('set-attr', attr, value);
|
|
3654
3813
|
const validValues = [ '', 'false', 'true' ];
|
|
3655
3814
|
let copyFrom = '';
|
|
3656
3815
|
|
|
@@ -3685,7 +3844,11 @@ function setAttr(
|
|
|
3685
3844
|
const before = elem.getAttribute(attr);
|
|
3686
3845
|
const after = extractValue(elem);
|
|
3687
3846
|
if ( after === before ) { continue; }
|
|
3847
|
+
if ( after !== '' && /^on/i.test(attr) ) {
|
|
3848
|
+
if ( attr.toLowerCase() in elem ) { continue; }
|
|
3849
|
+
}
|
|
3688
3850
|
elem.setAttribute(attr, after);
|
|
3851
|
+
safe.uboLog(logPrefix, `${attr}="${after}"`);
|
|
3689
3852
|
}
|
|
3690
3853
|
return true;
|
|
3691
3854
|
};
|
|
@@ -3806,6 +3969,58 @@ function multiup() {
|
|
|
3806
3969
|
document.addEventListener('click', handler, { capture: true });
|
|
3807
3970
|
}
|
|
3808
3971
|
|
|
3972
|
+
/******************************************************************************/
|
|
3973
|
+
|
|
3974
|
+
builtinScriptlets.push({
|
|
3975
|
+
name: 'remove-cache-storage-item.js',
|
|
3976
|
+
fn: removeCacheStorageItem,
|
|
3977
|
+
world: 'ISOLATED',
|
|
3978
|
+
dependencies: [
|
|
3979
|
+
'safe-self.fn',
|
|
3980
|
+
],
|
|
3981
|
+
});
|
|
3982
|
+
function removeCacheStorageItem(
|
|
3983
|
+
cacheNamePattern = '',
|
|
3984
|
+
requestPattern = ''
|
|
3985
|
+
) {
|
|
3986
|
+
if ( cacheNamePattern === '' ) { return; }
|
|
3987
|
+
const safe = safeSelf();
|
|
3988
|
+
const logPrefix = safe.makeLogPrefix('remove-cache-storage-item', cacheNamePattern, requestPattern);
|
|
3989
|
+
const cacheStorage = self.caches;
|
|
3990
|
+
if ( cacheStorage instanceof Object === false ) { return; }
|
|
3991
|
+
const reCache = safe.patternToRegex(cacheNamePattern, undefined, true);
|
|
3992
|
+
const reRequest = safe.patternToRegex(requestPattern, undefined, true);
|
|
3993
|
+
cacheStorage.keys().then(cacheNames => {
|
|
3994
|
+
for ( const cacheName of cacheNames ) {
|
|
3995
|
+
if ( reCache.test(cacheName) === false ) { continue; }
|
|
3996
|
+
if ( requestPattern === '' ) {
|
|
3997
|
+
cacheStorage.delete(cacheName).then(result => {
|
|
3998
|
+
if ( safe.logLevel > 1 ) {
|
|
3999
|
+
safe.uboLog(logPrefix, `Deleting ${cacheName}`);
|
|
4000
|
+
}
|
|
4001
|
+
if ( result !== true ) { return; }
|
|
4002
|
+
safe.uboLog(logPrefix, `Deleted ${cacheName}: ${result}`);
|
|
4003
|
+
});
|
|
4004
|
+
continue;
|
|
4005
|
+
}
|
|
4006
|
+
cacheStorage.open(cacheName).then(cache => {
|
|
4007
|
+
cache.keys().then(requests => {
|
|
4008
|
+
for ( const request of requests ) {
|
|
4009
|
+
if ( reRequest.test(request.url) === false ) { continue; }
|
|
4010
|
+
if ( safe.logLevel > 1 ) {
|
|
4011
|
+
safe.uboLog(logPrefix, `Deleting ${cacheName}/${request.url}`);
|
|
4012
|
+
}
|
|
4013
|
+
cache.delete(request).then(result => {
|
|
4014
|
+
if ( result !== true ) { return; }
|
|
4015
|
+
safe.uboLog(logPrefix, `Deleted ${cacheName}/${request.url}: ${result}`);
|
|
4016
|
+
});
|
|
4017
|
+
}
|
|
4018
|
+
});
|
|
4019
|
+
});
|
|
4020
|
+
}
|
|
4021
|
+
});
|
|
4022
|
+
}
|
|
4023
|
+
|
|
3809
4024
|
|
|
3810
4025
|
/*******************************************************************************
|
|
3811
4026
|
*
|
|
@@ -3883,13 +4098,13 @@ builtinScriptlets.push({
|
|
|
3883
4098
|
],
|
|
3884
4099
|
fn: trustedSetConstant,
|
|
3885
4100
|
dependencies: [
|
|
3886
|
-
'set-constant
|
|
4101
|
+
'set-constant.fn'
|
|
3887
4102
|
],
|
|
3888
4103
|
});
|
|
3889
4104
|
function trustedSetConstant(
|
|
3890
4105
|
...args
|
|
3891
4106
|
) {
|
|
3892
|
-
|
|
4107
|
+
setConstantFn(true, ...args);
|
|
3893
4108
|
}
|
|
3894
4109
|
|
|
3895
4110
|
/*******************************************************************************
|
|
@@ -3921,6 +4136,8 @@ function trustedSetCookie(
|
|
|
3921
4136
|
) {
|
|
3922
4137
|
if ( name === '' ) { return; }
|
|
3923
4138
|
|
|
4139
|
+
const safe = safeSelf();
|
|
4140
|
+
const logPrefix = safe.makeLogPrefix('set-cookie', name, value, path);
|
|
3924
4141
|
const time = new Date();
|
|
3925
4142
|
|
|
3926
4143
|
if ( value === '$now$' ) {
|
|
@@ -3942,7 +4159,7 @@ function trustedSetCookie(
|
|
|
3942
4159
|
expires = time.toUTCString();
|
|
3943
4160
|
}
|
|
3944
4161
|
|
|
3945
|
-
setCookieFn(
|
|
4162
|
+
const done = setCookieFn(
|
|
3946
4163
|
true,
|
|
3947
4164
|
name,
|
|
3948
4165
|
value,
|
|
@@ -3950,6 +4167,10 @@ function trustedSetCookie(
|
|
|
3950
4167
|
path,
|
|
3951
4168
|
safeSelf().getExtraArgs(Array.from(arguments), 4)
|
|
3952
4169
|
);
|
|
4170
|
+
|
|
4171
|
+
if ( done ) {
|
|
4172
|
+
safe.uboLog(logPrefix, 'Done');
|
|
4173
|
+
}
|
|
3953
4174
|
}
|
|
3954
4175
|
|
|
3955
4176
|
// For compatibility with AdGuard
|
|
@@ -4018,6 +4239,9 @@ function trustedSetSessionStorageItem(key = '', value = '') {
|
|
|
4018
4239
|
builtinScriptlets.push({
|
|
4019
4240
|
name: 'trusted-replace-fetch-response.js',
|
|
4020
4241
|
requiresTrust: true,
|
|
4242
|
+
aliases: [
|
|
4243
|
+
'trusted-rpfr.js',
|
|
4244
|
+
],
|
|
4021
4245
|
fn: trustedReplaceFetchResponse,
|
|
4022
4246
|
dependencies: [
|
|
4023
4247
|
'replace-fetch-response.fn',
|
|
@@ -4037,7 +4261,6 @@ builtinScriptlets.push({
|
|
|
4037
4261
|
'match-object-properties.fn',
|
|
4038
4262
|
'parse-properties-to-match.fn',
|
|
4039
4263
|
'safe-self.fn',
|
|
4040
|
-
'should-log.fn',
|
|
4041
4264
|
],
|
|
4042
4265
|
});
|
|
4043
4266
|
function trustedReplaceXhrResponse(
|
|
@@ -4046,12 +4269,8 @@ function trustedReplaceXhrResponse(
|
|
|
4046
4269
|
propsToMatch = ''
|
|
4047
4270
|
) {
|
|
4048
4271
|
const safe = safeSelf();
|
|
4272
|
+
const logPrefix = safe.makeLogPrefix('trusted-replace-xhr-response', pattern, replacement, propsToMatch);
|
|
4049
4273
|
const xhrInstances = new WeakMap();
|
|
4050
|
-
const extraArgs = safe.getExtraArgs(Array.from(arguments), 3);
|
|
4051
|
-
const logLevel = shouldLog({
|
|
4052
|
-
log: pattern === '' && 'all' || extraArgs.log,
|
|
4053
|
-
});
|
|
4054
|
-
const log = logLevel ? ((...args) => { safe.uboLog(...args); }) : (( ) => { });
|
|
4055
4274
|
if ( pattern === '*' ) { pattern = '.*'; }
|
|
4056
4275
|
const rePattern = safe.patternToRegex(pattern);
|
|
4057
4276
|
const propNeedles = parsePropertiesToMatch(propsToMatch, 'url');
|
|
@@ -4065,10 +4284,10 @@ function trustedReplaceXhrResponse(
|
|
|
4065
4284
|
outcome = 'nomatch';
|
|
4066
4285
|
}
|
|
4067
4286
|
}
|
|
4068
|
-
if ( outcome === logLevel || outcome === 'all' ) {
|
|
4069
|
-
log(`xhr.open(${method}, ${url}, ${args.join(', ')})`);
|
|
4070
|
-
}
|
|
4071
4287
|
if ( outcome === 'match' ) {
|
|
4288
|
+
if ( safe.logLevel > 1 ) {
|
|
4289
|
+
safe.uboLog(logPrefix, `Matched "propsToMatch"`);
|
|
4290
|
+
}
|
|
4072
4291
|
xhrInstances.set(outerXhr, xhrDetails);
|
|
4073
4292
|
}
|
|
4074
4293
|
return super.open(method, url, ...args);
|
|
@@ -4094,13 +4313,8 @@ function trustedReplaceXhrResponse(
|
|
|
4094
4313
|
}
|
|
4095
4314
|
const textBefore = innerResponse;
|
|
4096
4315
|
const textAfter = textBefore.replace(rePattern, replacement);
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
log(
|
|
4100
|
-
`trusted-replace-xhr-response (${outcome})`,
|
|
4101
|
-
`\n\tpattern: ${pattern}`,
|
|
4102
|
-
`\n\treplacement: ${replacement}`,
|
|
4103
|
-
);
|
|
4316
|
+
if ( textAfter !== textBefore ) {
|
|
4317
|
+
safe.uboLog(logPrefix, 'Match');
|
|
4104
4318
|
}
|
|
4105
4319
|
return (xhrDetails.response = textAfter);
|
|
4106
4320
|
}
|
|
@@ -4129,22 +4343,63 @@ builtinScriptlets.push({
|
|
|
4129
4343
|
fn: trustedClickElement,
|
|
4130
4344
|
world: 'ISOLATED',
|
|
4131
4345
|
dependencies: [
|
|
4346
|
+
'get-all-cookies.fn',
|
|
4347
|
+
'get-all-local-storage.fn',
|
|
4132
4348
|
'run-at-html-element.fn',
|
|
4133
4349
|
'safe-self.fn',
|
|
4134
4350
|
],
|
|
4135
4351
|
});
|
|
4136
4352
|
function trustedClickElement(
|
|
4137
4353
|
selectors = '',
|
|
4138
|
-
extraMatch = '',
|
|
4354
|
+
extraMatch = '',
|
|
4139
4355
|
delay = ''
|
|
4140
4356
|
) {
|
|
4141
|
-
if ( extraMatch !== '' ) { return; }
|
|
4142
|
-
|
|
4143
4357
|
const safe = safeSelf();
|
|
4144
|
-
const
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4358
|
+
const logPrefix = safe.makeLogPrefix('trusted-click-element', selectors, extraMatch, delay);
|
|
4359
|
+
|
|
4360
|
+
if ( extraMatch !== '' ) {
|
|
4361
|
+
const assertions = extraMatch.split(',').map(s => {
|
|
4362
|
+
const pos1 = s.indexOf(':');
|
|
4363
|
+
const s1 = pos1 !== -1 ? s.slice(0, pos1) : s;
|
|
4364
|
+
const not = s1.startsWith('!');
|
|
4365
|
+
const type = not ? s1.slice(1) : s1;
|
|
4366
|
+
const s2 = pos1 !== -1 ? s.slice(pos1+1).trim() : '';
|
|
4367
|
+
if ( s2 === '' ) { return; }
|
|
4368
|
+
const out = { not, type };
|
|
4369
|
+
const match = /^\/(.+)\/(i?)$/.exec(s2);
|
|
4370
|
+
if ( match !== null ) {
|
|
4371
|
+
out.re = new RegExp(match[1], match[2] || undefined);
|
|
4372
|
+
return out;
|
|
4373
|
+
}
|
|
4374
|
+
const pos2 = s2.indexOf('=');
|
|
4375
|
+
const key = pos2 !== -1 ? s2.slice(0, pos2).trim() : s2;
|
|
4376
|
+
const value = pos2 !== -1 ? s2.slice(pos2+1).trim() : '';
|
|
4377
|
+
out.re = new RegExp(`^${this.escapeRegexChars(key)}=${this.escapeRegexChars(value)}`);
|
|
4378
|
+
return out;
|
|
4379
|
+
}).filter(details => details !== undefined);
|
|
4380
|
+
const allCookies = assertions.some(o => o.type === 'cookie')
|
|
4381
|
+
? getAllCookiesFn()
|
|
4382
|
+
: [];
|
|
4383
|
+
const allStorageItems = assertions.some(o => o.type === 'localStorage')
|
|
4384
|
+
? getAllLocalStorageFn()
|
|
4385
|
+
: [];
|
|
4386
|
+
const hasNeedle = (haystack, needle) => {
|
|
4387
|
+
for ( const { key, value } of haystack ) {
|
|
4388
|
+
if ( needle.test(`${key}=${value}`) ) { return true; }
|
|
4389
|
+
}
|
|
4390
|
+
return false;
|
|
4391
|
+
};
|
|
4392
|
+
for ( const { not, type, re } of assertions ) {
|
|
4393
|
+
switch ( type ) {
|
|
4394
|
+
case 'cookie':
|
|
4395
|
+
if ( hasNeedle(allCookies, re) === not ) { return; }
|
|
4396
|
+
break;
|
|
4397
|
+
case 'localStorage':
|
|
4398
|
+
if ( hasNeedle(allStorageItems, re) === not ) { return; }
|
|
4399
|
+
break;
|
|
4400
|
+
}
|
|
4401
|
+
}
|
|
4402
|
+
}
|
|
4148
4403
|
|
|
4149
4404
|
const querySelectorEx = (selector, context = document) => {
|
|
4150
4405
|
const pos = selector.indexOf(' >>> ');
|
|
@@ -4181,12 +4436,12 @@ function trustedClickElement(
|
|
|
4181
4436
|
|
|
4182
4437
|
const next = notFound => {
|
|
4183
4438
|
if ( selectorList.length === 0 ) {
|
|
4184
|
-
uboLog(
|
|
4439
|
+
safe.uboLog(logPrefix, 'Completed');
|
|
4185
4440
|
return terminate();
|
|
4186
4441
|
}
|
|
4187
4442
|
const tnow = Date.now();
|
|
4188
4443
|
if ( tnow >= tbye ) {
|
|
4189
|
-
uboLog(
|
|
4444
|
+
safe.uboLog(logPrefix, 'Timed out');
|
|
4190
4445
|
return terminate();
|
|
4191
4446
|
}
|
|
4192
4447
|
if ( notFound ) { observe(); }
|
|
@@ -4195,7 +4450,7 @@ function trustedClickElement(
|
|
|
4195
4450
|
next.timer = undefined;
|
|
4196
4451
|
process();
|
|
4197
4452
|
}, delay);
|
|
4198
|
-
uboLog(`
|
|
4453
|
+
safe.uboLog(logPrefix, `Waiting for ${selectorList[0]}...`);
|
|
4199
4454
|
};
|
|
4200
4455
|
next.stop = ( ) => {
|
|
4201
4456
|
if ( next.timer === undefined ) { return; }
|
|
@@ -4239,7 +4494,7 @@ function trustedClickElement(
|
|
|
4239
4494
|
selectorList.unshift(selector);
|
|
4240
4495
|
return next(true);
|
|
4241
4496
|
}
|
|
4242
|
-
uboLog(`
|
|
4497
|
+
safe.uboLog(logPrefix, `Clicked ${selector}`);
|
|
4243
4498
|
elem.click();
|
|
4244
4499
|
tnext += clickDelay;
|
|
4245
4500
|
next();
|
|
@@ -4336,40 +4591,67 @@ builtinScriptlets.push({
|
|
|
4336
4591
|
fn: trustedPruneOutboundObject,
|
|
4337
4592
|
dependencies: [
|
|
4338
4593
|
'object-prune.fn',
|
|
4594
|
+
'proxy-apply.fn',
|
|
4339
4595
|
'safe-self.fn',
|
|
4340
4596
|
],
|
|
4341
4597
|
});
|
|
4342
4598
|
function trustedPruneOutboundObject(
|
|
4343
|
-
|
|
4599
|
+
propChain = '',
|
|
4344
4600
|
rawPrunePaths = '',
|
|
4345
4601
|
rawNeedlePaths = ''
|
|
4346
4602
|
) {
|
|
4347
|
-
if (
|
|
4348
|
-
let context = globalThis;
|
|
4349
|
-
let prop = entryPoint;
|
|
4350
|
-
for (;;) {
|
|
4351
|
-
const pos = prop.indexOf('.');
|
|
4352
|
-
if ( pos === -1 ) { break; }
|
|
4353
|
-
context = context[prop.slice(0, pos)];
|
|
4354
|
-
if ( context instanceof Object === false ) { return; }
|
|
4355
|
-
prop = prop.slice(pos+1);
|
|
4356
|
-
}
|
|
4357
|
-
if ( typeof context[prop] !== 'function' ) { return; }
|
|
4603
|
+
if ( propChain === '' ) { return; }
|
|
4358
4604
|
const safe = safeSelf();
|
|
4359
4605
|
const extraArgs = safe.getExtraArgs(Array.from(arguments), 3);
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4606
|
+
const reflector = proxyApplyFn(propChain, function(...args) {
|
|
4607
|
+
const objBefore = reflector(...args);
|
|
4608
|
+
if ( objBefore instanceof Object === false ) { return objBefore; }
|
|
4609
|
+
const objAfter = objectPruneFn(
|
|
4610
|
+
objBefore,
|
|
4611
|
+
rawPrunePaths,
|
|
4612
|
+
rawNeedlePaths,
|
|
4613
|
+
{ matchAll: true },
|
|
4614
|
+
extraArgs
|
|
4615
|
+
);
|
|
4616
|
+
return objAfter || objBefore;
|
|
4617
|
+
});
|
|
4618
|
+
}
|
|
4619
|
+
|
|
4620
|
+
/******************************************************************************/
|
|
4621
|
+
|
|
4622
|
+
builtinScriptlets.push({
|
|
4623
|
+
name: 'trusted-replace-argument.js',
|
|
4624
|
+
requiresTrust: true,
|
|
4625
|
+
fn: trustedReplaceArgument,
|
|
4626
|
+
dependencies: [
|
|
4627
|
+
'proxy-apply.fn',
|
|
4628
|
+
'safe-self.fn',
|
|
4629
|
+
'validate-constant.fn',
|
|
4630
|
+
],
|
|
4631
|
+
});
|
|
4632
|
+
function trustedReplaceArgument(
|
|
4633
|
+
propChain = '',
|
|
4634
|
+
argpos = '',
|
|
4635
|
+
argraw = ''
|
|
4636
|
+
) {
|
|
4637
|
+
if ( propChain === '' ) { return; }
|
|
4638
|
+
if ( argpos === '' ) { return; }
|
|
4639
|
+
if ( argraw === '' ) { return; }
|
|
4640
|
+
const safe = safeSelf();
|
|
4641
|
+
const logPrefix = safe.makeLogPrefix('trusted-replace-argument', propChain, argpos, argraw);
|
|
4642
|
+
const extraArgs = safe.getExtraArgs(Array.from(arguments), 3);
|
|
4643
|
+
const normalValue = validateConstantFn(true, argraw);
|
|
4644
|
+
const reCondition = extraArgs.condition
|
|
4645
|
+
? safe.patternToRegex(extraArgs.condition)
|
|
4646
|
+
: /^/;
|
|
4647
|
+
const reflector = proxyApplyFn(propChain, function(...args) {
|
|
4648
|
+
const arglist = args[args.length-1];
|
|
4649
|
+
if ( Array.isArray(arglist) === false ) { return reflector(...args); }
|
|
4650
|
+
const argBefore = arglist[argpos];
|
|
4651
|
+
if ( reCondition.test(argBefore) === false ) { return reflector(...args); }
|
|
4652
|
+
arglist[argpos] = normalValue;
|
|
4653
|
+
safe.uboLog(logPrefix, `Replaced argument:\nBefore: ${JSON.stringify(argBefore)}\nAfter: ${normalValue}`);
|
|
4654
|
+
return reflector(...args);
|
|
4373
4655
|
});
|
|
4374
4656
|
}
|
|
4375
4657
|
|