@browserless.io/browserless 2.0.0-beta-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +674 -0
- package/LICENSE +6 -0
- package/README.md +132 -0
- package/assets/logo.png +0 -0
- package/bin/browserless.js +227 -0
- package/browser.json +7 -0
- package/build/browserless.d.ts +33 -0
- package/build/browserless.js +146 -0
- package/build/browsers/cdp-chromium.d.ts +41 -0
- package/build/browsers/cdp-chromium.js +287 -0
- package/build/browsers/index.d.ts +26 -0
- package/build/browsers/index.js +183 -0
- package/build/browsers/playwright-chromium.d.ts +34 -0
- package/build/browsers/playwright-chromium.js +106 -0
- package/build/browsers/playwright-firefox.d.ts +34 -0
- package/build/browsers/playwright-firefox.js +101 -0
- package/build/browsers/playwright-webkit.d.ts +34 -0
- package/build/browsers/playwright-webkit.js +101 -0
- package/build/config.d.ts +138 -0
- package/build/config.js +349 -0
- package/build/constants.d.ts +4 -0
- package/build/constants.js +4 -0
- package/build/data/classes.json +1 -0
- package/build/data/selectors.json +1 -0
- package/build/exports.d.ts +20 -0
- package/build/exports.js +22 -0
- package/build/file-system.d.ts +24 -0
- package/build/file-system.js +46 -0
- package/build/hooks.d.ts +5 -0
- package/build/hooks.js +20 -0
- package/build/http.d.ts +175 -0
- package/build/http.js +104 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +39 -0
- package/build/limiter.d.ts +24 -0
- package/build/limiter.js +147 -0
- package/build/limiter.spec.d.ts +1 -0
- package/build/limiter.spec.js +241 -0
- package/build/metrics.d.ts +24 -0
- package/build/metrics.js +86 -0
- package/build/metrics.spec.d.ts +1 -0
- package/build/metrics.spec.js +35 -0
- package/build/mime-types.d.ts +1 -0
- package/build/mime-types.js +328 -0
- package/build/monitoring.d.ts +13 -0
- package/build/monitoring.js +38 -0
- package/build/routes/chromium/http/content-post.body.json +514 -0
- package/build/routes/chromium/http/content-post.d.ts +34 -0
- package/build/routes/chromium/http/content-post.js +109 -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 +16 -0
- package/build/routes/chromium/http/download-post.js +92 -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 +18 -0
- package/build/routes/chromium/http/function-post.js +53 -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/pdf-post.body.json +654 -0
- package/build/routes/chromium/http/pdf-post.d.ts +35 -0
- package/build/routes/chromium/http/pdf-post.js +107 -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.body.json +26 -0
- package/build/routes/chromium/http/performance.d.ts +17 -0
- package/build/routes/chromium/http/performance.js +30 -0
- package/build/routes/chromium/http/performance.query.json +120 -0
- package/build/routes/chromium/http/performance.response.json +7 -0
- package/build/routes/chromium/http/scrape-post.body.json +561 -0
- package/build/routes/chromium/http/scrape-post.d.ts +106 -0
- package/build/routes/chromium/http/scrape-post.js +205 -0
- package/build/routes/chromium/http/scrape-post.query.json +183 -0
- package/build/routes/chromium/http/scrape-post.response.json +325 -0
- package/build/routes/chromium/http/screenshot-post.body.json +604 -0
- package/build/routes/chromium/http/screenshot-post.d.ts +37 -0
- package/build/routes/chromium/http/screenshot-post.js +124 -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.d.ts +1 -0
- package/build/routes/chromium/tests/content.spec.js +285 -0
- package/build/routes/chromium/tests/download.spec.d.ts +1 -0
- package/build/routes/chromium/tests/download.spec.js +67 -0
- package/build/routes/chromium/tests/function.spec.d.ts +1 -0
- package/build/routes/chromium/tests/function.spec.js +245 -0
- package/build/routes/chromium/tests/pdf.spec.d.ts +1 -0
- package/build/routes/chromium/tests/pdf.spec.js +333 -0
- package/build/routes/chromium/tests/performance.spec.d.ts +1 -0
- package/build/routes/chromium/tests/performance.spec.js +124 -0
- package/build/routes/chromium/tests/scrape.spec.d.ts +1 -0
- package/build/routes/chromium/tests/scrape.spec.js +354 -0
- package/build/routes/chromium/tests/screenshot.spec.d.ts +1 -0
- package/build/routes/chromium/tests/screenshot.spec.js +339 -0
- package/build/routes/chromium/tests/websocket.spec.d.ts +1 -0
- package/build/routes/chromium/tests/websocket.spec.js +309 -0
- package/build/routes/chromium/utils/function/client.d.ts +26 -0
- package/build/routes/chromium/utils/function/client.js +66 -0
- package/build/routes/chromium/utils/function/handler.d.ts +18 -0
- package/build/routes/chromium/utils/function/handler.js +95 -0
- package/build/routes/chromium/utils/performance/child.d.ts +1 -0
- package/build/routes/chromium/utils/performance/child.js +29 -0
- package/build/routes/chromium/utils/performance/main.d.ts +3 -0
- package/build/routes/chromium/utils/performance/main.js +65 -0
- package/build/routes/chromium/utils/performance/types.d.ts +21 -0
- package/build/routes/chromium/utils/performance/types.js +1 -0
- package/build/routes/chromium/ws/browser.d.ts +6 -0
- package/build/routes/chromium/ws/browser.js +11 -0
- package/build/routes/chromium/ws/browser.query.json +120 -0
- package/build/routes/chromium/ws/cdp-chromium.d.ts +6 -0
- package/build/routes/chromium/ws/cdp-chromium.js +11 -0
- package/build/routes/chromium/ws/cdp-chromium.query.json +120 -0
- package/build/routes/chromium/ws/page.d.ts +6 -0
- package/build/routes/chromium/ws/page.js +11 -0
- package/build/routes/chromium/ws/page.query.json +120 -0
- package/build/routes/chromium/ws/playwright-chromium.d.ts +6 -0
- package/build/routes/chromium/ws/playwright-chromium.js +19 -0
- package/build/routes/chromium/ws/playwright-chromium.query.json +100 -0
- package/build/routes/firefox/tests/websocket.spec.d.ts +1 -0
- package/build/routes/firefox/tests/websocket.spec.js +104 -0
- package/build/routes/firefox/ws/playwright-firefox.d.ts +6 -0
- package/build/routes/firefox/ws/playwright-firefox.js +19 -0
- package/build/routes/firefox/ws/playwright-firefox.query.json +100 -0
- package/build/routes/management/http/config-get.d.ts +25 -0
- package/build/routes/management/http/config-get.js +43 -0
- package/build/routes/management/http/config-get.response.json +107 -0
- package/build/routes/management/http/metrics-get.d.ts +4 -0
- package/build/routes/management/http/metrics-get.js +24 -0
- package/build/routes/management/http/metrics-get.response.json +94 -0
- package/build/routes/management/http/metrics-total-get.d.ts +4 -0
- package/build/routes/management/http/metrics-total-get.js +60 -0
- package/build/routes/management/http/metrics-total-get.response.json +72 -0
- package/build/routes/management/http/sessions-get.d.ts +4 -0
- package/build/routes/management/http/sessions-get.js +21 -0
- package/build/routes/management/http/sessions-get.response.json +221 -0
- package/build/routes/management/http/static-get.d.ts +3 -0
- package/build/routes/management/http/static-get.js +67 -0
- package/build/routes/management/tests/management.spec.d.ts +1 -0
- package/build/routes/management/tests/management.spec.js +41 -0
- package/build/routes/webkit/tests/websocket.spec.d.ts +1 -0
- package/build/routes/webkit/tests/websocket.spec.js +104 -0
- package/build/routes/webkit/ws/playwright-webkit.d.ts +6 -0
- package/build/routes/webkit/ws/playwright-webkit.js +19 -0
- package/build/routes/webkit/ws/playwright-webkit.query.json +100 -0
- package/build/server.d.ts +38 -0
- package/build/server.js +365 -0
- package/build/shim.d.ts +9 -0
- package/build/shim.js +54 -0
- package/build/shim.spec.d.ts +1 -0
- package/build/shim.spec.js +114 -0
- package/build/types.d.ts +360 -0
- package/build/types.js +6 -0
- package/build/utils.d.ts +111 -0
- package/build/utils.js +570 -0
- package/build/webhooks.d.ts +11 -0
- package/build/webhooks.js +43 -0
- package/docker/base/.dockerignore +16 -0
- package/docker/base/Dockerfile +70 -0
- package/docker/chrome/.dockerignore +16 -0
- package/docker/chrome/Dockerfile +40 -0
- package/docker/firefox/.dockerignore +16 -0
- package/docker/firefox/Dockerfile +39 -0
- package/docker/multi/.dockerignore +16 -0
- package/docker/multi/Dockerfile +37 -0
- package/docker/sdk/.dockerignore +16 -0
- package/docker/sdk/Dockerfile +34 -0
- package/docker/webkit/.dockerignore +16 -0
- package/docker/webkit/Dockerfile +40 -0
- package/extensions/screencast/background.js +143 -0
- package/extensions/screencast/content_script.js +18 -0
- package/extensions/screencast/manifest.json +19 -0
- package/extensions/ublock/1p-filters.html +69 -0
- package/extensions/ublock/3p-filters.html +119 -0
- package/extensions/ublock/LICENSE.txt +674 -0
- package/extensions/ublock/_locales/ar/messages.json +1290 -0
- package/extensions/ublock/_locales/az/messages.json +1290 -0
- package/extensions/ublock/_locales/be/messages.json +1290 -0
- package/extensions/ublock/_locales/bg/messages.json +1290 -0
- package/extensions/ublock/_locales/bn/messages.json +1290 -0
- package/extensions/ublock/_locales/br_FR/messages.json +1290 -0
- package/extensions/ublock/_locales/bs/messages.json +1290 -0
- package/extensions/ublock/_locales/ca/messages.json +1290 -0
- package/extensions/ublock/_locales/cs/messages.json +1290 -0
- package/extensions/ublock/_locales/cv/messages.json +1290 -0
- package/extensions/ublock/_locales/da/messages.json +1290 -0
- package/extensions/ublock/_locales/de/messages.json +1290 -0
- package/extensions/ublock/_locales/el/messages.json +1290 -0
- package/extensions/ublock/_locales/en/messages.json +1292 -0
- package/extensions/ublock/_locales/en_GB/messages.json +1290 -0
- package/extensions/ublock/_locales/eo/messages.json +1290 -0
- package/extensions/ublock/_locales/es/messages.json +1290 -0
- package/extensions/ublock/_locales/et/messages.json +1290 -0
- package/extensions/ublock/_locales/eu/messages.json +1290 -0
- package/extensions/ublock/_locales/fa/messages.json +1290 -0
- package/extensions/ublock/_locales/fi/messages.json +1290 -0
- package/extensions/ublock/_locales/fil/messages.json +1290 -0
- package/extensions/ublock/_locales/fr/messages.json +1290 -0
- package/extensions/ublock/_locales/fy/messages.json +1290 -0
- package/extensions/ublock/_locales/gl/messages.json +1290 -0
- package/extensions/ublock/_locales/gu/messages.json +1290 -0
- package/extensions/ublock/_locales/he/messages.json +1290 -0
- package/extensions/ublock/_locales/hi/messages.json +1290 -0
- package/extensions/ublock/_locales/hr/messages.json +1290 -0
- package/extensions/ublock/_locales/hu/messages.json +1290 -0
- package/extensions/ublock/_locales/hy/messages.json +1290 -0
- package/extensions/ublock/_locales/id/messages.json +1290 -0
- package/extensions/ublock/_locales/it/messages.json +1290 -0
- package/extensions/ublock/_locales/ja/messages.json +1290 -0
- package/extensions/ublock/_locales/ka/messages.json +1290 -0
- package/extensions/ublock/_locales/kk/messages.json +1290 -0
- package/extensions/ublock/_locales/kn/messages.json +1290 -0
- package/extensions/ublock/_locales/ko/messages.json +1290 -0
- package/extensions/ublock/_locales/ku/messages.json +1290 -0
- package/extensions/ublock/_locales/lt/messages.json +1290 -0
- package/extensions/ublock/_locales/lv/messages.json +1290 -0
- package/extensions/ublock/_locales/mk/messages.json +1290 -0
- package/extensions/ublock/_locales/ml/messages.json +1290 -0
- package/extensions/ublock/_locales/mr/messages.json +1290 -0
- package/extensions/ublock/_locales/ms/messages.json +1290 -0
- package/extensions/ublock/_locales/nb/messages.json +1290 -0
- package/extensions/ublock/_locales/nl/messages.json +1290 -0
- package/extensions/ublock/_locales/no/messages.json +1290 -0
- package/extensions/ublock/_locales/oc/messages.json +1290 -0
- package/extensions/ublock/_locales/pa/messages.json +1290 -0
- package/extensions/ublock/_locales/pl/messages.json +1290 -0
- package/extensions/ublock/_locales/pt_BR/messages.json +1290 -0
- package/extensions/ublock/_locales/pt_PT/messages.json +1290 -0
- package/extensions/ublock/_locales/ro/messages.json +1290 -0
- package/extensions/ublock/_locales/ru/messages.json +1290 -0
- package/extensions/ublock/_locales/si/messages.json +1290 -0
- package/extensions/ublock/_locales/sk/messages.json +1290 -0
- package/extensions/ublock/_locales/sl/messages.json +1290 -0
- package/extensions/ublock/_locales/so/messages.json +1290 -0
- package/extensions/ublock/_locales/sq/messages.json +1290 -0
- package/extensions/ublock/_locales/sr/messages.json +1290 -0
- package/extensions/ublock/_locales/sv/messages.json +1290 -0
- package/extensions/ublock/_locales/sw/messages.json +1290 -0
- package/extensions/ublock/_locales/ta/messages.json +1290 -0
- package/extensions/ublock/_locales/te/messages.json +1290 -0
- package/extensions/ublock/_locales/th/messages.json +1290 -0
- package/extensions/ublock/_locales/tr/messages.json +1290 -0
- package/extensions/ublock/_locales/uk/messages.json +1290 -0
- package/extensions/ublock/_locales/ur/messages.json +1290 -0
- package/extensions/ublock/_locales/vi/messages.json +1290 -0
- package/extensions/ublock/_locales/zh_CN/messages.json +1290 -0
- package/extensions/ublock/_locales/zh_TW/messages.json +1290 -0
- package/extensions/ublock/about.html +63 -0
- package/extensions/ublock/advanced-settings.html +42 -0
- package/extensions/ublock/asset-viewer.html +50 -0
- package/extensions/ublock/assets/assets.json +903 -0
- package/extensions/ublock/assets/resources/scriptlets.js +4255 -0
- package/extensions/ublock/assets/thirdparties/easylist/easylist.txt +65576 -0
- package/extensions/ublock/assets/thirdparties/easylist/easyprivacy.txt +33219 -0
- package/extensions/ublock/assets/thirdparties/pgl.yoyo.org/as/README.md +29 -0
- package/extensions/ublock/assets/thirdparties/pgl.yoyo.org/as/serverlist +3732 -0
- package/extensions/ublock/assets/thirdparties/publicsuffix.org/list/effective_tld_names.dat +15431 -0
- package/extensions/ublock/assets/thirdparties/urlhaus-filter/LICENSE.md +42 -0
- package/extensions/ublock/assets/thirdparties/urlhaus-filter/urlhaus-filter-online.txt +1970 -0
- package/extensions/ublock/assets/ublock/badlists.txt +77 -0
- package/extensions/ublock/assets/ublock/badware.min.txt +3033 -0
- package/extensions/ublock/assets/ublock/filters.min.txt +23419 -0
- package/extensions/ublock/assets/ublock/privacy.min.txt +575 -0
- package/extensions/ublock/assets/ublock/quick-fixes.min.txt +99 -0
- package/extensions/ublock/assets/ublock/unbreak.min.txt +2448 -0
- package/extensions/ublock/background.html +12 -0
- package/extensions/ublock/cloud-ui.html +23 -0
- package/extensions/ublock/code-viewer.html +53 -0
- package/extensions/ublock/css/1p-filters.css +26 -0
- package/extensions/ublock/css/3p-filters.css +250 -0
- package/extensions/ublock/css/about.css +3 -0
- package/extensions/ublock/css/advanced-settings.css +26 -0
- package/extensions/ublock/css/asset-viewer.css +79 -0
- package/extensions/ublock/css/click2load.css +53 -0
- package/extensions/ublock/css/cloud-ui.css +104 -0
- package/extensions/ublock/css/code-viewer.css +67 -0
- package/extensions/ublock/css/codemirror.css +326 -0
- package/extensions/ublock/css/common.css +347 -0
- package/extensions/ublock/css/dashboard-common.css +55 -0
- package/extensions/ublock/css/dashboard.css +115 -0
- package/extensions/ublock/css/devtools.css +22 -0
- package/extensions/ublock/css/document-blocked.css +146 -0
- package/extensions/ublock/css/dyna-rules.css +79 -0
- package/extensions/ublock/css/epicker-ui.css +270 -0
- package/extensions/ublock/css/fa-icons.css +149 -0
- package/extensions/ublock/css/fonts/Inter/Inter-Regular.woff2 +0 -0
- package/extensions/ublock/css/fonts/Inter/Inter-SemiBold.woff2 +0 -0
- package/extensions/ublock/css/fonts/Inter/LICENSE.txt +93 -0
- package/extensions/ublock/css/fonts/Metropolis/Metropolis-Regular.woff2 +0 -0
- package/extensions/ublock/css/fonts/Metropolis/Metropolis-SemiBold.woff2 +0 -0
- package/extensions/ublock/css/fonts/Metropolis/README.md +25 -0
- package/extensions/ublock/css/fonts/Metropolis/UNLICENSE +24 -0
- package/extensions/ublock/css/logger-ui-inspector.css +116 -0
- package/extensions/ublock/css/logger-ui.css +978 -0
- package/extensions/ublock/css/popup-fenix.css +778 -0
- package/extensions/ublock/css/settings.css +74 -0
- package/extensions/ublock/css/support.css +110 -0
- package/extensions/ublock/css/themes/default.css +526 -0
- package/extensions/ublock/css/whitelist.css +22 -0
- package/extensions/ublock/dashboard.html +47 -0
- package/extensions/ublock/devtools.html +58 -0
- package/extensions/ublock/document-blocked.html +64 -0
- package/extensions/ublock/dyna-rules.html +67 -0
- package/extensions/ublock/img/cloud.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/README +9 -0
- package/extensions/ublock/img/flags-of-the-world/ad.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ae.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/af.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ag.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ai.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/al.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/am.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ao.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/aq.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ar.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/as.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/at.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/au.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/aw.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ax.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/az.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ba.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bb.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bd.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/be.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bf.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bg.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bh.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bi.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bj.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bl.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bm.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bn.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bo.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bq.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/br.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bs.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bt.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bv.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bw.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/by.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/bz.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ca.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cc.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cd.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cf.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cg.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ch.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ci.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ck.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cl.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cm.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cn.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/co.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cr.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cu.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cv.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cw.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cx.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cy.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/cz.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/de.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/dj.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/dk.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/dm.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/do.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/dz.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ec.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ee.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/eg.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/eh.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/er.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/es.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/et.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/fi.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/fj.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/fk.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/fm.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/fo.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/fr.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ga.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gb-eng.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gb-nir.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gb-sct.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gb-wls.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gb.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gd.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ge.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gf.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gg.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gh.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gi.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gl.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gm.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gn.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gp.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gq.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gr.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gs.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gt.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gu.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gw.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/gy.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/hk.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/hm.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/hn.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/hr.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ht.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/hu.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/id.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ie.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/il.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/im.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/in.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/io.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/iq.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ir.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/is.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/it.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/je.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/jm.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/jo.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/jp.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ke.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/kg.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/kh.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ki.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/km.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/kn.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/kp.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/kr.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/kw.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ky.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/kz.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/la.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/lb.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/lc.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/li.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/lk.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/lr.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ls.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/lt.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/lu.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/lv.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ly.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ma.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mc.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/md.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/me.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mf.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mg.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mh.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mk.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ml.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mm.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mn.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mo.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mp.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mq.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mr.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ms.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mt.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mu.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mv.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mw.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mx.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/my.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/mz.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/na.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/nc.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ne.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/nf.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ng.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ni.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/nl.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/no.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/np.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/nr.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/nu.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/nz.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/om.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/pa.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/pe.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/pf.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/pg.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ph.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/pk.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/pl.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/pm.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/pn.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/pr.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ps.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/pt.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/pw.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/py.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/qa.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/re.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ro.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/rs.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ru.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/rw.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sa.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sb.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sc.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sd.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/se.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sg.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sh.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/si.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sj.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sk.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sl.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sm.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sn.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/so.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sr.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ss.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/st.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sv.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sx.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sy.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/sz.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/tc.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/td.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/tf.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/tg.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/th.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/tj.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/tk.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/tl.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/tm.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/tn.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/to.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/tr.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/tt.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/tv.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/tw.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/tz.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ua.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ug.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/um.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/us.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/uy.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/uz.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/va.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/vc.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ve.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/vg.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/vi.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/vn.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/vu.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/wf.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ws.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/xk.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/ye.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/yt.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/za.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/zm.png +0 -0
- package/extensions/ublock/img/flags-of-the-world/zw.png +0 -0
- package/extensions/ublock/img/fontawesome/LICENSE.txt +25 -0
- package/extensions/ublock/img/fontawesome/fontawesome-defs.svg +79 -0
- package/extensions/ublock/img/help16.png +0 -0
- package/extensions/ublock/img/icon_128.png +0 -0
- package/extensions/ublock/img/icon_16-loading.png +0 -0
- package/extensions/ublock/img/icon_16-off.png +0 -0
- package/extensions/ublock/img/icon_16.png +0 -0
- package/extensions/ublock/img/icon_32-loading.png +0 -0
- package/extensions/ublock/img/icon_32-off.png +0 -0
- package/extensions/ublock/img/icon_32.png +0 -0
- package/extensions/ublock/img/icon_64-loading.png +0 -0
- package/extensions/ublock/img/icon_64-off.png +0 -0
- package/extensions/ublock/img/icon_64.png +0 -0
- package/extensions/ublock/img/material-design.svg +16 -0
- package/extensions/ublock/img/photon.svg +16 -0
- package/extensions/ublock/img/ublock-defs.svg +27 -0
- package/extensions/ublock/img/ublock.svg +44 -0
- package/extensions/ublock/is-webrtc-supported.html +9 -0
- package/extensions/ublock/js/1p-filters.js +336 -0
- package/extensions/ublock/js/3p-filters.js +867 -0
- package/extensions/ublock/js/about.js +34 -0
- package/extensions/ublock/js/advanced-settings.js +194 -0
- package/extensions/ublock/js/asset-viewer.js +112 -0
- package/extensions/ublock/js/assets.js +1448 -0
- package/extensions/ublock/js/background.js +404 -0
- package/extensions/ublock/js/base64-custom.js +246 -0
- package/extensions/ublock/js/benchmarks.js +421 -0
- package/extensions/ublock/js/biditrie.js +947 -0
- package/extensions/ublock/js/cachestorage.js +510 -0
- package/extensions/ublock/js/click2load.js +60 -0
- package/extensions/ublock/js/cloud-ui.js +238 -0
- package/extensions/ublock/js/code-viewer.js +311 -0
- package/extensions/ublock/js/codemirror/search-thread.js +199 -0
- package/extensions/ublock/js/codemirror/search.js +504 -0
- package/extensions/ublock/js/codemirror/ubo-dynamic-filtering.js +239 -0
- package/extensions/ublock/js/codemirror/ubo-static-filtering.js +1126 -0
- package/extensions/ublock/js/commands.js +181 -0
- package/extensions/ublock/js/console.js +59 -0
- package/extensions/ublock/js/contentscript-extra.js +662 -0
- package/extensions/ublock/js/contentscript.js +1366 -0
- package/extensions/ublock/js/contextmenu.js +270 -0
- package/extensions/ublock/js/cosmetic-filtering.js +983 -0
- package/extensions/ublock/js/dashboard-common.js +215 -0
- package/extensions/ublock/js/dashboard.js +166 -0
- package/extensions/ublock/js/devtools.js +184 -0
- package/extensions/ublock/js/diff-updater.js +288 -0
- package/extensions/ublock/js/document-blocked.js +230 -0
- package/extensions/ublock/js/dom.js +213 -0
- package/extensions/ublock/js/dyna-rules.js +678 -0
- package/extensions/ublock/js/dynamic-net-filtering.js +488 -0
- package/extensions/ublock/js/epicker-ui.js +924 -0
- package/extensions/ublock/js/fa-icons.js +129 -0
- package/extensions/ublock/js/filtering-context.js +461 -0
- package/extensions/ublock/js/filtering-engines.js +50 -0
- package/extensions/ublock/js/hnswitches.js +289 -0
- package/extensions/ublock/js/hntrie.js +780 -0
- package/extensions/ublock/js/html-filtering.js +465 -0
- package/extensions/ublock/js/httpheader-filtering.js +213 -0
- package/extensions/ublock/js/i18n.js +346 -0
- package/extensions/ublock/js/is-webrtc-supported.js +52 -0
- package/extensions/ublock/js/logger-ui-inspector.js +652 -0
- package/extensions/ublock/js/logger-ui.js +3028 -0
- package/extensions/ublock/js/logger.js +84 -0
- package/extensions/ublock/js/lz4.js +190 -0
- package/extensions/ublock/js/messaging.js +2095 -0
- package/extensions/ublock/js/pagestore.js +1140 -0
- package/extensions/ublock/js/popup-fenix.js +1529 -0
- package/extensions/ublock/js/redirect-engine.js +494 -0
- package/extensions/ublock/js/redirect-resources.js +193 -0
- package/extensions/ublock/js/reverselookup-worker.js +287 -0
- package/extensions/ublock/js/reverselookup.js +223 -0
- package/extensions/ublock/js/scriptlet-filtering.js +556 -0
- package/extensions/ublock/js/scriptlets/cosmetic-logger.js +376 -0
- package/extensions/ublock/js/scriptlets/cosmetic-off.js +48 -0
- package/extensions/ublock/js/scriptlets/cosmetic-on.js +48 -0
- package/extensions/ublock/js/scriptlets/cosmetic-report.js +142 -0
- package/extensions/ublock/js/scriptlets/dom-inspector.js +906 -0
- package/extensions/ublock/js/scriptlets/dom-survey-elements.js +72 -0
- package/extensions/ublock/js/scriptlets/dom-survey-scripts.js +126 -0
- package/extensions/ublock/js/scriptlets/epicker.js +1365 -0
- package/extensions/ublock/js/scriptlets/load-3p-css.js +67 -0
- package/extensions/ublock/js/scriptlets/load-large-media-all.js +62 -0
- package/extensions/ublock/js/scriptlets/load-large-media-interactive.js +299 -0
- package/extensions/ublock/js/scriptlets/noscript-spoof.js +89 -0
- package/extensions/ublock/js/scriptlets/should-inject-contentscript.js +40 -0
- package/extensions/ublock/js/scriptlets/subscriber.js +113 -0
- package/extensions/ublock/js/scriptlets/updater.js +101 -0
- package/extensions/ublock/js/settings.js +317 -0
- package/extensions/ublock/js/start.js +509 -0
- package/extensions/ublock/js/static-dnr-filtering.js +497 -0
- package/extensions/ublock/js/static-ext-filtering-db.js +171 -0
- package/extensions/ublock/js/static-ext-filtering.js +184 -0
- package/extensions/ublock/js/static-filtering-io.js +144 -0
- package/extensions/ublock/js/static-filtering-parser.js +4459 -0
- package/extensions/ublock/js/static-net-filtering.js +5631 -0
- package/extensions/ublock/js/storage.js +1683 -0
- package/extensions/ublock/js/support.js +335 -0
- package/extensions/ublock/js/tab.js +1178 -0
- package/extensions/ublock/js/tasks.js +42 -0
- package/extensions/ublock/js/text-encode.js +275 -0
- package/extensions/ublock/js/text-utils.js +107 -0
- package/extensions/ublock/js/theme.js +151 -0
- package/extensions/ublock/js/traffic.js +1260 -0
- package/extensions/ublock/js/ublock.js +696 -0
- package/extensions/ublock/js/uri-utils.js +175 -0
- package/extensions/ublock/js/url-net-filtering.js +336 -0
- package/extensions/ublock/js/utils.js +208 -0
- package/extensions/ublock/js/vapi-background-ext.js +254 -0
- package/extensions/ublock/js/vapi-background.js +1802 -0
- package/extensions/ublock/js/vapi-client-extra.js +312 -0
- package/extensions/ublock/js/vapi-client.js +280 -0
- package/extensions/ublock/js/vapi-common.js +308 -0
- package/extensions/ublock/js/vapi.js +89 -0
- package/extensions/ublock/js/wasm/README.md +24 -0
- package/extensions/ublock/js/wasm/biditrie.wasm +0 -0
- package/extensions/ublock/js/wasm/biditrie.wat +728 -0
- package/extensions/ublock/js/wasm/hntrie.wasm +0 -0
- package/extensions/ublock/js/wasm/hntrie.wat +724 -0
- package/extensions/ublock/js/webext.js +164 -0
- package/extensions/ublock/js/whitelist.js +258 -0
- package/extensions/ublock/lib/codemirror/LICENSE +21 -0
- package/extensions/ublock/lib/codemirror/README.md +47 -0
- package/extensions/ublock/lib/codemirror/addon/comment/comment.js +211 -0
- package/extensions/ublock/lib/codemirror/addon/display/panel.js +133 -0
- package/extensions/ublock/lib/codemirror/addon/edit/closebrackets.js +201 -0
- package/extensions/ublock/lib/codemirror/addon/edit/matchbrackets.js +160 -0
- package/extensions/ublock/lib/codemirror/addon/fold/foldcode.js +157 -0
- package/extensions/ublock/lib/codemirror/addon/fold/foldgutter.css +20 -0
- package/extensions/ublock/lib/codemirror/addon/fold/foldgutter.js +163 -0
- package/extensions/ublock/lib/codemirror/addon/hint/show-hint.css +36 -0
- package/extensions/ublock/lib/codemirror/addon/hint/show-hint.js +509 -0
- package/extensions/ublock/lib/codemirror/addon/merge/merge.css +119 -0
- package/extensions/ublock/lib/codemirror/addon/merge/merge.js +1006 -0
- package/extensions/ublock/lib/codemirror/addon/scroll/annotatescrollbar.js +128 -0
- package/extensions/ublock/lib/codemirror/addon/search/matchesonscrollbar.css +8 -0
- package/extensions/ublock/lib/codemirror/addon/search/searchcursor.js +296 -0
- package/extensions/ublock/lib/codemirror/addon/selection/active-line.js +72 -0
- package/extensions/ublock/lib/codemirror/lib/codemirror.css +350 -0
- package/extensions/ublock/lib/codemirror/lib/codemirror.js +9800 -0
- package/extensions/ublock/lib/codemirror/mode/css/css.js +864 -0
- package/extensions/ublock/lib/codemirror/mode/htmlmixed/htmlmixed.js +153 -0
- package/extensions/ublock/lib/codemirror/mode/javascript/javascript.js +942 -0
- package/extensions/ublock/lib/codemirror/mode/xml/xml.js +413 -0
- package/extensions/ublock/lib/codemirror/theme/night.css +27 -0
- package/extensions/ublock/lib/csstree/LICENSE +19 -0
- package/extensions/ublock/lib/csstree/css-tree.js +17 -0
- package/extensions/ublock/lib/diff/README.md +34 -0
- package/extensions/ublock/lib/diff/swatinem_diff.js +272 -0
- package/extensions/ublock/lib/hsluv/LICENSE +20 -0
- package/extensions/ublock/lib/hsluv/README +3 -0
- package/extensions/ublock/lib/hsluv/hsluv-0.1.0.min.js +8 -0
- package/extensions/ublock/lib/js-beautify/LICENSE +9 -0
- package/extensions/ublock/lib/js-beautify/README +5 -0
- package/extensions/ublock/lib/js-beautify/beautifier.min.js +2 -0
- package/extensions/ublock/lib/lz4/README.md +52 -0
- package/extensions/ublock/lib/lz4/lz4-block-codec-any.js +151 -0
- package/extensions/ublock/lib/lz4/lz4-block-codec-js.js +297 -0
- package/extensions/ublock/lib/lz4/lz4-block-codec-wasm.js +195 -0
- package/extensions/ublock/lib/lz4/lz4-block-codec.wasm +0 -0
- package/extensions/ublock/lib/lz4/lz4-block-codec.wat +745 -0
- package/extensions/ublock/lib/publicsuffixlist/publicsuffixlist.js +641 -0
- package/extensions/ublock/lib/publicsuffixlist/wasm/README.md +29 -0
- package/extensions/ublock/lib/publicsuffixlist/wasm/publicsuffixlist.wasm +0 -0
- package/extensions/ublock/lib/publicsuffixlist/wasm/publicsuffixlist.wat +322 -0
- package/extensions/ublock/lib/punycode.js +493 -0
- package/extensions/ublock/lib/regexanalyzer/CHANGES.md +15 -0
- package/extensions/ublock/lib/regexanalyzer/README.md +14 -0
- package/extensions/ublock/lib/regexanalyzer/regex.js +2276 -0
- package/extensions/ublock/logger-ui.html +232 -0
- package/extensions/ublock/managed_storage.json +73 -0
- package/extensions/ublock/manifest.json +115 -0
- package/extensions/ublock/no-dashboard.html +27 -0
- package/extensions/ublock/popup-fenix.html +114 -0
- package/extensions/ublock/settings.html +98 -0
- package/extensions/ublock/support.html +131 -0
- package/extensions/ublock/web_accessible_resources/1x1.gif +0 -0
- package/extensions/ublock/web_accessible_resources/2x2.png +0 -0
- package/extensions/ublock/web_accessible_resources/32x32.png +0 -0
- package/extensions/ublock/web_accessible_resources/3x2.png +0 -0
- package/extensions/ublock/web_accessible_resources/README.txt +11 -0
- package/extensions/ublock/web_accessible_resources/addthis_widget.js +39 -0
- package/extensions/ublock/web_accessible_resources/amazon_ads.js +70 -0
- package/extensions/ublock/web_accessible_resources/amazon_apstag.js +62 -0
- package/extensions/ublock/web_accessible_resources/ampproject_v0.js +34 -0
- package/extensions/ublock/web_accessible_resources/chartbeat.js +30 -0
- package/extensions/ublock/web_accessible_resources/click2load.html +28 -0
- package/extensions/ublock/web_accessible_resources/doubleclick_instream_ad_status.js +1 -0
- package/extensions/ublock/web_accessible_resources/empty +0 -0
- package/extensions/ublock/web_accessible_resources/epicker-ui.html +76 -0
- package/extensions/ublock/web_accessible_resources/fingerprint2.js +55 -0
- package/extensions/ublock/web_accessible_resources/fingerprint3.js +45 -0
- package/extensions/ublock/web_accessible_resources/google-analytics_analytics.js +110 -0
- package/extensions/ublock/web_accessible_resources/google-analytics_cx_api.js +36 -0
- package/extensions/ublock/web_accessible_resources/google-analytics_ga.js +130 -0
- package/extensions/ublock/web_accessible_resources/google-analytics_inpage_linkid.js +28 -0
- package/extensions/ublock/web_accessible_resources/google-ima.js +855 -0
- package/extensions/ublock/web_accessible_resources/googlesyndication_adsbygoogle.js +56 -0
- package/extensions/ublock/web_accessible_resources/googletagmanager_gtm.js +43 -0
- package/extensions/ublock/web_accessible_resources/googletagservices_gpt.js +153 -0
- package/extensions/ublock/web_accessible_resources/hd-main.js +46 -0
- package/extensions/ublock/web_accessible_resources/ligatus_angular-tag.js +29 -0
- package/extensions/ublock/web_accessible_resources/monkeybroker.js +43 -0
- package/extensions/ublock/web_accessible_resources/mxpnl_mixpanel.js +51 -0
- package/extensions/ublock/web_accessible_resources/nobab.js +87 -0
- package/extensions/ublock/web_accessible_resources/nobab2.js +42 -0
- package/extensions/ublock/web_accessible_resources/noeval-silent.js +28 -0
- package/extensions/ublock/web_accessible_resources/noeval.js +30 -0
- package/extensions/ublock/web_accessible_resources/nofab.js +67 -0
- package/extensions/ublock/web_accessible_resources/noop-0.1s.mp3 +0 -0
- package/extensions/ublock/web_accessible_resources/noop-0.5s.mp3 +0 -0
- package/extensions/ublock/web_accessible_resources/noop-1s.mp4 +0 -0
- package/extensions/ublock/web_accessible_resources/noop-vmap1.0.xml +1 -0
- package/extensions/ublock/web_accessible_resources/noop.css +1 -0
- package/extensions/ublock/web_accessible_resources/noop.html +5 -0
- package/extensions/ublock/web_accessible_resources/noop.js +3 -0
- package/extensions/ublock/web_accessible_resources/noop.json +1 -0
- package/extensions/ublock/web_accessible_resources/noop.txt +1 -0
- package/extensions/ublock/web_accessible_resources/outbrain-widget.js +72 -0
- package/extensions/ublock/web_accessible_resources/popads-dummy.js +30 -0
- package/extensions/ublock/web_accessible_resources/popads.js +40 -0
- package/extensions/ublock/web_accessible_resources/prebid-ads.js +26 -0
- package/extensions/ublock/web_accessible_resources/scorecardresearch_beacon.js +31 -0
- package/extensions/ublock/whitelist.html +63 -0
- package/external/.gitkeep +0 -0
- package/fonts/Calibri Bold Italic.ttf +0 -0
- package/fonts/Calibri Bold.TTF +0 -0
- package/fonts/Calibri Italic.ttf +0 -0
- package/fonts/Calibri Light Italic.ttf +0 -0
- package/fonts/Calibri Light.ttf +0 -0
- package/fonts/Calibri Regular.ttf +0 -0
- package/fonts/Emoji.ttf +0 -0
- package/fonts/SegoeUI-Bold.ttf +0 -0
- package/fonts/SegoeUI-Light.ttf +0 -0
- package/fonts/SegoeUI-Regular.ttf +0 -0
- package/fonts/SegoeUI-Semibold.ttf +0 -0
- package/fonts/SegoeUI-Semilight.ttf +0 -0
- package/fonts/Tahoma Bold.ttf +0 -0
- package/fonts/Tahoma.ttf +0 -0
- package/fonts/fonts.conf +21 -0
- package/package.json +177 -0
- package/scripts/build-function.js +18 -0
- package/scripts/build-open-api.js +274 -0
- package/scripts/build-schemas.js +86 -0
- package/scripts/build-selectors.js +36 -0
- package/scripts/clean.js +7 -0
- package/scripts/install-adblock.js +45 -0
- package/scripts/install-cdp-json.js +37 -0
- package/scripts/start.sh +30 -0
- package/scripts/test.sh +17 -0
- package/src/browserless.ts +253 -0
- package/src/browsers/cdp-chromium.ts +422 -0
- package/src/browsers/index.ts +296 -0
- package/src/browsers/playwright-chromium.ts +168 -0
- package/src/browsers/playwright-firefox.ts +161 -0
- package/src/browsers/playwright-webkit.ts +161 -0
- package/src/config.ts +426 -0
- package/src/constants.ts +4 -0
- package/src/exports.ts +23 -0
- package/src/file-system.ts +54 -0
- package/src/hooks.ts +37 -0
- package/src/http.ts +157 -0
- package/src/index.ts +41 -0
- package/src/limiter.spec.ts +365 -0
- package/src/limiter.ts +225 -0
- package/src/metrics.spec.ts +49 -0
- package/src/metrics.ts +108 -0
- package/src/mime-types.ts +332 -0
- package/src/monitoring.ts +53 -0
- package/src/routes/chromium/http/content-post.ts +238 -0
- package/src/routes/chromium/http/download-post.ts +162 -0
- package/src/routes/chromium/http/function-post.ts +98 -0
- package/src/routes/chromium/http/pdf-post.ts +234 -0
- package/src/routes/chromium/http/performance.ts +71 -0
- package/src/routes/chromium/http/scrape-post.ts +439 -0
- package/src/routes/chromium/http/screenshot-post.ts +262 -0
- package/src/routes/chromium/tests/content.spec.ts +340 -0
- package/src/routes/chromium/tests/download.spec.ts +77 -0
- package/src/routes/chromium/tests/function.spec.ts +279 -0
- package/src/routes/chromium/tests/pdf.spec.ts +375 -0
- package/src/routes/chromium/tests/performance.spec.ts +155 -0
- package/src/routes/chromium/tests/scrape.spec.ts +414 -0
- package/src/routes/chromium/tests/screenshot.spec.ts +387 -0
- package/src/routes/chromium/tests/websocket.spec.ts +407 -0
- package/src/routes/chromium/utils/function/client.ts +99 -0
- package/src/routes/chromium/utils/function/handler.ts +172 -0
- package/src/routes/chromium/utils/performance/child.ts +38 -0
- package/src/routes/chromium/utils/performance/main.ts +90 -0
- package/src/routes/chromium/utils/performance/types.ts +24 -0
- package/src/routes/chromium/ws/browser.ts +31 -0
- package/src/routes/chromium/ws/cdp-chromium.ts +31 -0
- package/src/routes/chromium/ws/page.ts +31 -0
- package/src/routes/chromium/ws/playwright-chromium.ts +44 -0
- package/src/routes/firefox/tests/websocket.spec.ts +146 -0
- package/src/routes/firefox/ws/playwright-firefox.ts +44 -0
- package/src/routes/management/http/config-get.ts +82 -0
- package/src/routes/management/http/metrics-get.ts +43 -0
- package/src/routes/management/http/metrics-total-get.ts +89 -0
- package/src/routes/management/http/sessions-get.ts +39 -0
- package/src/routes/management/http/static-get.ts +109 -0
- package/src/routes/management/tests/management.spec.ts +71 -0
- package/src/routes/webkit/tests/websocket.spec.ts +146 -0
- package/src/routes/webkit/ws/playwright-webkit.ts +44 -0
- package/src/server.ts +609 -0
- package/src/shim.spec.ts +154 -0
- package/src/shim.ts +78 -0
- package/src/types.ts +470 -0
- package/src/utils.ts +787 -0
- package/src/webhooks.ts +50 -0
- package/static/docs/browserless-logo.png +0 -0
- package/static/docs/docs.js +2 -0
- package/static/docs/index.html +71 -0
- package/static/docs/swagger.json +4232 -0
- package/static/favicon-32x32.png +0 -0
- package/static/function/client.js +31623 -0
- package/static/function/index.html +12 -0
- package/tsconfig.json +31 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
|
|
3
|
+
uBlock Origin - a browser extension to block requests.
|
|
4
|
+
Copyright (C) 2020-present Raymond Hill
|
|
5
|
+
|
|
6
|
+
This program is free software: you can redistribute it and/or modify
|
|
7
|
+
it under the terms of the GNU General Public License as published by
|
|
8
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
(at your option) any later version.
|
|
10
|
+
|
|
11
|
+
This program is distributed in the hope that it will be useful,
|
|
12
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
GNU General Public License for more details.
|
|
15
|
+
|
|
16
|
+
You should have received a copy of the GNU General Public License
|
|
17
|
+
along with this program. If not, see {http://www.gnu.org/licenses/}.
|
|
18
|
+
|
|
19
|
+
Home: https://github.com/gorhill/uBlock
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
'use strict';
|
|
23
|
+
|
|
24
|
+
/******************************************************************************/
|
|
25
|
+
|
|
26
|
+
(( ) => {
|
|
27
|
+
// >>>>> start of local scope
|
|
28
|
+
|
|
29
|
+
/******************************************************************************/
|
|
30
|
+
|
|
31
|
+
// Worker context
|
|
32
|
+
|
|
33
|
+
if (
|
|
34
|
+
self.WorkerGlobalScope instanceof Object &&
|
|
35
|
+
self instanceof self.WorkerGlobalScope
|
|
36
|
+
) {
|
|
37
|
+
let content = '';
|
|
38
|
+
|
|
39
|
+
const doSearch = function(details) {
|
|
40
|
+
const reEOLs = /\n\r|\r\n|\n|\r/g;
|
|
41
|
+
const t1 = Date.now() + 750;
|
|
42
|
+
|
|
43
|
+
let reSearch;
|
|
44
|
+
try {
|
|
45
|
+
reSearch = new RegExp(details.pattern, details.flags);
|
|
46
|
+
} catch(ex) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const response = [];
|
|
51
|
+
const maxOffset = content.length;
|
|
52
|
+
let iLine = 0;
|
|
53
|
+
let iOffset = 0;
|
|
54
|
+
let size = 0;
|
|
55
|
+
while ( iOffset < maxOffset ) {
|
|
56
|
+
// Find next match
|
|
57
|
+
const match = reSearch.exec(content);
|
|
58
|
+
if ( match === null ) { break; }
|
|
59
|
+
// Find number of line breaks between last and current match.
|
|
60
|
+
reEOLs.lastIndex = 0;
|
|
61
|
+
const eols = content.slice(iOffset, match.index).match(reEOLs);
|
|
62
|
+
if ( Array.isArray(eols) ) {
|
|
63
|
+
iLine += eols.length;
|
|
64
|
+
}
|
|
65
|
+
// Store line
|
|
66
|
+
response.push(iLine);
|
|
67
|
+
size += 1;
|
|
68
|
+
// Find next line break.
|
|
69
|
+
reEOLs.lastIndex = reSearch.lastIndex;
|
|
70
|
+
const eol = reEOLs.exec(content);
|
|
71
|
+
iOffset = eol !== null
|
|
72
|
+
? reEOLs.lastIndex
|
|
73
|
+
: content.length;
|
|
74
|
+
reSearch.lastIndex = iOffset;
|
|
75
|
+
iLine += 1;
|
|
76
|
+
// Quit if this takes too long
|
|
77
|
+
if ( (size & 0x3FF) === 0 && Date.now() >= t1 ) { break; }
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return response;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
self.onmessage = function(e) {
|
|
84
|
+
const msg = e.data;
|
|
85
|
+
|
|
86
|
+
switch ( msg.what ) {
|
|
87
|
+
case 'setHaystack':
|
|
88
|
+
content = msg.content;
|
|
89
|
+
break;
|
|
90
|
+
|
|
91
|
+
case 'doSearch':
|
|
92
|
+
const response = doSearch(msg);
|
|
93
|
+
self.postMessage({ id: msg.id, response });
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/******************************************************************************/
|
|
102
|
+
|
|
103
|
+
// Main context
|
|
104
|
+
|
|
105
|
+
{
|
|
106
|
+
const workerTTL = { min: 5 };
|
|
107
|
+
const pendingResponses = new Map();
|
|
108
|
+
const workerTTLTimer = vAPI.defer.create(( ) => {
|
|
109
|
+
shutdown();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
let worker;
|
|
113
|
+
let messageId = 1;
|
|
114
|
+
|
|
115
|
+
const onWorkerMessage = function(e) {
|
|
116
|
+
const msg = e.data;
|
|
117
|
+
const resolver = pendingResponses.get(msg.id);
|
|
118
|
+
if ( resolver === undefined ) { return; }
|
|
119
|
+
pendingResponses.delete(msg.id);
|
|
120
|
+
resolver(msg.response);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const cancelPendingTasks = function() {
|
|
124
|
+
for ( const resolver of pendingResponses.values() ) {
|
|
125
|
+
resolver();
|
|
126
|
+
}
|
|
127
|
+
pendingResponses.clear();
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const destroy = function() {
|
|
131
|
+
shutdown();
|
|
132
|
+
self.searchThread = undefined;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const shutdown = function() {
|
|
136
|
+
if ( worker === undefined ) { return; }
|
|
137
|
+
workerTTLTimer.off();
|
|
138
|
+
worker.terminate();
|
|
139
|
+
worker.onmessage = undefined;
|
|
140
|
+
worker = undefined;
|
|
141
|
+
cancelPendingTasks();
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const init = function() {
|
|
145
|
+
if ( self.searchThread instanceof Object === false ) { return; }
|
|
146
|
+
if ( worker === undefined ) {
|
|
147
|
+
worker = new Worker('js/codemirror/search-thread.js');
|
|
148
|
+
worker.onmessage = onWorkerMessage;
|
|
149
|
+
}
|
|
150
|
+
workerTTLTimer.offon(workerTTL);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const needHaystack = function() {
|
|
154
|
+
return worker instanceof Object === false;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const setHaystack = function(content) {
|
|
158
|
+
init();
|
|
159
|
+
worker.postMessage({ what: 'setHaystack', content });
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const search = function(query, overwrite = true) {
|
|
163
|
+
init();
|
|
164
|
+
if ( worker instanceof Object === false ) {
|
|
165
|
+
return Promise.resolve();
|
|
166
|
+
}
|
|
167
|
+
if ( overwrite ) {
|
|
168
|
+
cancelPendingTasks();
|
|
169
|
+
}
|
|
170
|
+
const id = messageId++;
|
|
171
|
+
worker.postMessage({
|
|
172
|
+
what: 'doSearch',
|
|
173
|
+
id,
|
|
174
|
+
pattern: query.source,
|
|
175
|
+
flags: query.flags,
|
|
176
|
+
isRE: query instanceof RegExp
|
|
177
|
+
});
|
|
178
|
+
return new Promise(resolve => {
|
|
179
|
+
pendingResponses.set(id, resolve);
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
self.addEventListener(
|
|
184
|
+
'beforeunload',
|
|
185
|
+
( ) => { destroy(); },
|
|
186
|
+
{ once: true }
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
self.searchThread = { needHaystack, setHaystack, search, shutdown };
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/******************************************************************************/
|
|
193
|
+
|
|
194
|
+
// <<<<< end of local scope
|
|
195
|
+
})();
|
|
196
|
+
|
|
197
|
+
/******************************************************************************/
|
|
198
|
+
|
|
199
|
+
void 0;
|
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
// The following code is heavily based on the standard CodeMirror
|
|
2
|
+
// search addon found at: https://codemirror.net/addon/search/search.js
|
|
3
|
+
// I added/removed and modified code in order to get a closer match to a
|
|
4
|
+
// browser's built-in find-in-page feature which are just enough for
|
|
5
|
+
// uBlock Origin.
|
|
6
|
+
//
|
|
7
|
+
// This file was originally wholly imported from:
|
|
8
|
+
// https://github.com/codemirror/CodeMirror/blob/3e1bb5fff682f8f6cbfaef0e56c61d62403d4798/addon/search/search.js
|
|
9
|
+
//
|
|
10
|
+
// And has been modified over time to better suit uBO's usage and coding style:
|
|
11
|
+
// https://github.com/gorhill/uBlock/commits/master/src/js/codemirror/search.js
|
|
12
|
+
//
|
|
13
|
+
// The original copyright notice is reproduced below:
|
|
14
|
+
|
|
15
|
+
// =====
|
|
16
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
17
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
18
|
+
|
|
19
|
+
// Define search commands. Depends on dialog.js or another
|
|
20
|
+
// implementation of the openDialog method.
|
|
21
|
+
|
|
22
|
+
// Replace works a little oddly -- it will do the replace on the next
|
|
23
|
+
// Ctrl-G (or whatever is bound to findNext) press. You prevent a
|
|
24
|
+
// replace by making sure the match is no longer selected when hitting
|
|
25
|
+
// Ctrl-G.
|
|
26
|
+
// =====
|
|
27
|
+
|
|
28
|
+
'use strict';
|
|
29
|
+
|
|
30
|
+
import { dom, qs$ } from '../dom.js';
|
|
31
|
+
import { i18n$ } from '../i18n.js';
|
|
32
|
+
|
|
33
|
+
{
|
|
34
|
+
const CodeMirror = self.CodeMirror;
|
|
35
|
+
|
|
36
|
+
const searchOverlay = function(query, caseInsensitive) {
|
|
37
|
+
if ( typeof query === 'string' )
|
|
38
|
+
query = new RegExp(
|
|
39
|
+
query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'),
|
|
40
|
+
caseInsensitive ? 'gi' : 'g'
|
|
41
|
+
);
|
|
42
|
+
else if ( !query.global )
|
|
43
|
+
query = new RegExp(query.source, query.ignoreCase ? 'gi' : 'g');
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
token: function(stream) {
|
|
47
|
+
query.lastIndex = stream.pos;
|
|
48
|
+
const match = query.exec(stream.string);
|
|
49
|
+
if ( match && match.index === stream.pos ) {
|
|
50
|
+
stream.pos += match[0].length || 1;
|
|
51
|
+
return 'searching';
|
|
52
|
+
} else if ( match ) {
|
|
53
|
+
stream.pos = match.index;
|
|
54
|
+
} else {
|
|
55
|
+
stream.skipToEnd();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const searchWidgetKeydownHandler = function(cm, ev) {
|
|
62
|
+
const keyName = CodeMirror.keyName(ev);
|
|
63
|
+
if ( !keyName ) { return; }
|
|
64
|
+
CodeMirror.lookupKey(
|
|
65
|
+
keyName,
|
|
66
|
+
cm.getOption('keyMap'),
|
|
67
|
+
function(command) {
|
|
68
|
+
if ( widgetCommandHandler(cm, command) ) {
|
|
69
|
+
ev.preventDefault();
|
|
70
|
+
ev.stopPropagation();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const searchWidgetInputHandler = function(cm, ev) {
|
|
77
|
+
const state = getSearchState(cm);
|
|
78
|
+
if ( ev.isTrusted !== true ) {
|
|
79
|
+
if ( state.queryText === '' ) {
|
|
80
|
+
clearSearch(cm);
|
|
81
|
+
} else {
|
|
82
|
+
cm.operation(function() {
|
|
83
|
+
startSearch(cm, state);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if ( queryTextFromSearchWidget(cm) === state.queryText ) { return; }
|
|
89
|
+
state.queryTimer.offon(350);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const searchWidgetClickHandler = function(cm, ev) {
|
|
93
|
+
const tcl = ev.target.classList;
|
|
94
|
+
if ( tcl.contains('cm-search-widget-up') ) {
|
|
95
|
+
findNext(cm, -1);
|
|
96
|
+
} else if ( tcl.contains('cm-search-widget-down') ) {
|
|
97
|
+
findNext(cm, 1);
|
|
98
|
+
} else if ( tcl.contains('cm-linter-widget-up') ) {
|
|
99
|
+
findNextError(cm, -1);
|
|
100
|
+
} else if ( tcl.contains('cm-linter-widget-down') ) {
|
|
101
|
+
findNextError(cm, 1);
|
|
102
|
+
}
|
|
103
|
+
if ( ev.target.localName !== 'input' ) {
|
|
104
|
+
ev.preventDefault();
|
|
105
|
+
} else {
|
|
106
|
+
ev.stopImmediatePropagation();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const queryTextFromSearchWidget = function(cm) {
|
|
111
|
+
return getSearchState(cm).widget.querySelector('input[type="search"]').value;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const queryTextToSearchWidget = function(cm, q) {
|
|
115
|
+
const input = getSearchState(cm).widget.querySelector('input[type="search"]');
|
|
116
|
+
if ( typeof q === 'string' && q !== input.value ) {
|
|
117
|
+
input.value = q;
|
|
118
|
+
}
|
|
119
|
+
input.setSelectionRange(0, input.value.length);
|
|
120
|
+
input.focus();
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const SearchState = function(cm) {
|
|
124
|
+
this.query = null;
|
|
125
|
+
this.panel = null;
|
|
126
|
+
const widgetParent = document.querySelector('.cm-search-widget-template').cloneNode(true);
|
|
127
|
+
this.widget = widgetParent.children[0];
|
|
128
|
+
this.widget.addEventListener('keydown', searchWidgetKeydownHandler.bind(null, cm));
|
|
129
|
+
this.widget.addEventListener('input', searchWidgetInputHandler.bind(null, cm));
|
|
130
|
+
this.widget.addEventListener('mousedown', searchWidgetClickHandler.bind(null, cm));
|
|
131
|
+
if ( typeof cm.addPanel === 'function' ) {
|
|
132
|
+
this.panel = cm.addPanel(this.widget);
|
|
133
|
+
}
|
|
134
|
+
this.queryText = '';
|
|
135
|
+
this.dirty = true;
|
|
136
|
+
this.lines = [];
|
|
137
|
+
cm.on('changes', (cm, changes) => {
|
|
138
|
+
for ( const change of changes ) {
|
|
139
|
+
if ( change.text.length !== 0 || change.removed !== 0 ) {
|
|
140
|
+
this.dirty = true;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
cm.on('cursorActivity', cm => {
|
|
146
|
+
updateCount(cm);
|
|
147
|
+
});
|
|
148
|
+
this.queryTimer = vAPI.defer.create(( ) => {
|
|
149
|
+
findCommit(cm, 0);
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
// We want the search widget to behave as if the focus was on the
|
|
154
|
+
// CodeMirror editor.
|
|
155
|
+
|
|
156
|
+
const reSearchCommands = /^(?:find|findNext|findPrev|newlineAndIndent)$/;
|
|
157
|
+
|
|
158
|
+
const widgetCommandHandler = function(cm, command) {
|
|
159
|
+
if ( reSearchCommands.test(command) === false ) { return false; }
|
|
160
|
+
const queryText = queryTextFromSearchWidget(cm);
|
|
161
|
+
if ( command === 'find' ) {
|
|
162
|
+
queryTextToSearchWidget(cm);
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
if ( queryText.length !== 0 ) {
|
|
166
|
+
findNext(cm, command === 'findPrev' ? -1 : 1);
|
|
167
|
+
}
|
|
168
|
+
return true;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const getSearchState = function(cm) {
|
|
172
|
+
return cm.state.search || (cm.state.search = new SearchState(cm));
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const queryCaseInsensitive = function(query) {
|
|
176
|
+
return typeof query === 'string' && query === query.toLowerCase();
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
// Heuristic: if the query string is all lowercase, do a case insensitive search.
|
|
180
|
+
const getSearchCursor = function(cm, query, pos) {
|
|
181
|
+
return cm.getSearchCursor(
|
|
182
|
+
query,
|
|
183
|
+
pos,
|
|
184
|
+
{ caseFold: queryCaseInsensitive(query), multiline: false }
|
|
185
|
+
);
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// https://github.com/uBlockOrigin/uBlock-issues/issues/658
|
|
189
|
+
// Modified to backslash-escape ONLY widely-used control characters.
|
|
190
|
+
const parseString = function(string) {
|
|
191
|
+
return string.replace(/\\[nrt\\]/g, match => {
|
|
192
|
+
if ( match === '\\n' ) { return '\n'; }
|
|
193
|
+
if ( match === '\\r' ) { return '\r'; }
|
|
194
|
+
if ( match === '\\t' ) { return '\t'; }
|
|
195
|
+
if ( match === '\\\\' ) { return '\\'; }
|
|
196
|
+
return match;
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
const reEscape = /[.*+\-?^${}()|[\]\\]/g;
|
|
201
|
+
|
|
202
|
+
// Must always return a RegExp object.
|
|
203
|
+
//
|
|
204
|
+
// Assume case-sensitivity if there is at least one uppercase in plain
|
|
205
|
+
// query text.
|
|
206
|
+
const parseQuery = function(query) {
|
|
207
|
+
let flags = 'i';
|
|
208
|
+
let reParsed = query.match(/^\/(.+)\/([iu]*)$/);
|
|
209
|
+
if ( reParsed !== null ) {
|
|
210
|
+
try {
|
|
211
|
+
const re = new RegExp(reParsed[1], reParsed[2]);
|
|
212
|
+
query = re.source;
|
|
213
|
+
flags = re.flags;
|
|
214
|
+
}
|
|
215
|
+
catch (e) {
|
|
216
|
+
reParsed = null;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if ( reParsed === null ) {
|
|
220
|
+
if ( /[A-Z]/.test(query) ) { flags = ''; }
|
|
221
|
+
query = parseString(query).replace(reEscape, '\\$&');
|
|
222
|
+
}
|
|
223
|
+
if ( typeof query === 'string' ? query === '' : query.test('') ) {
|
|
224
|
+
query = 'x^';
|
|
225
|
+
}
|
|
226
|
+
return new RegExp(query, 'gm' + flags);
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
let intlNumberFormat;
|
|
230
|
+
|
|
231
|
+
const formatNumber = function(n) {
|
|
232
|
+
if ( intlNumberFormat === undefined ) {
|
|
233
|
+
intlNumberFormat = null;
|
|
234
|
+
if ( Intl.NumberFormat instanceof Function ) {
|
|
235
|
+
const intl = new Intl.NumberFormat(undefined, {
|
|
236
|
+
notation: 'compact',
|
|
237
|
+
maximumSignificantDigits: 3
|
|
238
|
+
});
|
|
239
|
+
if (
|
|
240
|
+
intl.resolvedOptions instanceof Function &&
|
|
241
|
+
intl.resolvedOptions().hasOwnProperty('notation')
|
|
242
|
+
) {
|
|
243
|
+
intlNumberFormat = intl;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return n > 10000 && intlNumberFormat instanceof Object
|
|
248
|
+
? intlNumberFormat.format(n)
|
|
249
|
+
: n.toLocaleString();
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
const updateCount = function(cm) {
|
|
253
|
+
const state = getSearchState(cm);
|
|
254
|
+
const lines = state.lines;
|
|
255
|
+
const current = cm.getCursor().line;
|
|
256
|
+
let l = 0;
|
|
257
|
+
let r = lines.length;
|
|
258
|
+
let i = -1;
|
|
259
|
+
while ( l < r ) {
|
|
260
|
+
i = l + r >>> 1;
|
|
261
|
+
const candidate = lines[i];
|
|
262
|
+
if ( current === candidate ) { break; }
|
|
263
|
+
if ( current < candidate ) {
|
|
264
|
+
r = i;
|
|
265
|
+
} else /* if ( current > candidate ) */ {
|
|
266
|
+
l = i + 1;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
let text = '';
|
|
270
|
+
if ( i !== -1 ) {
|
|
271
|
+
text = formatNumber(i + 1);
|
|
272
|
+
if ( lines[i] !== current ) {
|
|
273
|
+
text = '~' + text;
|
|
274
|
+
}
|
|
275
|
+
text = text + '\xA0/\xA0';
|
|
276
|
+
}
|
|
277
|
+
const count = lines.length;
|
|
278
|
+
text += formatNumber(count);
|
|
279
|
+
const span = state.widget.querySelector('.cm-search-widget-count');
|
|
280
|
+
span.textContent = text;
|
|
281
|
+
span.title = count.toLocaleString();
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
const startSearch = function(cm, state) {
|
|
285
|
+
state.query = parseQuery(state.queryText);
|
|
286
|
+
if ( state.overlay !== undefined ) {
|
|
287
|
+
cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));
|
|
288
|
+
}
|
|
289
|
+
state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));
|
|
290
|
+
cm.addOverlay(state.overlay);
|
|
291
|
+
if ( state.dirty || self.searchThread.needHaystack() ) {
|
|
292
|
+
self.searchThread.setHaystack(cm.getValue());
|
|
293
|
+
state.dirty = false;
|
|
294
|
+
}
|
|
295
|
+
self.searchThread.search(state.query).then(lines => {
|
|
296
|
+
if ( Array.isArray(lines) === false ) { return; }
|
|
297
|
+
state.lines = lines;
|
|
298
|
+
const count = lines.length;
|
|
299
|
+
updateCount(cm);
|
|
300
|
+
if ( state.annotate !== undefined ) {
|
|
301
|
+
state.annotate.clear();
|
|
302
|
+
state.annotate = undefined;
|
|
303
|
+
}
|
|
304
|
+
if ( count === 0 ) { return; }
|
|
305
|
+
state.annotate = cm.annotateScrollbar('CodeMirror-search-match');
|
|
306
|
+
const annotations = [];
|
|
307
|
+
let lineBeg = -1;
|
|
308
|
+
let lineEnd = -1;
|
|
309
|
+
for ( const line of lines ) {
|
|
310
|
+
if ( lineBeg === -1 ) {
|
|
311
|
+
lineBeg = line;
|
|
312
|
+
lineEnd = line + 1;
|
|
313
|
+
continue;
|
|
314
|
+
} else if ( line === lineEnd ) {
|
|
315
|
+
lineEnd = line + 1;
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
annotations.push({
|
|
319
|
+
from: { line: lineBeg, ch: 0 },
|
|
320
|
+
to: { line: lineEnd, ch: 0 }
|
|
321
|
+
});
|
|
322
|
+
lineBeg = -1;
|
|
323
|
+
}
|
|
324
|
+
if ( lineBeg !== -1 ) {
|
|
325
|
+
annotations.push({
|
|
326
|
+
from: { line: lineBeg, ch: 0 },
|
|
327
|
+
to: { line: lineEnd, ch: 0 }
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
state.annotate.update(annotations);
|
|
331
|
+
});
|
|
332
|
+
state.widget.setAttribute('data-query', state.queryText);
|
|
333
|
+
// Ensure the caret is visible
|
|
334
|
+
const input = state.widget.querySelector('.cm-search-widget-input input');
|
|
335
|
+
input.selectionStart = input.selectionStart;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
const findNext = function(cm, dir, callback) {
|
|
339
|
+
cm.operation(function() {
|
|
340
|
+
const state = getSearchState(cm);
|
|
341
|
+
if ( !state.query ) { return; }
|
|
342
|
+
let cursor = getSearchCursor(
|
|
343
|
+
cm,
|
|
344
|
+
state.query,
|
|
345
|
+
dir <= 0 ? cm.getCursor('from') : cm.getCursor('to')
|
|
346
|
+
);
|
|
347
|
+
const previous = dir < 0;
|
|
348
|
+
if (!cursor.find(previous)) {
|
|
349
|
+
cursor = getSearchCursor(
|
|
350
|
+
cm,
|
|
351
|
+
state.query,
|
|
352
|
+
previous
|
|
353
|
+
? CodeMirror.Pos(cm.lastLine())
|
|
354
|
+
: CodeMirror.Pos(cm.firstLine(), 0)
|
|
355
|
+
);
|
|
356
|
+
if (!cursor.find(previous)) return;
|
|
357
|
+
}
|
|
358
|
+
cm.setSelection(cursor.from(), cursor.to());
|
|
359
|
+
const { clientHeight } = cm.getScrollInfo();
|
|
360
|
+
cm.scrollIntoView(
|
|
361
|
+
{ from: cursor.from(), to: cursor.to() },
|
|
362
|
+
clientHeight >>> 1
|
|
363
|
+
);
|
|
364
|
+
if (callback) callback(cursor.from(), cursor.to());
|
|
365
|
+
});
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
const findNextError = function(cm, dir) {
|
|
369
|
+
const doc = cm.getDoc();
|
|
370
|
+
const cursor = cm.getCursor('from');
|
|
371
|
+
const cursorLine = cursor.line;
|
|
372
|
+
const start = dir < 0 ? 0 : cursorLine + 1;
|
|
373
|
+
const end = dir < 0 ? cursorLine : doc.lineCount();
|
|
374
|
+
let found = -1;
|
|
375
|
+
doc.eachLine(start, end, lineHandle => {
|
|
376
|
+
const markers = lineHandle.gutterMarkers || null;
|
|
377
|
+
if ( markers === null ) { return; }
|
|
378
|
+
const marker = markers['CodeMirror-lintgutter'];
|
|
379
|
+
if ( marker === undefined ) { return; }
|
|
380
|
+
if ( marker.dataset.lint !== 'error' ) { return; }
|
|
381
|
+
const line = lineHandle.lineNo();
|
|
382
|
+
if ( dir < 0 ) {
|
|
383
|
+
found = line;
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
found = line;
|
|
387
|
+
return true;
|
|
388
|
+
});
|
|
389
|
+
if ( found === -1 || found === cursorLine ) { return; }
|
|
390
|
+
cm.getDoc().setCursor(found);
|
|
391
|
+
const { clientHeight } = cm.getScrollInfo();
|
|
392
|
+
cm.scrollIntoView({ line: found, ch: 0 }, clientHeight >>> 1);
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
const clearSearch = function(cm, hard) {
|
|
396
|
+
cm.operation(function() {
|
|
397
|
+
const state = getSearchState(cm);
|
|
398
|
+
if ( state.query ) {
|
|
399
|
+
state.query = state.queryText = null;
|
|
400
|
+
}
|
|
401
|
+
state.lines = [];
|
|
402
|
+
if ( state.overlay !== undefined ) {
|
|
403
|
+
cm.removeOverlay(state.overlay);
|
|
404
|
+
state.overlay = undefined;
|
|
405
|
+
}
|
|
406
|
+
if ( state.annotate ) {
|
|
407
|
+
state.annotate.clear();
|
|
408
|
+
state.annotate = undefined;
|
|
409
|
+
}
|
|
410
|
+
state.widget.removeAttribute('data-query');
|
|
411
|
+
if ( hard ) {
|
|
412
|
+
state.panel.clear();
|
|
413
|
+
state.panel = null;
|
|
414
|
+
state.widget = null;
|
|
415
|
+
cm.state.search = null;
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
const findCommit = function(cm, dir) {
|
|
421
|
+
const state = getSearchState(cm);
|
|
422
|
+
state.queryTimer.off();
|
|
423
|
+
const queryText = queryTextFromSearchWidget(cm);
|
|
424
|
+
if ( queryText === state.queryText ) { return; }
|
|
425
|
+
state.queryText = queryText;
|
|
426
|
+
if ( state.queryText === '' ) {
|
|
427
|
+
clearSearch(cm);
|
|
428
|
+
} else {
|
|
429
|
+
cm.operation(function() {
|
|
430
|
+
startSearch(cm, state);
|
|
431
|
+
findNext(cm, dir);
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
const findCommand = function(cm) {
|
|
437
|
+
let queryText = cm.getSelection() || undefined;
|
|
438
|
+
if ( !queryText ) {
|
|
439
|
+
const word = cm.findWordAt(cm.getCursor());
|
|
440
|
+
queryText = cm.getRange(word.anchor, word.head);
|
|
441
|
+
if ( /^\W|\W$/.test(queryText) ) {
|
|
442
|
+
queryText = undefined;
|
|
443
|
+
}
|
|
444
|
+
cm.setCursor(word.anchor);
|
|
445
|
+
}
|
|
446
|
+
queryTextToSearchWidget(cm, queryText);
|
|
447
|
+
findCommit(cm, 1);
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
const findNextCommand = function(cm) {
|
|
451
|
+
const state = getSearchState(cm);
|
|
452
|
+
if ( state.query ) { return findNext(cm, 1); }
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
const findPrevCommand = function(cm) {
|
|
456
|
+
const state = getSearchState(cm);
|
|
457
|
+
if ( state.query ) { return findNext(cm, -1); }
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
{
|
|
461
|
+
const searchWidgetTemplate =
|
|
462
|
+
'<div class="cm-search-widget-template" style="display:none;">' +
|
|
463
|
+
'<div class="cm-search-widget">' +
|
|
464
|
+
'<span class="cm-search-widget-input">' +
|
|
465
|
+
'<span class="fa-icon fa-icon-ro">search</span> ' +
|
|
466
|
+
'<input type="search" spellcheck="false"> ' +
|
|
467
|
+
'<span class="cm-search-widget-up cm-search-widget-button fa-icon">angle-up</span> ' +
|
|
468
|
+
'<span class="cm-search-widget-down cm-search-widget-button fa-icon fa-icon-vflipped">angle-up</span> ' +
|
|
469
|
+
'<span class="cm-search-widget-count"></span>' +
|
|
470
|
+
'</span>' +
|
|
471
|
+
'<span class="cm-linter-widget" data-lint="0">' +
|
|
472
|
+
'<span class="cm-linter-widget-count"></span> ' +
|
|
473
|
+
'<span class="cm-linter-widget-up cm-search-widget-button fa-icon">angle-up</span> ' +
|
|
474
|
+
'<span class="cm-linter-widget-down cm-search-widget-button fa-icon fa-icon-vflipped">angle-up</span> ' +
|
|
475
|
+
'</span>' +
|
|
476
|
+
'<span>' +
|
|
477
|
+
'<a class="fa-icon sourceURL" href>external-link</a>' +
|
|
478
|
+
'</span>' +
|
|
479
|
+
'</div>' +
|
|
480
|
+
'</div>';
|
|
481
|
+
const domParser = new DOMParser();
|
|
482
|
+
const doc = domParser.parseFromString(searchWidgetTemplate, 'text/html');
|
|
483
|
+
const widgetTemplate = document.adoptNode(doc.body.firstElementChild);
|
|
484
|
+
document.body.appendChild(widgetTemplate);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
CodeMirror.commands.find = findCommand;
|
|
488
|
+
CodeMirror.commands.findNext = findNextCommand;
|
|
489
|
+
CodeMirror.commands.findPrev = findPrevCommand;
|
|
490
|
+
|
|
491
|
+
CodeMirror.defineInitHook(function(cm) {
|
|
492
|
+
getSearchState(cm);
|
|
493
|
+
cm.on('linterDone', details => {
|
|
494
|
+
const linterWidget = qs$('.cm-linter-widget');
|
|
495
|
+
const count = details.errorCount;
|
|
496
|
+
if ( linterWidget.dataset.lint === `${count}` ) { return; }
|
|
497
|
+
linterWidget.dataset.lint = `${count}`;
|
|
498
|
+
dom.text(
|
|
499
|
+
qs$(linterWidget, '.cm-linter-widget-count'),
|
|
500
|
+
i18n$('linterMainReport').replace('{{count}}', count.toLocaleString())
|
|
501
|
+
);
|
|
502
|
+
});
|
|
503
|
+
});
|
|
504
|
+
}
|