@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,678 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
|
|
3
|
+
uBlock Origin - a browser extension to block requests.
|
|
4
|
+
Copyright (C) 2014-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/uMatrix
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/* global CodeMirror, diff_match_patch, uBlockDashboard */
|
|
23
|
+
|
|
24
|
+
'use strict';
|
|
25
|
+
|
|
26
|
+
import publicSuffixList from '../lib/publicsuffixlist/publicsuffixlist.js';
|
|
27
|
+
|
|
28
|
+
import { hostnameFromURI } from './uri-utils.js';
|
|
29
|
+
import { i18n$ } from './i18n.js';
|
|
30
|
+
import { dom, qs$, qsa$ } from './dom.js';
|
|
31
|
+
|
|
32
|
+
import './codemirror/ubo-dynamic-filtering.js';
|
|
33
|
+
|
|
34
|
+
/******************************************************************************/
|
|
35
|
+
|
|
36
|
+
const hostnameToDomainMap = new Map();
|
|
37
|
+
|
|
38
|
+
const mergeView = new CodeMirror.MergeView(
|
|
39
|
+
qs$('.codeMirrorMergeContainer'),
|
|
40
|
+
{
|
|
41
|
+
allowEditingOriginals: true,
|
|
42
|
+
connect: 'align',
|
|
43
|
+
inputStyle: 'contenteditable',
|
|
44
|
+
lineNumbers: true,
|
|
45
|
+
lineWrapping: false,
|
|
46
|
+
origLeft: '',
|
|
47
|
+
revertButtons: true,
|
|
48
|
+
value: '',
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
mergeView.editor().setOption('styleActiveLine', true);
|
|
52
|
+
mergeView.editor().setOption('lineNumbers', false);
|
|
53
|
+
mergeView.leftOriginal().setOption('readOnly', 'nocursor');
|
|
54
|
+
|
|
55
|
+
uBlockDashboard.patchCodeMirrorEditor(mergeView.editor());
|
|
56
|
+
|
|
57
|
+
const thePanes = {
|
|
58
|
+
orig: {
|
|
59
|
+
doc: mergeView.leftOriginal(),
|
|
60
|
+
original: [],
|
|
61
|
+
modified: [],
|
|
62
|
+
},
|
|
63
|
+
edit: {
|
|
64
|
+
doc: mergeView.editor(),
|
|
65
|
+
original: [],
|
|
66
|
+
modified: [],
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
let cleanEditToken = 0;
|
|
71
|
+
let cleanEditText = '';
|
|
72
|
+
let isCollapsed = false;
|
|
73
|
+
|
|
74
|
+
/******************************************************************************/
|
|
75
|
+
|
|
76
|
+
// The following code is to take care of properly internationalizing
|
|
77
|
+
// the tooltips of the arrows used by the CodeMirror merge view. These
|
|
78
|
+
// are hard-coded by CodeMirror ("Push to left", "Push to right"). An
|
|
79
|
+
// observer is necessary because there is no hook for uBO to overwrite
|
|
80
|
+
// reliably the default title attribute assigned by CodeMirror.
|
|
81
|
+
|
|
82
|
+
{
|
|
83
|
+
const i18nCommitStr = i18n$('rulesCommit');
|
|
84
|
+
const i18nRevertStr = i18n$('rulesRevert');
|
|
85
|
+
const commitArrowSelector = '.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy-reverse:not([title="' + i18nCommitStr + '"])';
|
|
86
|
+
const revertArrowSelector = '.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy:not([title="' + i18nRevertStr + '"])';
|
|
87
|
+
|
|
88
|
+
dom.attr('.CodeMirror-merge-scrolllock', 'title', i18n$('genericMergeViewScrollLock'));
|
|
89
|
+
|
|
90
|
+
const translate = function() {
|
|
91
|
+
let elems = qsa$(commitArrowSelector);
|
|
92
|
+
for ( const elem of elems ) {
|
|
93
|
+
dom.attr(elem, 'title', i18nCommitStr);
|
|
94
|
+
}
|
|
95
|
+
elems = qsa$(revertArrowSelector);
|
|
96
|
+
for ( const elem of elems ) {
|
|
97
|
+
dom.attr(elem, 'title', i18nRevertStr);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const mergeGapObserver = new MutationObserver(translate);
|
|
102
|
+
|
|
103
|
+
mergeGapObserver.observe(
|
|
104
|
+
qs$('.CodeMirror-merge-copybuttons-left'),
|
|
105
|
+
{ attributes: true, attributeFilter: [ 'title' ], subtree: true }
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/******************************************************************************/
|
|
111
|
+
|
|
112
|
+
const getDiffer = (( ) => {
|
|
113
|
+
let differ;
|
|
114
|
+
return ( ) => {
|
|
115
|
+
if ( differ === undefined ) { differ = new diff_match_patch(); }
|
|
116
|
+
return differ;
|
|
117
|
+
};
|
|
118
|
+
})();
|
|
119
|
+
|
|
120
|
+
/******************************************************************************/
|
|
121
|
+
|
|
122
|
+
// Borrowed from...
|
|
123
|
+
// https://github.com/codemirror/CodeMirror/blob/3e1bb5fff682f8f6cbfaef0e56c61d62403d4798/addon/search/search.js#L22
|
|
124
|
+
// ... and modified as needed.
|
|
125
|
+
|
|
126
|
+
const updateOverlay = (( ) => {
|
|
127
|
+
let reFilter;
|
|
128
|
+
const mode = {
|
|
129
|
+
token: function(stream) {
|
|
130
|
+
if ( reFilter !== undefined ) {
|
|
131
|
+
reFilter.lastIndex = stream.pos;
|
|
132
|
+
let match = reFilter.exec(stream.string);
|
|
133
|
+
if ( match !== null ) {
|
|
134
|
+
if ( match.index === stream.pos ) {
|
|
135
|
+
stream.pos += match[0].length || 1;
|
|
136
|
+
return 'searching';
|
|
137
|
+
}
|
|
138
|
+
stream.pos = match.index;
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
stream.skipToEnd();
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
return function(filter) {
|
|
146
|
+
reFilter = typeof filter === 'string' && filter !== '' ?
|
|
147
|
+
new RegExp(filter.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'gi') :
|
|
148
|
+
undefined;
|
|
149
|
+
return mode;
|
|
150
|
+
};
|
|
151
|
+
})();
|
|
152
|
+
|
|
153
|
+
/******************************************************************************/
|
|
154
|
+
|
|
155
|
+
// Incrementally update text in a CodeMirror editor for best user experience:
|
|
156
|
+
// - Scroll position preserved
|
|
157
|
+
// - Minimum amount of text updated
|
|
158
|
+
|
|
159
|
+
const rulesToDoc = function(clearHistory) {
|
|
160
|
+
const orig = thePanes.orig.doc;
|
|
161
|
+
const edit = thePanes.edit.doc;
|
|
162
|
+
orig.startOperation();
|
|
163
|
+
edit.startOperation();
|
|
164
|
+
|
|
165
|
+
for ( const key in thePanes ) {
|
|
166
|
+
if ( thePanes.hasOwnProperty(key) === false ) { continue; }
|
|
167
|
+
const doc = thePanes[key].doc;
|
|
168
|
+
const rules = filterRules(key);
|
|
169
|
+
if (
|
|
170
|
+
clearHistory ||
|
|
171
|
+
doc.lineCount() === 1 && doc.getValue() === '' ||
|
|
172
|
+
rules.length === 0
|
|
173
|
+
) {
|
|
174
|
+
doc.setValue(rules.length !== 0 ? rules.join('\n') + '\n' : '');
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
// https://github.com/uBlockOrigin/uBlock-issues/issues/593
|
|
178
|
+
// Ensure the text content always ends with an empty line to avoid
|
|
179
|
+
// spurious diff entries.
|
|
180
|
+
// https://github.com/uBlockOrigin/uBlock-issues/issues/657
|
|
181
|
+
// Diff against unmodified beforeText so that the last newline can
|
|
182
|
+
// be reported in the diff and thus appended if needed.
|
|
183
|
+
let beforeText = doc.getValue();
|
|
184
|
+
let afterText = rules.join('\n').trim();
|
|
185
|
+
if ( afterText !== '' ) { afterText += '\n'; }
|
|
186
|
+
const diffs = getDiffer().diff_main(beforeText, afterText);
|
|
187
|
+
let i = diffs.length;
|
|
188
|
+
let iedit = beforeText.length;
|
|
189
|
+
while ( i-- ) {
|
|
190
|
+
const diff = diffs[i];
|
|
191
|
+
if ( diff[0] === 0 ) {
|
|
192
|
+
iedit -= diff[1].length;
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
const end = doc.posFromIndex(iedit);
|
|
196
|
+
if ( diff[0] === 1 ) {
|
|
197
|
+
doc.replaceRange(diff[1], end, end);
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
/* diff[0] === -1 */
|
|
201
|
+
iedit -= diff[1].length;
|
|
202
|
+
const beg = doc.posFromIndex(iedit);
|
|
203
|
+
doc.replaceRange('', beg, end);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Mark ellipses as read-only
|
|
208
|
+
const marks = edit.getAllMarks();
|
|
209
|
+
for ( const mark of marks ) {
|
|
210
|
+
if ( mark.uboEllipsis !== true ) { continue; }
|
|
211
|
+
mark.clear();
|
|
212
|
+
}
|
|
213
|
+
if ( isCollapsed ) {
|
|
214
|
+
for ( let iline = 0, n = edit.lineCount(); iline < n; iline++ ) {
|
|
215
|
+
if ( edit.getLine(iline) !== '...' ) { continue; }
|
|
216
|
+
const mark = edit.markText(
|
|
217
|
+
{ line: iline, ch: 0 },
|
|
218
|
+
{ line: iline + 1, ch: 0 },
|
|
219
|
+
{ atomic: true, readOnly: true }
|
|
220
|
+
);
|
|
221
|
+
mark.uboEllipsis = true;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
orig.endOperation();
|
|
226
|
+
edit.endOperation();
|
|
227
|
+
cleanEditText = mergeView.editor().getValue().trim();
|
|
228
|
+
cleanEditToken = mergeView.editor().changeGeneration();
|
|
229
|
+
|
|
230
|
+
if ( clearHistory !== true ) { return; }
|
|
231
|
+
|
|
232
|
+
mergeView.editor().clearHistory();
|
|
233
|
+
const chunks = mergeView.leftChunks();
|
|
234
|
+
if ( chunks.length === 0 ) { return; }
|
|
235
|
+
const ldoc = thePanes.orig.doc;
|
|
236
|
+
const { clientHeight } = ldoc.getScrollInfo();
|
|
237
|
+
const line = Math.min(chunks[0].editFrom, chunks[0].origFrom);
|
|
238
|
+
ldoc.setCursor(line, 0);
|
|
239
|
+
ldoc.scrollIntoView(
|
|
240
|
+
{ line, ch: 0 },
|
|
241
|
+
(clientHeight - ldoc.defaultTextHeight()) / 2
|
|
242
|
+
);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
/******************************************************************************/
|
|
246
|
+
|
|
247
|
+
const filterRules = function(key) {
|
|
248
|
+
const filter = qs$('#ruleFilter input').value;
|
|
249
|
+
const rules = thePanes[key].modified;
|
|
250
|
+
if ( filter === '' ) { return rules; }
|
|
251
|
+
const out = [];
|
|
252
|
+
for ( const rule of rules ) {
|
|
253
|
+
if ( rule.indexOf(filter) === -1 ) { continue; }
|
|
254
|
+
out.push(rule);
|
|
255
|
+
}
|
|
256
|
+
return out;
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
/******************************************************************************/
|
|
260
|
+
|
|
261
|
+
const applyDiff = async function(permanent, toAdd, toRemove) {
|
|
262
|
+
const details = await vAPI.messaging.send('dashboard', {
|
|
263
|
+
what: 'modifyRuleset',
|
|
264
|
+
permanent: permanent,
|
|
265
|
+
toAdd: toAdd,
|
|
266
|
+
toRemove: toRemove,
|
|
267
|
+
});
|
|
268
|
+
thePanes.orig.original = details.permanentRules;
|
|
269
|
+
thePanes.edit.original = details.sessionRules;
|
|
270
|
+
onPresentationChanged();
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
/******************************************************************************/
|
|
274
|
+
|
|
275
|
+
// CodeMirror quirk: sometimes fromStart.ch and/or toStart.ch is undefined.
|
|
276
|
+
// When this happens, use 0.
|
|
277
|
+
|
|
278
|
+
mergeView.options.revertChunk = function(
|
|
279
|
+
mv,
|
|
280
|
+
from, fromStart, fromEnd,
|
|
281
|
+
to, toStart, toEnd
|
|
282
|
+
) {
|
|
283
|
+
// https://github.com/gorhill/uBlock/issues/3611
|
|
284
|
+
if ( dom.attr(dom.body, 'dir') === 'rtl' ) {
|
|
285
|
+
let tmp = from; from = to; to = tmp;
|
|
286
|
+
tmp = fromStart; fromStart = toStart; toStart = tmp;
|
|
287
|
+
tmp = fromEnd; fromEnd = toEnd; toEnd = tmp;
|
|
288
|
+
}
|
|
289
|
+
if ( typeof fromStart.ch !== 'number' ) { fromStart.ch = 0; }
|
|
290
|
+
if ( fromEnd.ch !== 0 ) { fromEnd.line += 1; }
|
|
291
|
+
const toAdd = from.getRange(
|
|
292
|
+
{ line: fromStart.line, ch: 0 },
|
|
293
|
+
{ line: fromEnd.line, ch: 0 }
|
|
294
|
+
);
|
|
295
|
+
if ( typeof toStart.ch !== 'number' ) { toStart.ch = 0; }
|
|
296
|
+
if ( toEnd.ch !== 0 ) { toEnd.line += 1; }
|
|
297
|
+
const toRemove = to.getRange(
|
|
298
|
+
{ line: toStart.line, ch: 0 },
|
|
299
|
+
{ line: toEnd.line, ch: 0 }
|
|
300
|
+
);
|
|
301
|
+
applyDiff(from === mv.editor(), toAdd, toRemove);
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
/******************************************************************************/
|
|
305
|
+
|
|
306
|
+
function handleImportFilePicker() {
|
|
307
|
+
const fileReaderOnLoadHandler = function() {
|
|
308
|
+
if ( typeof this.result !== 'string' || this.result === '' ) { return; }
|
|
309
|
+
// https://github.com/chrisaljoudi/uBlock/issues/757
|
|
310
|
+
// Support RequestPolicy rule syntax
|
|
311
|
+
let result = this.result;
|
|
312
|
+
let matches = /\[origins-to-destinations\]([^\[]+)/.exec(result);
|
|
313
|
+
if ( matches && matches.length === 2 ) {
|
|
314
|
+
result = matches[1].trim()
|
|
315
|
+
.replace(/\|/g, ' ')
|
|
316
|
+
.replace(/\n/g, ' * noop\n');
|
|
317
|
+
}
|
|
318
|
+
applyDiff(false, result, '');
|
|
319
|
+
};
|
|
320
|
+
const file = this.files[0];
|
|
321
|
+
if ( file === undefined || file.name === '' ) { return; }
|
|
322
|
+
if ( file.type.indexOf('text') !== 0 ) { return; }
|
|
323
|
+
const fr = new FileReader();
|
|
324
|
+
fr.onload = fileReaderOnLoadHandler;
|
|
325
|
+
fr.readAsText(file);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/******************************************************************************/
|
|
329
|
+
|
|
330
|
+
const startImportFilePicker = function() {
|
|
331
|
+
const input = qs$('#importFilePicker');
|
|
332
|
+
// Reset to empty string, this will ensure an change event is properly
|
|
333
|
+
// triggered if the user pick a file, even if it is the same as the last
|
|
334
|
+
// one picked.
|
|
335
|
+
input.value = '';
|
|
336
|
+
input.click();
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
/******************************************************************************/
|
|
340
|
+
|
|
341
|
+
function exportUserRulesToFile() {
|
|
342
|
+
const filename = i18n$('rulesDefaultFileName')
|
|
343
|
+
.replace('{{datetime}}', uBlockDashboard.dateNowToSensibleString())
|
|
344
|
+
.replace(/ +/g, '_');
|
|
345
|
+
vAPI.download({
|
|
346
|
+
url: 'data:text/plain,' + encodeURIComponent(
|
|
347
|
+
mergeView.leftOriginal().getValue().trim() + '\n'
|
|
348
|
+
),
|
|
349
|
+
filename: filename,
|
|
350
|
+
saveAs: true
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/******************************************************************************/
|
|
355
|
+
|
|
356
|
+
const onFilterChanged = (( ) => {
|
|
357
|
+
let timer;
|
|
358
|
+
let overlay = null;
|
|
359
|
+
let last = '';
|
|
360
|
+
|
|
361
|
+
const process = function() {
|
|
362
|
+
timer = undefined;
|
|
363
|
+
if ( mergeView.editor().isClean(cleanEditToken) === false ) { return; }
|
|
364
|
+
const filter = qs$('#ruleFilter input').value;
|
|
365
|
+
if ( filter === last ) { return; }
|
|
366
|
+
last = filter;
|
|
367
|
+
if ( overlay !== null ) {
|
|
368
|
+
mergeView.leftOriginal().removeOverlay(overlay);
|
|
369
|
+
mergeView.editor().removeOverlay(overlay);
|
|
370
|
+
overlay = null;
|
|
371
|
+
}
|
|
372
|
+
if ( filter !== '' ) {
|
|
373
|
+
overlay = updateOverlay(filter);
|
|
374
|
+
mergeView.leftOriginal().addOverlay(overlay);
|
|
375
|
+
mergeView.editor().addOverlay(overlay);
|
|
376
|
+
}
|
|
377
|
+
rulesToDoc(true);
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
return function() {
|
|
381
|
+
if ( timer !== undefined ) { self.cancelIdleCallback(timer); }
|
|
382
|
+
timer = self.requestIdleCallback(process, { timeout: 773 });
|
|
383
|
+
};
|
|
384
|
+
})();
|
|
385
|
+
|
|
386
|
+
/******************************************************************************/
|
|
387
|
+
|
|
388
|
+
const onPresentationChanged = (( ) => {
|
|
389
|
+
let sortType = 1;
|
|
390
|
+
|
|
391
|
+
const reSwRule = /^([^/]+): ([^/ ]+) ([^ ]+)/;
|
|
392
|
+
const reRule = /^([^ ]+) ([^/ ]+) ([^ ]+ [^ ]+)/;
|
|
393
|
+
const reUrlRule = /^([^ ]+) ([^ ]+) ([^ ]+ [^ ]+)/;
|
|
394
|
+
|
|
395
|
+
const sortNormalizeHn = function(hn) {
|
|
396
|
+
let domain = hostnameToDomainMap.get(hn);
|
|
397
|
+
if ( domain === undefined ) {
|
|
398
|
+
domain = /(\d|\])$/.test(hn)
|
|
399
|
+
? hn
|
|
400
|
+
: publicSuffixList.getDomain(hn);
|
|
401
|
+
hostnameToDomainMap.set(hn, domain);
|
|
402
|
+
}
|
|
403
|
+
let normalized = domain || hn;
|
|
404
|
+
if ( hn.length !== domain.length ) {
|
|
405
|
+
const subdomains = hn.slice(0, hn.length - domain.length - 1);
|
|
406
|
+
normalized += '.' + (
|
|
407
|
+
subdomains.includes('.')
|
|
408
|
+
? subdomains.split('.').reverse().join('.')
|
|
409
|
+
: subdomains
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
return normalized;
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
const slotFromRule = rule => {
|
|
416
|
+
let type, srcHn, desHn, extra;
|
|
417
|
+
let match = reSwRule.exec(rule);
|
|
418
|
+
if ( match !== null ) {
|
|
419
|
+
type = ' ' + match[1];
|
|
420
|
+
srcHn = sortNormalizeHn(match[2]);
|
|
421
|
+
desHn = srcHn;
|
|
422
|
+
extra = match[3];
|
|
423
|
+
} else if ( (match = reRule.exec(rule)) !== null ) {
|
|
424
|
+
type = '\x10FFFE';
|
|
425
|
+
srcHn = sortNormalizeHn(match[1]);
|
|
426
|
+
desHn = sortNormalizeHn(match[2]);
|
|
427
|
+
extra = match[3];
|
|
428
|
+
} else if ( (match = reUrlRule.exec(rule)) !== null ) {
|
|
429
|
+
type = '\x10FFFF';
|
|
430
|
+
srcHn = sortNormalizeHn(match[1]);
|
|
431
|
+
desHn = sortNormalizeHn(hostnameFromURI(match[2]));
|
|
432
|
+
extra = match[3];
|
|
433
|
+
}
|
|
434
|
+
if ( sortType === 0 ) {
|
|
435
|
+
return { rule, token: `${type} ${srcHn} ${desHn} ${extra}` };
|
|
436
|
+
}
|
|
437
|
+
if ( sortType === 1 ) {
|
|
438
|
+
return { rule, token: `${srcHn} ${type} ${desHn} ${extra}` };
|
|
439
|
+
}
|
|
440
|
+
return { rule, token: `${desHn} ${type} ${srcHn} ${extra}` };
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
const sort = rules => {
|
|
444
|
+
const slots = [];
|
|
445
|
+
for ( let i = 0; i < rules.length; i++ ) {
|
|
446
|
+
slots.push(slotFromRule(rules[i], 1));
|
|
447
|
+
}
|
|
448
|
+
slots.sort((a, b) => a.token.localeCompare(b.token));
|
|
449
|
+
for ( let i = 0; i < rules.length; i++ ) {
|
|
450
|
+
rules[i] = slots[i].rule;
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
const collapse = ( ) => {
|
|
455
|
+
if ( isCollapsed !== true ) { return; }
|
|
456
|
+
const diffs = getDiffer().diff_main(
|
|
457
|
+
thePanes.orig.modified.join('\n'),
|
|
458
|
+
thePanes.edit.modified.join('\n')
|
|
459
|
+
);
|
|
460
|
+
const ll = []; let il = 0, lellipsis = false;
|
|
461
|
+
const rr = []; let ir = 0, rellipsis = false;
|
|
462
|
+
for ( let i = 0; i < diffs.length; i++ ) {
|
|
463
|
+
const diff = diffs[i];
|
|
464
|
+
if ( diff[0] === 0 ) {
|
|
465
|
+
lellipsis = rellipsis = true;
|
|
466
|
+
il += 1; ir += 1;
|
|
467
|
+
continue;
|
|
468
|
+
}
|
|
469
|
+
if ( diff[0] < 0 ) {
|
|
470
|
+
if ( lellipsis ) {
|
|
471
|
+
ll.push('...');
|
|
472
|
+
if ( rellipsis ) { rr.push('...'); }
|
|
473
|
+
lellipsis = rellipsis = false;
|
|
474
|
+
}
|
|
475
|
+
ll.push(diff[1].trim());
|
|
476
|
+
il += 1;
|
|
477
|
+
continue;
|
|
478
|
+
}
|
|
479
|
+
/* diff[0] > 0 */
|
|
480
|
+
if ( rellipsis ) {
|
|
481
|
+
rr.push('...');
|
|
482
|
+
if ( lellipsis ) { ll.push('...'); }
|
|
483
|
+
lellipsis = rellipsis = false;
|
|
484
|
+
}
|
|
485
|
+
rr.push(diff[1].trim());
|
|
486
|
+
ir += 1;
|
|
487
|
+
}
|
|
488
|
+
if ( lellipsis ) { ll.push('...'); }
|
|
489
|
+
if ( rellipsis ) { rr.push('...'); }
|
|
490
|
+
thePanes.orig.modified = ll;
|
|
491
|
+
thePanes.edit.modified = rr;
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
return function(clearHistory) {
|
|
495
|
+
const origPane = thePanes.orig;
|
|
496
|
+
const editPane = thePanes.edit;
|
|
497
|
+
origPane.modified = origPane.original.slice();
|
|
498
|
+
editPane.modified = editPane.original.slice();
|
|
499
|
+
const select = qs$('#ruleFilter select');
|
|
500
|
+
sortType = parseInt(select.value, 10);
|
|
501
|
+
if ( isNaN(sortType) ) { sortType = 1; }
|
|
502
|
+
{
|
|
503
|
+
const mode = origPane.doc.getMode();
|
|
504
|
+
mode.sortType = sortType;
|
|
505
|
+
mode.setHostnameToDomainMap(hostnameToDomainMap);
|
|
506
|
+
mode.setPSL(publicSuffixList);
|
|
507
|
+
}
|
|
508
|
+
{
|
|
509
|
+
const mode = editPane.doc.getMode();
|
|
510
|
+
mode.sortType = sortType;
|
|
511
|
+
mode.setHostnameToDomainMap(hostnameToDomainMap);
|
|
512
|
+
mode.setPSL(publicSuffixList);
|
|
513
|
+
}
|
|
514
|
+
sort(origPane.modified);
|
|
515
|
+
sort(editPane.modified);
|
|
516
|
+
collapse();
|
|
517
|
+
rulesToDoc(clearHistory);
|
|
518
|
+
onTextChanged(clearHistory);
|
|
519
|
+
};
|
|
520
|
+
})();
|
|
521
|
+
|
|
522
|
+
/******************************************************************************/
|
|
523
|
+
|
|
524
|
+
const onTextChanged = (( ) => {
|
|
525
|
+
let timer;
|
|
526
|
+
|
|
527
|
+
const process = details => {
|
|
528
|
+
timer = undefined;
|
|
529
|
+
const diff = qs$('#diff');
|
|
530
|
+
let isClean = mergeView.editor().isClean(cleanEditToken);
|
|
531
|
+
if (
|
|
532
|
+
details === undefined &&
|
|
533
|
+
isClean === false &&
|
|
534
|
+
mergeView.editor().getValue().trim() === cleanEditText
|
|
535
|
+
) {
|
|
536
|
+
cleanEditToken = mergeView.editor().changeGeneration();
|
|
537
|
+
isClean = true;
|
|
538
|
+
}
|
|
539
|
+
const isDirty = mergeView.leftChunks().length !== 0;
|
|
540
|
+
dom.cl.toggle(dom.body, 'editing', isClean === false);
|
|
541
|
+
dom.cl.toggle(diff, 'dirty', isDirty);
|
|
542
|
+
dom.cl.toggle('#editSaveButton', 'disabled', isClean);
|
|
543
|
+
dom.cl.toggle('#exportButton,#importButton', 'disabled', isClean === false);
|
|
544
|
+
dom.cl.toggle('#revertButton,#commitButton', 'disabled', isClean === false || isDirty === false);
|
|
545
|
+
const input = qs$('#ruleFilter input');
|
|
546
|
+
if ( isClean ) {
|
|
547
|
+
dom.attr(input, 'disabled', null);
|
|
548
|
+
CodeMirror.commands.save = undefined;
|
|
549
|
+
} else {
|
|
550
|
+
dom.attr(input, 'disabled', '');
|
|
551
|
+
CodeMirror.commands.save = editSaveHandler;
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
return function(now) {
|
|
556
|
+
if ( timer !== undefined ) { self.cancelIdleCallback(timer); }
|
|
557
|
+
timer = now ? process() : self.requestIdleCallback(process, { timeout: 57 });
|
|
558
|
+
};
|
|
559
|
+
})();
|
|
560
|
+
|
|
561
|
+
/******************************************************************************/
|
|
562
|
+
|
|
563
|
+
const revertAllHandler = function() {
|
|
564
|
+
const toAdd = [], toRemove = [];
|
|
565
|
+
const left = mergeView.leftOriginal();
|
|
566
|
+
const edit = mergeView.editor();
|
|
567
|
+
for ( const chunk of mergeView.leftChunks() ) {
|
|
568
|
+
const addedLines = left.getRange(
|
|
569
|
+
{ line: chunk.origFrom, ch: 0 },
|
|
570
|
+
{ line: chunk.origTo, ch: 0 }
|
|
571
|
+
);
|
|
572
|
+
const removedLines = edit.getRange(
|
|
573
|
+
{ line: chunk.editFrom, ch: 0 },
|
|
574
|
+
{ line: chunk.editTo, ch: 0 }
|
|
575
|
+
);
|
|
576
|
+
toAdd.push(addedLines.trim());
|
|
577
|
+
toRemove.push(removedLines.trim());
|
|
578
|
+
}
|
|
579
|
+
applyDiff(false, toAdd.join('\n'), toRemove.join('\n'));
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
/******************************************************************************/
|
|
583
|
+
|
|
584
|
+
const commitAllHandler = function() {
|
|
585
|
+
const toAdd = [], toRemove = [];
|
|
586
|
+
const left = mergeView.leftOriginal();
|
|
587
|
+
const edit = mergeView.editor();
|
|
588
|
+
for ( const chunk of mergeView.leftChunks() ) {
|
|
589
|
+
const addedLines = edit.getRange(
|
|
590
|
+
{ line: chunk.editFrom, ch: 0 },
|
|
591
|
+
{ line: chunk.editTo, ch: 0 }
|
|
592
|
+
);
|
|
593
|
+
const removedLines = left.getRange(
|
|
594
|
+
{ line: chunk.origFrom, ch: 0 },
|
|
595
|
+
{ line: chunk.origTo, ch: 0 }
|
|
596
|
+
);
|
|
597
|
+
toAdd.push(addedLines.trim());
|
|
598
|
+
toRemove.push(removedLines.trim());
|
|
599
|
+
}
|
|
600
|
+
applyDiff(true, toAdd.join('\n'), toRemove.join('\n'));
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
/******************************************************************************/
|
|
604
|
+
|
|
605
|
+
const editSaveHandler = function() {
|
|
606
|
+
const editor = mergeView.editor();
|
|
607
|
+
const editText = editor.getValue().trim();
|
|
608
|
+
if ( editText === cleanEditText ) {
|
|
609
|
+
onTextChanged(true);
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
const toAdd = [], toRemove = [];
|
|
613
|
+
const diffs = getDiffer().diff_main(cleanEditText, editText);
|
|
614
|
+
for ( const diff of diffs ) {
|
|
615
|
+
if ( diff[0] === 1 ) {
|
|
616
|
+
toAdd.push(diff[1]);
|
|
617
|
+
} else if ( diff[0] === -1 ) {
|
|
618
|
+
toRemove.push(diff[1]);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
applyDiff(false, toAdd.join(''), toRemove.join(''));
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
/******************************************************************************/
|
|
625
|
+
|
|
626
|
+
self.cloud.onPush = function() {
|
|
627
|
+
return thePanes.orig.original.join('\n');
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
self.cloud.onPull = function(data, append) {
|
|
631
|
+
if ( typeof data !== 'string' ) { return; }
|
|
632
|
+
applyDiff(
|
|
633
|
+
false,
|
|
634
|
+
data,
|
|
635
|
+
append ? '' : mergeView.editor().getValue().trim()
|
|
636
|
+
);
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
/******************************************************************************/
|
|
640
|
+
|
|
641
|
+
self.hasUnsavedData = function() {
|
|
642
|
+
return mergeView.editor().isClean(cleanEditToken) === false;
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
/******************************************************************************/
|
|
646
|
+
|
|
647
|
+
vAPI.messaging.send('dashboard', {
|
|
648
|
+
what: 'getRules',
|
|
649
|
+
}).then(details => {
|
|
650
|
+
thePanes.orig.original = details.permanentRules;
|
|
651
|
+
thePanes.edit.original = details.sessionRules;
|
|
652
|
+
publicSuffixList.fromSelfie(details.pslSelfie);
|
|
653
|
+
onPresentationChanged(true);
|
|
654
|
+
});
|
|
655
|
+
|
|
656
|
+
// Handle user interaction
|
|
657
|
+
dom.on('#importButton', 'click', startImportFilePicker);
|
|
658
|
+
dom.on('#importFilePicker', 'change', handleImportFilePicker);
|
|
659
|
+
dom.on('#exportButton', 'click', exportUserRulesToFile);
|
|
660
|
+
dom.on('#revertButton', 'click', revertAllHandler);
|
|
661
|
+
dom.on('#commitButton', 'click', commitAllHandler);
|
|
662
|
+
dom.on('#editSaveButton', 'click', editSaveHandler);
|
|
663
|
+
dom.on('#ruleFilter input', 'input', onFilterChanged);
|
|
664
|
+
dom.on('#ruleFilter select', 'input', ( ) => {
|
|
665
|
+
onPresentationChanged(true);
|
|
666
|
+
});
|
|
667
|
+
dom.on('#ruleFilter #diffCollapse', 'click', ev => {
|
|
668
|
+
isCollapsed = dom.cl.toggle(ev.target, 'active');
|
|
669
|
+
onPresentationChanged(true);
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
// https://groups.google.com/forum/#!topic/codemirror/UQkTrt078Vs
|
|
673
|
+
mergeView.editor().on('updateDiff', ( ) => {
|
|
674
|
+
onTextChanged();
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
/******************************************************************************/
|
|
678
|
+
|