diff --git a/.gitignore b/.gitignore index d0ac0a00..6e468d46 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ output.md tests/dist browserstack.err local.log +.eslintcache diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 00000000..7c8933a5 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,13 @@ +{ + "ul-indent": { "indent": 4 }, + "line-length": { + "stern": true, + "line_length": 120 + }, + "no-multiple-blanks": { "maximum": 2 }, + "no-inline-html": { "allowed_elements": ["a"]}, + "no-duplicate-header": { "siblings_only": true }, + "no-blanks-blockquote": false, + "no-bare-urls": false, + "ul-style": { "style": "dash" } +} diff --git a/.markdownlintignore b/.markdownlintignore new file mode 100644 index 00000000..c2658d7d --- /dev/null +++ b/.markdownlintignore @@ -0,0 +1 @@ +node_modules/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 556ae261..e5978000 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- ability for `prevent-element-src-loading` scriptlet to prevent inline `onerror` and match `link` tag [#276](https://github.com/AdguardTeam/Scriptlets/issues/276) +- ability for `prevent-element-src-loading` scriptlet to prevent inline `onerror` + and match `link` tag [#276](https://github.com/AdguardTeam/Scriptlets/issues/276) - new special value modifiers for `set-constant` [#316](https://github.com/AdguardTeam/Scriptlets/issues/316) ### Changed @@ -166,15 +167,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Scriptlets: - - `prevent-element-src-loading` [#228](https://github.com/AdguardTeam/Scriptlets/issues/228) - - `prevent-fetch` [#216](https://github.com/AdguardTeam/Scriptlets/issues/216) - - `abort-on-stack-trace` [#201](https://github.com/AdguardTeam/Scriptlets/issues/201) - - `abort-current-inline-script` [#251](https://github.com/AdguardTeam/Scriptlets/issues/251) - - `set-cookie` & `set-cookie-reload` + - `prevent-element-src-loading` [#228](https://github.com/AdguardTeam/Scriptlets/issues/228) + - `prevent-fetch` [#216](https://github.com/AdguardTeam/Scriptlets/issues/216) + - `abort-on-stack-trace` [#201](https://github.com/AdguardTeam/Scriptlets/issues/201) + - `abort-current-inline-script` [#251](https://github.com/AdguardTeam/Scriptlets/issues/251) + - `set-cookie` & `set-cookie-reload` - Redirects: - - `google-ima3` [#255](https://github.com/AdguardTeam/Scriptlets/issues/255) - - `metrika-yandex-tag` [#254](https://github.com/AdguardTeam/Scriptlets/issues/254) - - `googlesyndication-adsbygoogle` [#252](https://github.com/AdguardTeam/Scriptlets/issues/252) + - `google-ima3` [#255](https://github.com/AdguardTeam/Scriptlets/issues/255) + - `metrika-yandex-tag` [#254](https://github.com/AdguardTeam/Scriptlets/issues/254) + - `googlesyndication-adsbygoogle` [#252](https://github.com/AdguardTeam/Scriptlets/issues/252) [Unreleased]: https://github.com/AdguardTeam/Scriptlets/compare/v1.9.7...HEAD diff --git a/README.md b/README.md index 98281211..18031196 100644 --- a/README.md +++ b/README.md @@ -2,86 +2,92 @@ AdGuard's Scriptlets and Redirect resources library which provides extended capabilities for content blocking. -* [Scriptlets](#scriptlets) - * [Syntax](#scriptlet-syntax) - * [Available scriptlets](https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#scriptlets) - * [Scriptlets compatibility table](https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/compatibility-table.md#scriptlets) - * [Trusted scriptlets](#trusted-scriptlets) - * [Restriction](#trusted-scriptlets-restriction) - * [Available trusted scriptlets](https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-trusted-scriptlets.md#trusted-scriptlets) -* [Redirect resources](#redirect-resources) - * [Syntax](#redirect-syntax) - * [Available redirect resources](https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-redirects.md#redirect-resources) - * [Redirect resources compatibility table](https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/compatibility-table.md#redirects) -* [How to build](#how-to-build) -* [How to test](#how-to-test) -* [How to update wiki](#how-to-update-wiki) -* [Browser compatibility](#browser-compatibility) -* [Projects using Scriptlets](#used-by) +- [Scriptlets](#scriptlets) + - [Syntax](#scriptlet-syntax) + - [Available scriptlets](./wiki/about-scriptlets.md#scriptlets) + - [Scriptlets compatibility table](./wiki/compatibility-table.md#scriptlets) + - [Trusted scriptlets](#trusted-scriptlets) + - [Restriction](#trusted-scriptlets-restriction) + - [Available trusted scriptlets](./wiki/about-trusted-scriptlets.md#trusted-scriptlets) +- [Redirect resources](#redirect-resources) + - [Syntax](#redirect-syntax) + - [Available redirect resources](./wiki/about-redirects.md#redirect-resources) + - [Redirect resources compatibility table](./wiki/compatibility-table.md#redirects) +- [How to build](#how-to-build) +- [How to test](#how-to-test) +- [How to update wiki](#how-to-update-wiki) +- [Browser compatibility](#browser-compatibility) +- [Projects using Scriptlets](#used-by) * * * + ## Scriptlets Scriptlet is a JavaScript function which can be used in a declarative manner in AdGuard filtering rules. -AdGuard supports a lot of different scriptlets. Please note, that in order to achieve cross-blocker compatibility, we also support syntax of uBO and ABP. +AdGuard supports a lot of different scriptlets. +Please note, that in order to achieve cross-blocker compatibility, we also support syntax of uBO and ABP. ### Syntax -``` +```text rule = [domains] "#%#//scriptlet(" scriptletName arguments ")" ``` -* `scriptletName` (mandatory) is a name of the scriptlet from AdGuard's scriptlets library -* `arguments` (optional) a list of `String` arguments (no other types of arguments are supported) +- `scriptletName` (mandatory) is a name of the scriptlet from AdGuard's scriptlets library +- `arguments` (optional) a list of `String` arguments (no other types of arguments are supported) > **Remarks** > -> * The meaning of the arguments depends on the scriptlet. +> - The meaning of the arguments depends on the scriptlet. > -> * Special characters in scriptlet argument must be escaped properly: -> * valid: -> * `'prop["nested"]'` -> * `"prop['nested']"` -> * `'prop[\'nested\']'` -> * `"prop[\"nested\"]"` -> * not valid: -> * `'prop['nested']'` -> * `"prop["nested"]"` +> - Special characters in scriptlet argument must be escaped properly: +> - valid: +> - `'prop["nested"]'` +> - `"prop['nested']"` +> - `'prop[\'nested\']'` +> - `"prop[\"nested\"]"` +> - not valid: +> - `'prop['nested']'` +> - `"prop["nested"]"` > -> * You can use either single or double quotes for the scriptlet name and arguments. +> - You can use either single or double quotes for the scriptlet name and arguments. > Single quote is recommended but not for cases when its usage makes readability worse, > e.g. `".css('display','block');"` is more preferred then `'.css(\'display\',\'block\');'`. -**Example** +#### Example -``` +```adblock example.org#%#//scriptlet('abort-on-property-read', 'alert') example.org#%#//scriptlet('remove-class', 'branding', 'div[class^="inner"]') ``` -This rule applies the `abort-on-property-read` scriptlet on all pages of `example.org` and its subdomains, and passes one argument to it (`alert`). +This rule applies the `abort-on-property-read` scriptlet on all pages of `example.org` and its subdomains, +and passes one argument to it (`alert`). -* **[Scriptlets list](https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#scriptlets)** -* **[Scriptlets compatibility table](https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/compatibility-table.md#scriptlets)** +- **[Scriptlets list](./wiki/about-scriptlets.md#scriptlets)** +- **[Scriptlets compatibility table](./wiki/compatibility-table.md#scriptlets)** ### Trusted scriptlets -Trusted scriptlets are scriptlets with extended functionality. Their names are prefixed with `trusted-`, e.g `trusted-click-element`, to be easily distinguished from common scriptlets. +Trusted scriptlets are scriptlets with extended functionality. +Their names are prefixed with `trusted-`, e.g `trusted-click-element`, +to be easily distinguished from common scriptlets. #### Restriction Trusted scriptlets application must be restricted due to dangerous nature of their capabilities. Allowed sources of trusted scriptlets are: -* filters created by AdGuard Team, -* custom filters which were installed as `trusted`, -* user rules. + +- filters created by AdGuard Team, +- custom filters which were installed as `trusted`, +- user rules. > Trusted scriptlets has no compatibility table as they are not compatible with any other blocker. -**[Trusted scriptlets list](https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-trusted-scriptlets.md#trusted-scriptlets)** +**[Trusted scriptlets list](./wiki/about-trusted-scriptlets.md#trusted-scriptlets)** ## Redirect resources @@ -90,52 +96,72 @@ AdGuard is able to redirect web requests to a local "resource". ### Syntax -AdGuard uses the same filtering rule syntax as [uBlock Origin](https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#redirect). Also, it is compatible with ABP `$rewrite=abp-resource` modifier. +AdGuard uses the same filtering rule syntax +as [uBlock Origin](https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#redirect). +Also, it is compatible with ABP `$rewrite=abp-resource` modifier. + +`$redirect` is a modifier for +[the basic filtering rules](https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#basic-rules-syntax) +so rules with this modifier support all other basic modifiers like `$domain`, `$third-party`, `$script`, etc. -`$redirect` is a modifier for [the basic filtering rules](https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#basic-rules-syntax) so rules with this modifier support all other basic modifiers like `$domain`, `$third-party`, `$script`, etc. +The value of the `$redirect` modifier must be the name of the resource that will be used for redirection. +See the list of [available redirect resources](./wiki/about-redirects.md#redirect-resources). -The value of the `$redirect` modifier must be the name of the resource, that will be used for redirection. See the list of resources [below](#available-resources). +### Examples -**Examples** -* `||example.org/script.js$script,redirect=noopjs` — redirects all requests to `script.js` to the resource named `noopjs`. -* `||example.org/test.mp4$media,redirect=noopmp4-1s` — requests to `example.org/test.mp4` will be redirected to the resource named `noopmp4-1s`. +- `||example.org/script.js$script,redirect=noopjs` — redirects all requests to `script.js` + to the resource named `noopjs`. +- `||example.org/test.mp4$media,redirect=noopmp4-1s` — requests to `example.org/test.mp4` will be redirected + to the resource named `noopmp4-1s`. -> `$redirect` rules priority is higher than the regular basic blocking rules' priority. This means that if there's a basic blocking rule (even with `$important` modifier), `$redirect` rule will prevail over it. If there's a whitelist (`@@`) rule matching the same URL, it will disable redirecting as well (unless the `$redirect` rule is also marked as `$important`). +> `$redirect` rules priority is higher than the regular basic blocking rules' priority. +> This means that if there's a basic blocking rule (even with `$important` modifier), +> `$redirect` rule will prevail over it. +> If there's a whitelist (`@@`) rule matching the same URL, +> it will disable redirecting as well (unless the `$redirect` rule is also marked as `$important`). -> uBlock Origin specifies additional resource name `none` that can disable other redirect rules. AdGuard does not support it, use `$badfilter` to disable specific rules. +> uBlock Origin specifies additional resource name `none` that can disable other redirect rules. +> AdGuard does not support it, use `$badfilter` to disable specific rules. -* **[Redirect resources list](https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-redirects.md#redirect-resources)** -* **[Redirect resources compatibility table](https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/compatibility-table.md#redirects)** +- **[Redirect resources list](./wiki/about-redirects.md#redirect-resources)** +- **[Redirect resources compatibility table](./wiki/compatibility-table.md#redirects)** * * * ## How to build -Install dependencies -``` +Install dependencies: + +```bash yarn install ``` -Build for CoreLibs -``` +Build for CoreLibs: + +```bash yarn corelibs ``` -Build dev (rebuild js files on every change) -``` +Build dev (rebuild js files on every change): + +```bash yarn watch ``` ### Build for Extension + In scriptlets directory install dependencies, build scriptlets bundle, and create scriptlets link. -``` + +```bash yarn yarn build yarn link ``` -In tsurlfilter directory install and link dependencies, link scriptlets, move into package and build, and create tsurlfilter link. -``` +In tsurlfilter directory install and link dependencies, link scriptlets, +move into package and build, and create tsurlfilter link. + +```bash lerna bootstrap yarn link "@adguard/scriptlets" @@ -144,8 +170,10 @@ cd ./packages/tsurlfilter yarn build yarn link ``` + In extension directory install dependencies, link packages and build -``` + +``` bash yarn yarn link @adguard/scriptlets @@ -158,7 +186,8 @@ yarn dev #### Scriptlets library -You are welcome to use scriptlets and redirect resources as a CJS module. They can be imported from `dist/cjs/scriptlets.cjs.js`: +You are welcome to use scriptlets and redirect resources as a CJS module. +They can be imported from `dist/cjs/scriptlets.cjs.js`: ```javascript const scriptlets = require('scriptlets'); @@ -166,7 +195,8 @@ const { redirects } = require('scriptlets'); ``` -And also there is a module at `dist/scriptlets.js` which has been exported to a global variable `scriptlets` with such methods: +And also there is a module at `dist/scriptlets.js` +which has been exported to a global variable `scriptlets` with such methods: ```javascript /** @@ -179,7 +209,9 @@ And also there is a module at `dist/scriptlets.js` which has been exported to a */ scriptlets.invoke(source); ``` + where: + ```javascript /** * @typedef {Object} Source — Scriptlet properties. @@ -250,6 +282,7 @@ scriptlets.isAbpSnippetRule(rule); */ scriptlets.convertUboToAdg(rule); ``` + > Note that parameters in UBO rule should be separated by comma + space. Otherwise, the rule is not valid. ```javascript @@ -284,7 +317,7 @@ scriptlets.convertAdgToUbo(rule); ``` -##### Imported `redirects` has such methods: +##### Imported `redirects` methods ```javascript /** @@ -397,7 +430,8 @@ redirects.getRedirectFilename(name); `dist/scriptlets.corelibs.json` File example -``` + +```json { "version": "1.0.0", "scriptlets": [ @@ -413,8 +447,9 @@ File example } ``` -Schema -``` +Schema: + +```json { "type": "object", "properties": { @@ -443,7 +478,8 @@ Schema ``` #### Redirects library -``` + +```text dist/redirects.js dist/redirects.yml ``` @@ -479,6 +515,7 @@ const isBlocking = redirect.isBlocking('click2load.html'); */ ``` + ## How to test Some tests are run in QUnit, some in Jest. @@ -513,7 +550,8 @@ yarn test yarn jest ``` - or limit the testing — `testRegex` may be specified in `jest.config.js` or specify [test name](https://jestjs.io/docs/cli#--testnamepatternregex) in command line, e.g.: + or limit the testing — `testRegex` may be specified in `jest.config.js` + or specify [test name](https://jestjs.io/docs/cli#--testnamepatternregex) in command line, e.g.: ```bash yarn jest -t isValidScriptletRule @@ -521,9 +559,10 @@ yarn test To run browserstack tests create `.env` file or copy and rename `.env-example`. -Fill in and with data from your Browserstack profile. -Run next command -``` +Fill in `` and `` with data from your Browserstack profile. +Run next command: + +```bash yarn browserstack ``` @@ -532,18 +571,27 @@ Tests run by `jest` should be named `.spec.js`, so they will be not included in ### Debugging Use `debugger;` statement where you need it, run -``` + +```bash yarn test ``` + and open needed HTML file from `tests/dist` in your browser with devtools + ## How to update wiki There are two scripts to update wiki: -1. `yarn wiki:build-table` — checks compatibility data updates and updates the compatibility table. Should be run manually while the release preparation. -2. `yarn wiki:build-docs` — updates wiki pages `about-scriptlets.md` and `about-redirects.md`. They are being generated from JSDoc-type comments of corresponding scriptlets and redirects source files due to `@scriptlet`/`@redirect` and `@description` tags. Runs automatically while the release build. + +1. `yarn wiki:build-table` — checks compatibility data updates and updates the compatibility table. + Should be run manually while the release preparation. +2. `yarn wiki:build-docs` — updates wiki pages `about-scriptlets.md` and `about-redirects.md`. + They are being generated from JSDoc-type comments of corresponding scriptlets and redirects source files + due to `@scriptlet`/`@redirect` and `@description` tags. Runs automatically while the release build. + ## Browser Compatibility + | Browser | Version | |-----------------------|:----------| | Chrome | ✅ 55 | @@ -553,10 +601,15 @@ There are two scripts to update wiki: | Safari | ✅ 11 | | Internet Explorer | ❌ | + ## Projects using Scriptlets -* [CoreLibs](https://github.com/AdguardTeam/CoreLibs) (updates automatically) -* [TSUrlFilter](https://github.com/AdguardTeam/tsurlfilter) -* [FiltersCompiler](https://github.com/AdguardTeam/FiltersCompiler) (`tsurlfilter`'s update might be required as well) -* [AdguardBrowserExtension](https://github.com/AdguardTeam/AdguardBrowserExtension) (`tsurlfilter` also should be updated) -* [AdguardForSafari](https://github.com/AdguardTeam/AdGuardForSafari) (`adguard-resources` should be updated) -* [AdguardForiOS](https://github.com/AdguardTeam/AdguardForiOS) (`tsurlfilter` should be updated in `advanced-adblocker-web-extension`) + +- [CoreLibs](https://github.com/AdguardTeam/CoreLibs) (updates automatically) +- [TSUrlFilter](https://github.com/AdguardTeam/tsurlfilter) +- [FiltersCompiler](https://github.com/AdguardTeam/FiltersCompiler) + (`tsurlfilter`'s update might be required as well) +- [AdguardBrowserExtension](https://github.com/AdguardTeam/AdguardBrowserExtension) + (`tsurlfilter` also should be updated) +- [AdguardForSafari](https://github.com/AdguardTeam/AdGuardForSafari) (`adguard-resources` should be updated) +- [AdguardForiOS](https://github.com/AdguardTeam/AdguardForiOS) + (`tsurlfilter` should be updated in `advanced-adblocker-web-extension`) diff --git a/bamboo-specs/test.yaml b/bamboo-specs/test.yaml index 37eae877..346f854a 100644 --- a/bamboo-specs/test.yaml +++ b/bamboo-specs/test.yaml @@ -32,8 +32,21 @@ Build: ls -alt yarn install + + # check compatibility table updates and build it + yarn wiki:build-table + # build other wiki docs + yarn wiki:build-docs + + # lint docs + yarn lint:md + yarn test yarn build + + # lint code. it should be run after yarn build + yarn lint + rm -rf node_modules artifacts: - name: scriptlets.corelibs.json diff --git a/package.json b/package.json index 01d0ef8b..c8a53e19 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "browserstack": "yarn test --build && node browserstack.js", "test:qunit": "babel-node scripts/test.js", "test:jest": "jest", - "lint": "eslint .", + "lint": "eslint --cache . && yarn lint:md", + "lint:md": "markdownlint .", "lint-staged": "lint-staged", "prepare": "husky install", "wiki:build-table": "node ./scripts/check-sources-updates.js && node ./scripts/build-compatibility-table.js", @@ -74,6 +75,8 @@ "js-reporters": "^2.1.0", "kleur": "^4.1.4", "lint-staged": "^12.1.2", + "markdownlint": "^0.28.2", + "markdownlint-cli": "^0.34.0", "node-qunit-puppeteer": "2.1.1", "openurl": "^1.1.1", "qunit": "^2.9.3", diff --git a/scripts/build-compatibility-table.js b/scripts/build-compatibility-table.js index 9fb98825..4916b56e 100644 --- a/scripts/build-compatibility-table.js +++ b/scripts/build-compatibility-table.js @@ -84,7 +84,7 @@ const getTableHeader = () => { */ const buildTable = (title, data = [], id = '') => { // title - let res = `# ${title}${EOL}${EOL}`; + let res = `## ${title}${EOL}${EOL}`; // header res += getTableHeader(); // rows @@ -122,7 +122,11 @@ const buildCompatibilityTable = () => { 'redirects', ); - saveTables(scriptletsTable, redirectsTable); + let header = `# Scriplets and Redirects compatibility tables${EOL}${EOL}`; + header += `- [Scriptlets](#scriptlets)${EOL}`; + header += `- [Redirects](#redirects)${EOL}`; + + saveTables(header, scriptletsTable, redirectsTable); }; buildCompatibilityTable(); diff --git a/scripts/build-docs.js b/scripts/build-docs.js index 699f68cc..07a2fa10 100644 --- a/scripts/build-docs.js +++ b/scripts/build-docs.js @@ -107,13 +107,13 @@ const getMarkdownData = (dataItems) => { source, }) => { // low case name should be used as an anchor in the table of content - acc.list.push(`* [${name}](#${name.toLowerCase()})${EOL}`); + acc.list.push(`- [${name}](#${name.toLowerCase()})${EOL}`); const typeOfSrc = type.toLowerCase().includes('scriptlet') ? 'Scriptlet' : 'Redirect'; // 1. Low case name should be used as an anchor // 2. There is no EOL after 'version' string because `description` starts with `\n` - const body = `### ⚡️ ${name}${EOL} + const body = `## ⚡️ ${name}${EOL} ${versionAdded ? `> Added in ${versionAdded}` : '> Adding version is unknown.'} ${description}${EOL} [${typeOfSrc} source](${source})${EOL} @@ -149,9 +149,9 @@ const getMarkdownDataForStaticRedirects = () => { throw new Error(`No added version for static redirect '${title}'`); } - acc.list.push(`* [${title}](#${title})${EOL}`); + acc.list.push(`- [${title}](#${title})${EOL}`); - const body = `### ⚡️ ${title}${EOL} + const body = `## ⚡️ ${title}${EOL} ${added ? `> Added in ${added}.` : '> Adding version is unknown.'}${EOL} ${description}${EOL} [Redirect source](${STATIC_REDIRECTS_RELATIVE_SOURCE})${EOL} @@ -191,9 +191,9 @@ const getMarkdownDataForBlockingRedirects = () => { throw new Error(`No added version for blocking redirect '${title}'`); } - acc.list.push(`* [${title}](#${title})${EOL}`); + acc.list.push(`- [${title}](#${title})${EOL}`); - const body = `### ⚡️ ${title}${EOL} + const body = `## ⚡️ ${title}${EOL} ${added ? `> Added in ${added}.` : '> Adding version is unknown.'}${EOL} ${description}${EOL} [Redirect source](${BLOCKING_REDIRECTS_RELATIVE_SOURCE}/${title})${EOL} @@ -223,8 +223,8 @@ const buildWikiAboutPages = () => { const staticRedirectsMarkdownData = getMarkdownDataForStaticRedirects(); const blockingRedirectsMarkdownData = getMarkdownDataForBlockingRedirects(); - const scriptletsPageContent = `## Available Scriptlets${EOL} -${scriptletsMarkdownData.list}* * *${EOL} + const scriptletsPageContent = `# Available Scriptlets${EOL} +${scriptletsMarkdownData.list}${EOL}* * *${EOL} ${scriptletsMarkdownData.body}`; fs.writeFileSync( path.resolve(__dirname, aboutScriptletsPath), @@ -232,8 +232,8 @@ ${scriptletsMarkdownData.body}`; ); // eslint-disable-next-line max-len - const trustedScriptletsPageContent = `## Available Trusted Scriptlets -${trustedScriptletsMarkdownData.list}* * * + const trustedScriptletsPageContent = `# Available Trusted Scriptlets${EOL} +${trustedScriptletsMarkdownData.list}${EOL}* * *${EOL} ${trustedScriptletsMarkdownData.body}`; fs.writeFileSync( path.resolve(__dirname, aboutTrustedScriptletsPath), @@ -241,8 +241,8 @@ ${trustedScriptletsMarkdownData.body}`; ); /* eslint-disable max-len */ - const redirectsPageContent = `## Available Redirect resources -${staticRedirectsMarkdownData.list}${redirectsMarkdownData.list}${blockingRedirectsMarkdownData.list}* * * + const redirectsPageContent = `# Available Redirect resources${EOL} +${staticRedirectsMarkdownData.list}${redirectsMarkdownData.list}${blockingRedirectsMarkdownData.list}${EOL}* * *${EOL} ${staticRedirectsMarkdownData.body}${redirectsMarkdownData.body}${blockingRedirectsMarkdownData.body}`; /* eslint-enable max-len */ fs.writeFileSync( diff --git a/scripts/compatibility-table.json b/scripts/compatibility-table.json index 0dc860e1..63cd7ba3 100644 --- a/scripts/compatibility-table.json +++ b/scripts/compatibility-table.json @@ -41,8 +41,7 @@ "adg": "debug-on-property-write" }, { - "adg": "dir-string", - "abp": "dir-string" + "adg": "dir-string" }, { "adg": "disable-newtab-links", diff --git a/src/redirects/amazon-apstag.js b/src/redirects/amazon-apstag.js index 9869fce6..9c981549 100644 --- a/src/redirects/amazon-apstag.js +++ b/src/redirects/amazon-apstag.js @@ -7,10 +7,11 @@ import { hit, noopFunc } from '../helpers/index'; * Mocks Amazon's apstag.js * * Related UBO redirect resource: - * https://github.com/gorhill/uBlock/blob/f842ab6d3c1cf0394f95d27092bf59627262da40/src/web_accessible_resources/amazon_apstag.js + * https://github.com/gorhill/uBlock/blob/master/src/web_accessible_resources/amazon_apstag.js * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||amazon-adsystem.com/aax2/apstag.js$script,redirect=amazon-apstag * ``` * diff --git a/src/redirects/ati-smarttag.js b/src/redirects/ati-smarttag.js index 99383725..d904d1af 100644 --- a/src/redirects/ati-smarttag.js +++ b/src/redirects/ati-smarttag.js @@ -7,9 +7,10 @@ import { hit, noopFunc } from '../helpers/index'; * Mocks AT Internat SmartTag. * https://developers.atinternet-solutions.com/as2-tagging-en/javascript-en/getting-started-javascript-en/tracker-initialisation-javascript-en/ * - * **Example** - * ``` - * ||bloctel.gouv.fr/assets/scripts/smarttag.js$script,redirect=ati-smarttag + * ### Examples + * + * ```adblock + * ||example.com/assets/scripts/smarttag.js$script,redirect=ati-smarttag * ``` * * @added v1.5.0. diff --git a/src/redirects/blocking-redirects.yml b/src/redirects/blocking-redirects.yml index 9dfc4f62..301a7177 100644 --- a/src/redirects/blocking-redirects.yml +++ b/src/redirects/blocking-redirects.yml @@ -11,9 +11,9 @@ Related UBO redirect resource: https://github.com/gorhill/uBlock/blob/1.31.0/src/web_accessible_resources/click2load.html - **Example** + ### Example - ``` + ```adblock ||youtube.com/embed/$frame,third-party,redirect=click2load.html ``` aliases: diff --git a/src/redirects/didomi-loader.js b/src/redirects/didomi-loader.js index 2ba9a60f..5cec43ea 100644 --- a/src/redirects/didomi-loader.js +++ b/src/redirects/didomi-loader.js @@ -14,8 +14,9 @@ import { * Mocks Didomi's CMP loader script. * https://developers.didomi.io/ * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||sdk.privacy-center.org/fbf86806f86e/loader.js$script,redirect=didomi-loader * ``` * diff --git a/src/redirects/fingerprintjs2.js b/src/redirects/fingerprintjs2.js index 258dd7b2..4893cac7 100644 --- a/src/redirects/fingerprintjs2.js +++ b/src/redirects/fingerprintjs2.js @@ -11,9 +11,10 @@ import { hit } from '../helpers/index'; * Related UBO redirect resource: * https://github.com/gorhill/uBlock/blob/master/src/web_accessible_resources/fingerprint2.js * - * **Example** - * ``` - * ||the-japan-news.com/modules/js/lib/fgp/fingerprint2.js$script,redirect=fingerprintjs2 + * ### Examples + * + * ```adblock + * ||example.com/modules/js/lib/fgp/fingerprint2.js$script,redirect=fingerprintjs2 * ``` * * @added v1.5.0. diff --git a/src/redirects/fingerprintjs3.js b/src/redirects/fingerprintjs3.js index 22a25fbd..1955d280 100644 --- a/src/redirects/fingerprintjs3.js +++ b/src/redirects/fingerprintjs3.js @@ -14,9 +14,10 @@ import { * Related UBO redirect resource: * https://github.com/gorhill/uBlock/blob/master/src/web_accessible_resources/fingerprint3.js * - * **Example** - * ``` - * ||sephora.com/js/ufe/isomorphic/thirdparty/fp.min.js$script,redirect=fingerprintjs3 + * ### Examples + * + * ```adblock + * ||example.com/js/ufe/isomorphic/thirdparty/fp.min.js$script,redirect=fingerprintjs3 * ``` * * @added v1.6.2. diff --git a/src/redirects/gemius.js b/src/redirects/gemius.js index 7c6ce9b2..81891d24 100644 --- a/src/redirects/gemius.js +++ b/src/redirects/gemius.js @@ -8,9 +8,10 @@ import { hit, noopFunc } from '../helpers/index'; * Mocks Gemius Analytics. * https://flowplayer.com/developers/plugins/gemius * - * **Example** - * ``` - * ||gapt.hit.gemius.pl/gplayer.js$script,redirect=gemius + * ### Examples + * + * ```adblock + * ||example.org/gplayer.js$script,redirect=gemius * ``` * * @added v1.5.0. diff --git a/src/redirects/google-analytics-ga.js b/src/redirects/google-analytics-ga.js index 0ea8fb61..83602a91 100644 --- a/src/redirects/google-analytics-ga.js +++ b/src/redirects/google-analytics-ga.js @@ -12,10 +12,11 @@ import { * Mocks old Google Analytics API. * * Related UBO redirect resource: - * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/google-analytics_ga.js + * https://github.com/gorhill/uBlock/blob/master/src/web_accessible_resources/google-analytics_ga.js * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||google-analytics.com/ga.js$script,redirect=google-analytics-ga * ``` * diff --git a/src/redirects/google-analytics.js b/src/redirects/google-analytics.js index d1590d6c..440c77e0 100644 --- a/src/redirects/google-analytics.js +++ b/src/redirects/google-analytics.js @@ -10,15 +10,17 @@ import { * * @description * Mocks Google's Analytics and Tag Manager APIs. - * [Covers obsolete googletagmanager-gtm redirect functionality](https://github.com/AdguardTeam/Scriptlets/issues/127). + * Covers functionality of + * the [obsolete googletagmanager-gtm redirect](https://github.com/AdguardTeam/Scriptlets/issues/127). * * Related UBO redirect resource: - * https://github.com/gorhill/uBlock/blob/8cd2a1d263a96421487b39040c1d23eb01169484/src/web_accessible_resources/google-analytics_analytics.js + * https://github.com/gorhill/uBlock/blob/master/src/web_accessible_resources/google-analytics_analytics.js * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||google-analytics.com/analytics.js$script,redirect=google-analytics - * ||googletagmanager.com/gtm.js$script,redirect=googletagmanager-gtm + * ||googletagmanager.com/gtm.js$script,redirect=google-analytics * ``` * * @added v1.0.10. diff --git a/src/redirects/google-ima3.js b/src/redirects/google-ima3.js index fd8a2bdf..65ae149c 100644 --- a/src/redirects/google-ima3.js +++ b/src/redirects/google-ima3.js @@ -11,8 +11,9 @@ import { * @description * Mocks the IMA SDK of Google. * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||imasdk.googleapis.com/js/sdkloader/ima3.js$script,redirect=google-ima3 * ``` * diff --git a/src/redirects/googlesyndication-adsbygoogle.js b/src/redirects/googlesyndication-adsbygoogle.js index f04941b6..24892d8c 100644 --- a/src/redirects/googlesyndication-adsbygoogle.js +++ b/src/redirects/googlesyndication-adsbygoogle.js @@ -8,10 +8,11 @@ import { hit } from '../helpers/index'; * Mocks Google AdSense API. * * Related UBO redirect resource: - * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googlesyndication_adsbygoogle.js + * https://github.com/gorhill/uBlock/blob/master/src/web_accessible_resources/googlesyndication_adsbygoogle.js * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||pagead2.googlesyndication.com/pagead/js/adsbygoogle.js$script,redirect=googlesyndication-adsbygoogle * ``` * diff --git a/src/redirects/googletagservices-gpt.js b/src/redirects/googletagservices-gpt.js index e9f4861a..f30d2c15 100644 --- a/src/redirects/googletagservices-gpt.js +++ b/src/redirects/googletagservices-gpt.js @@ -16,10 +16,11 @@ import { * Mocks Google Publisher Tag API. * * Related UBO redirect resource: - * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googletagservices_gpt.js + * https://github.com/gorhill/uBlock/blob/master/src/web_accessible_resources/googletagservices_gpt.js * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||googletagservices.com/tag/js/gpt.js$script,redirect=googletagservices-gpt * ``` * diff --git a/src/redirects/matomo.js b/src/redirects/matomo.js index 8a51ea93..c6de4184 100644 --- a/src/redirects/matomo.js +++ b/src/redirects/matomo.js @@ -7,8 +7,9 @@ import { hit, noopFunc } from '../helpers/index'; * @description * Mocks the piwik.js file of Matomo (formerly Piwik). * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||example.org/piwik.js$script,redirect=matomo * ``` * diff --git a/src/redirects/metrika-yandex-tag.js b/src/redirects/metrika-yandex-tag.js index 3ddeab3c..0b7e7825 100644 --- a/src/redirects/metrika-yandex-tag.js +++ b/src/redirects/metrika-yandex-tag.js @@ -7,8 +7,9 @@ import { hit, noopFunc } from '../helpers/index'; * Mocks Yandex Metrika API. * https://yandex.ru/support/metrica/objects/method-reference.html * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||mc.yandex.ru/metrika/tag.js$script,redirect=metrika-yandex-tag * ``` * diff --git a/src/redirects/metrika-yandex-watch.js b/src/redirects/metrika-yandex-watch.js index 10caacc6..2d10d850 100644 --- a/src/redirects/metrika-yandex-watch.js +++ b/src/redirects/metrika-yandex-watch.js @@ -7,8 +7,9 @@ import { hit, noopFunc, noopArray } from '../helpers/index'; * Mocks the old Yandex Metrika API. * https://yandex.ru/support/metrica/objects/_method-reference.html * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||mc.yandex.ru/metrika/watch.js$script,redirect=metrika-yandex-watch * ``` * diff --git a/src/redirects/naver-wcslog.js b/src/redirects/naver-wcslog.js index df75e0b6..ad443ccf 100644 --- a/src/redirects/naver-wcslog.js +++ b/src/redirects/naver-wcslog.js @@ -7,8 +7,9 @@ import { hit, noopFunc } from '../helpers/index'; * @description * Mocks wcslog.js of Naver Analytics. * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||wcs.naver.net/wcslog.js$script,redirect=naver-wcslog * ``` * diff --git a/src/redirects/noeval.js b/src/redirects/noeval.js index b449582e..4bd28b35 100644 --- a/src/redirects/noeval.js +++ b/src/redirects/noeval.js @@ -15,8 +15,9 @@ import { noeval } from '../scriptlets/noeval'; * Related UBO redirect resource: * https://github.com/gorhill/uBlock/wiki/Resources-Library#noeval-silentjs- * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||example.org/index.js$script,redirect=noeval * ``` * diff --git a/src/redirects/pardot-1.0.js b/src/redirects/pardot-1.0.js index 426429e7..48720797 100644 --- a/src/redirects/pardot-1.0.js +++ b/src/redirects/pardot-1.0.js @@ -14,8 +14,9 @@ import { * https://pi.pardot.com/pd.js * https://developer.salesforce.com/docs/marketing/pardot/overview * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||pi.pardot.com/pd.js$script,redirect=pardot * ||pacedg.com.au/pd.js$redirect=pardot * ``` diff --git a/src/redirects/prebid-ads.js b/src/redirects/prebid-ads.js index 19483cc2..d79a9548 100644 --- a/src/redirects/prebid-ads.js +++ b/src/redirects/prebid-ads.js @@ -6,12 +6,14 @@ import { hit } from '../helpers/index'; * * @description * Sets predefined constants on a page: + * * - `canRunAds`: `true` * - `isAdBlockActive`: `false` * - * **Example** - * ``` - * ||playerdrive.me/assets/js/prebid-ads.js$script,redirect=prebid-ads + * ### Examples + * + * ```adblock + * ||example.org/assets/js/prebid-ads.js$script,redirect=prebid-ads * ``` * * @added v1.6.2. diff --git a/src/redirects/prebid.js b/src/redirects/prebid.js index 911aa806..18294473 100644 --- a/src/redirects/prebid.js +++ b/src/redirects/prebid.js @@ -13,9 +13,10 @@ import { * Mocks the prebid.js header bidding suit. * https://docs.prebid.org/ * - * **Example** - * ``` - * ||tmgrup.com.tr/bd/hb/prebid.js$script,redirect=prebid + * ### Examples + * + * ```adblock + * ||example.org/bd/hb/prebid.js$script,redirect=prebid * ``` * * @added v1.6.2. diff --git a/src/redirects/prevent-bab.js b/src/redirects/prevent-bab.js index 3a76f087..20ac99a9 100644 --- a/src/redirects/prevent-bab.js +++ b/src/redirects/prevent-bab.js @@ -10,10 +10,11 @@ import { preventBab as preventBabScriptlet } from '../scriptlets/prevent-bab'; * See [scriptlet description](../wiki/about-scriptlets.md#prevent-bab). * * Related UBO redirect resource: - * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/nobab.js + * https://github.com/gorhill/uBlock/blob/master/src/web_accessible_resources/nobab.js * - * **Example** - * ``` + * ### Examples + * + * ```adblock * /blockadblock.$script,redirect=prevent-bab * ``` * diff --git a/src/redirects/prevent-bab2.js b/src/redirects/prevent-bab2.js index 674d9f15..550516ec 100644 --- a/src/redirects/prevent-bab2.js +++ b/src/redirects/prevent-bab2.js @@ -12,8 +12,9 @@ import { hit } from '../helpers/index'; * * See [redirect description](../wiki/about-redirects.md#prevent-bab2). * - * **Syntax** - * ``` + * ### Examples + * + * ```adblock * /blockadblock.$script,redirect=prevent-bab2 * ``` * diff --git a/src/redirects/prevent-fab-3.2.0.js b/src/redirects/prevent-fab-3.2.0.js index 04f86983..801ea8cc 100644 --- a/src/redirects/prevent-fab-3.2.0.js +++ b/src/redirects/prevent-fab-3.2.0.js @@ -6,8 +6,9 @@ import { preventFab } from '../scriptlets/prevent-fab-3.2.0'; * @description * Redirects fuckadblock script to the source js file. * - * **Example** - * ``` + * ### Examples + * + * ```adblock * \*\/fuckadblock-$script,redirect=prevent-fab-3.2.0 * ``` * diff --git a/src/redirects/prevent-popads-net.js b/src/redirects/prevent-popads-net.js index 54f0b8bf..eb01fd76 100644 --- a/src/redirects/prevent-popads-net.js +++ b/src/redirects/prevent-popads-net.js @@ -6,8 +6,9 @@ import { preventPopadsNet } from '../scriptlets/prevent-popads-net'; * @description * Redirects request to the source which sets static properties to PopAds and popns objects. * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||popads.net/pop.js$script,redirect=prevent-popads-net * ``` * diff --git a/src/redirects/scorecardresearch-beacon.js b/src/redirects/scorecardresearch-beacon.js index 1644a1cd..93f5874d 100644 --- a/src/redirects/scorecardresearch-beacon.js +++ b/src/redirects/scorecardresearch-beacon.js @@ -7,10 +7,11 @@ import { hit } from '../helpers/index'; * Mocks Scorecard Research API. * * Related UBO redirect resource: - * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/scorecardresearch_beacon.js + * https://github.com/gorhill/uBlock/blob/master/src/web_accessible_resources/scorecardresearch_beacon.js * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||sb.scorecardresearch.com/beacon.js$script,redirect=scorecardresearch-beacon * ``` * diff --git a/src/redirects/set-popads-dummy.js b/src/redirects/set-popads-dummy.js index ca7e0349..283729cc 100644 --- a/src/redirects/set-popads-dummy.js +++ b/src/redirects/set-popads-dummy.js @@ -6,8 +6,9 @@ import { setPopadsDummy } from '../scriptlets/set-popads-dummy'; * @description * Redirects request to the source which sets static properties to PopAds and popns objects. * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ||popads.net^$script,redirect=set-popads-dummy,domain=example.org * ``` * diff --git a/src/redirects/static-redirects.yml b/src/redirects/static-redirects.yml index 300b0490..eeb41b20 100644 --- a/src/redirects/static-redirects.yml +++ b/src/redirects/static-redirects.yml @@ -5,9 +5,9 @@ - title: 1x1-transparent.gif added: v1.0.4 description: |- - **Example** + ### Examples - ``` + ```adblock ||example.org^$image,redirect=1x1-transparent.gif ``` aliases: @@ -21,9 +21,9 @@ - title: 2x2-transparent.png added: v1.0.4 description: |- - **Example** + ### Examples - ``` + ```adblock ||example.org^$image,redirect=2x2-transparent.png ``` aliases: @@ -38,9 +38,9 @@ - title: 3x2-transparent.png added: v1.0.4 description: |- - **Example** + ### Examples - ``` + ```adblock ||example.org^$image,redirect=3x2-transparent.png ``` aliases: @@ -55,9 +55,9 @@ - title: 32x32-transparent.png added: v1.0.4 description: |- - **Example** + ### Examples - ``` + ```adblock ||example.org^$image,redirect=32x32-transparent.png ``` aliases: @@ -72,9 +72,9 @@ - title: noopframe added: v1.0.4 description: |- - **Example** + ### Examples - ``` + ```adblock ||example.com^$subdocument,redirect=noopframe,domain=example.org ``` aliases: @@ -92,9 +92,9 @@ - title: noopcss added: v1.0.4 description: |- - **Example** + ### Examples - ``` + ```adblock ||example.org/style.css$stylesheet,redirect=noopcss ``` aliases: @@ -107,8 +107,9 @@ - title: noopjs added: v1.0.4 description: |- - **Example** - ``` + ### Examples + + ```adblock ||example.org/advert.js$script,redirect=noopjs ``` aliases: @@ -121,8 +122,9 @@ - title: noopjson added: v1.6.2 description: |- - **Example** - ``` + ### Examples + + ```adblock ||example.org/geo/location$xmlhttprequest,redirect=noopjson ``` file: noopjson.json @@ -132,9 +134,9 @@ - title: nooptext added: v1.0.4 description: |- - **Example** + ### Examples - ``` + ```adblock ||example.org/advert.js$xmlhttprequest,redirect=nooptext ``` aliases: @@ -147,10 +149,12 @@ - title: empty added: v1.3.9 description: |- - Pretty much the same as `nooptext`. Used for conversion of modifier `empty` so better avoid its using in production filter lists. + Pretty much the same as `nooptext`. Used for conversion of modifier `empty` + so better avoid its using in prod versions of filter lists. - **Example** - ``` + ### Examples + + ```adblock ||example.org/log$redirect=empty ``` aliases: @@ -164,9 +168,9 @@ description: |- Redirects request to an empty VMAP response. - **Example** + ### Examples - ``` + ```adblock ||example.org/vmap01.xml$xmlhttprequest,redirect=noopvmap-1.0 ``` aliases: @@ -180,8 +184,9 @@ description: |- Redirects request to an empty VAST 2.0 response. - **Example** - ``` + ### Examples + + ```adblock ||example.org/vast02.xml^$xmlhttprequest,redirect=noopvast-2.0 ``` file: noopvast02.xml @@ -193,8 +198,9 @@ description: |- Redirects request to an empty VAST 3.0 response. - **Example** - ``` + ### Examples + + ```adblock ||example.org/vast03.xml^$xmlhttprequest,redirect=noopvast-3.0 ``` file: noopvast03.xml @@ -206,8 +212,9 @@ description: |- Redirects request to an empty VAST 4.0 response. - **Example** - ``` + ### Examples + + ```adblock ||example.org/vast04.xml^$xmlhttprequest,redirect=noopvast-4.0 ``` file: noopvast04.xml @@ -217,9 +224,9 @@ - title: noopmp3-0.1s added: v1.0.4 description: |- - **Example** + ### Examples - ``` + ```adblock ||example.org/advert.mp3$media,redirect=noopmp3-0.1s ``` aliases: @@ -250,9 +257,9 @@ - title: noopmp4-1s added: v1.0.4 description: |- - **Example** + ### Examples - ``` + ```adblock ||example.org/advert.mp4$media,redirect=noopmp4-1s ``` aliases: diff --git a/src/scriptlets/abort-current-inline-script.js b/src/scriptlets/abort-current-inline-script.js index 3a4091b6..22d6a4a5 100644 --- a/src/scriptlets/abort-current-inline-script.js +++ b/src/scriptlets/abort-current-inline-script.js @@ -25,52 +25,60 @@ import { * https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-current-inline-scriptjs- * * Related ABP source: - * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L928 + * https://gitlab.com/eyeo/snippets/-/blob/main/source/behavioral/abort-current-inline-script.js * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('abort-current-inline-script', property[, search]) * ``` * * - `property` — required, path to a property (joined with `.` if needed). The property must be attached to `window` * - `search` — optional, string or regular expression that must match the inline script content. - * Defaults to abort all scripts which are trying to access the specified property. - * Invalid regular expression will cause exit and rule will not work. + * Defaults to abort all scripts which are trying to access the specified property. + * Invalid regular expression will cause exit and rule will not work. * - * > Note please that for inline script with addEventListener in it - * `property` should be set as `EventTarget.prototype.addEventListener`, - * not just `addEventListener`. + * > Note please that to abort the inline script with addEventListener in it, + * > `property` should be set as `EventTarget.prototype.addEventListener`, not just `addEventListener`. + * + * ### Examples * - * **Examples** * 1. Aborts all inline scripts trying to access `window.alert` - * ``` + * + * ```adblock * example.org#%#//scriptlet('abort-current-inline-script', 'alert') * ``` * - * 2. Aborts inline scripts which are trying to access `window.alert` and contain `Hello, world`. - * ``` + * 1. Aborts inline scripts which are trying to access `window.alert` and contain `Hello, world` + * + * ```adblock * example.org#%#//scriptlet('abort-current-inline-script', 'alert', 'Hello, world') * ``` * - * For instance, the following script will be aborted + * For instance, the following script will be aborted: + * * ```html * * ``` * - * 3. Aborts inline scripts which are trying to access `window.alert` and match this regexp: `/Hello.+world/`. - * ``` + * 1. Aborts inline scripts which are trying to access `window.alert` and match regexp `/Hello.+world/` + * + * ```adblock * example.org#%#//scriptlet('abort-current-inline-script', 'alert', '/Hello.+world/') * ``` * * For instance, the following scripts will be aborted: + * * ```html * * ``` + * * ```html * * ``` * - * This script will not be aborted: + * And this script will not be aborted: + * * ```html * * ``` diff --git a/src/scriptlets/abort-on-property-read.js b/src/scriptlets/abort-on-property-read.js index 4af0e4a1..0dc6c5ad 100644 --- a/src/scriptlets/abort-on-property-read.js +++ b/src/scriptlets/abort-on-property-read.js @@ -20,17 +20,19 @@ import { * https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-on-property-readjs- * * Related ABP source: - * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L864 + * https://gitlab.com/eyeo/snippets/-/blob/main/source/behavioral/abort-on-property-read.js * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('abort-on-property-read', property) * ``` * * - `property` — required, path to a property (joined with `.` if needed). The property must be attached to `window` * - * **Examples** - * ``` + * ### Examples + * + * ```adblock * ! Aborts script when it tries to access `window.alert` * example.org#%#//scriptlet('abort-on-property-read', 'alert') * diff --git a/src/scriptlets/abort-on-property-write.js b/src/scriptlets/abort-on-property-write.js index da3a2a66..9b572a82 100644 --- a/src/scriptlets/abort-on-property-write.js +++ b/src/scriptlets/abort-on-property-write.js @@ -20,17 +20,20 @@ import { * https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-on-property-writejs- * * Related ABP source: - * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L896 + * https://gitlab.com/eyeo/snippets/-/blob/main/source/behavioral/abort-on-property-write.js * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('abort-on-property-write', property) * ``` * - * - `property` — required, path to a property (joined with `.` if needed). The property must be attached to `window` + * - `property` — required, path to a property (joined with `.` if needed). + * The property must be attached to `window` * - * **Examples** - * ``` + * ### Examples + * + * ```adblock * ! Aborts script when it tries to set `window.adblock` value * example.org#%#//scriptlet('abort-on-property-write', 'adblock') * ``` diff --git a/src/scriptlets/abort-on-stack-trace.js b/src/scriptlets/abort-on-stack-trace.js index f5973b9c..069670f0 100644 --- a/src/scriptlets/abort-on-stack-trace.js +++ b/src/scriptlets/abort-on-stack-trace.js @@ -21,13 +21,15 @@ import { * @scriptlet abort-on-stack-trace * * @description - * Aborts a script when it attempts to utilize (read or write to) the specified property and it's error stack trace contains given value. + * Aborts a script when it attempts to utilize (read or write to) the specified property + * and it's error stack trace contains given value. * * Related UBO scriptlet: * https://github.com/gorhill/uBlock-for-firefox-legacy/commit/7099186ae54e70b588d5e99554a05d783cabc8ff * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.com#%#//scriptlet('abort-on-stack-trace', property, stack) * ``` * @@ -37,24 +39,38 @@ import { * - `inlineScript` * - `injectedScript` * - * **Examples** - * ``` - * ! Aborts script when it tries to access `window.Ya` and it's error stack trace contains `test.js` - * example.org#%#//scriptlet('abort-on-stack-trace', 'Ya', 'test.js') + * ### Examples * - * ! Aborts script when it tries to access `window.Ya.videoAd` and it's error stack trace contains `test.js` - * example.org#%#//scriptlet('abort-on-stack-trace', 'Ya.videoAd', 'test.js') + * 1. Aborts script when it tries to access `window.Ya` and it's error stack trace contains `test.js` * - * ! Aborts script when stack trace matches with any of these parameters - * example.org#%#//scriptlet('abort-on-stack-trace', 'Ya', 'yandexFuncName') - * example.org#%#//scriptlet('abort-on-stack-trace', 'Ya', 'yandexScriptName') + * ```adblock + * example.org#%#//scriptlet('abort-on-stack-trace', 'Ya', 'test.js') + * ``` * - * ! Aborts script when it tries to access `window.Ya` and it's an inline script - * example.org#%#//scriptlet('abort-on-stack-trace', 'Ya', 'inlineScript') + * 1. Aborts script when it tries to access `window.Ya.videoAd` and it's error stack trace contains `test.js` * - * ! Aborts script when it tries to access `window.Ya` and it's an injected script - * example.org#%#//scriptlet('abort-on-stack-trace', 'Ya', 'injectedScript') - * ``` + * ```adblock + * example.org#%#//scriptlet('abort-on-stack-trace', 'Ya.videoAd', 'test.js') + * ``` + * + * 1. Aborts script when stack trace matches with any of these parameters + * + * ```adblock + * example.org#%#//scriptlet('abort-on-stack-trace', 'Ya', 'yandexFuncName') + * example.org#%#//scriptlet('abort-on-stack-trace', 'Ya', 'yandexScriptName') + * ``` + * + * 1. Aborts script when it tries to access `window.Ya` and it's an inline script + * + * ```adblock + * example.org#%#//scriptlet('abort-on-stack-trace', 'Ya', 'inlineScript') + * ``` + * + * 1. Aborts script when it tries to access `window.Ya` and it's an injected script + * + * ```adblock + * example.org#%#//scriptlet('abort-on-stack-trace', 'Ya', 'injectedScript') + * ``` * * @added v1.5.0. */ diff --git a/src/scriptlets/adjust-setInterval.js b/src/scriptlets/adjust-setInterval.js index a5ff61e9..1236a38b 100644 --- a/src/scriptlets/adjust-setInterval.js +++ b/src/scriptlets/adjust-setInterval.js @@ -22,46 +22,59 @@ import { * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#nano-setinterval-boosterjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('adjust-setInterval'[, matchCallback [, matchDelay[, boost]]]) * ``` * * - `matchCallback` — optional, string or regular expression for stringified callback matching; - * defaults to match all callbacks; invalid regular expression will cause exit and rule will not work + * defaults to match all callbacks; invalid regular expression will cause exit and rule will not work * - `matchDelay` — optional, defaults to 1000, matching setInterval delay; decimal integer OR '*' for any delay - * - `boost` — optional, default to 0.05, float, capped at 1000 times for up and 50 for down (0.001...50), setInterval delay multiplier + * - `boost` — optional, default to 0.05, float, + * capped at 1000 times for up and 50 for down (0.001...50), setInterval delay multiplier * - * **Examples** - * 1. Adjust all setInterval() x20 times where delay equal 1000ms: - * ``` + * ### Examples + * + * 1. Adjust all setInterval() x20 times where delay equal 1000ms + * + * ```adblock * example.org#%#//scriptlet('adjust-setInterval') * ``` * - * 2. Adjust all setInterval() x20 times where callback matched with `example` and delay equal 1000ms - * ``` + * 1. Adjust all setInterval() x20 times where callback matched with `example` and delay equal 1000ms + * + * ```adblock * example.org#%#//scriptlet('adjust-setInterval', 'example') * ``` * - * 3. Adjust all setInterval() x20 times where callback matched with `example` and delay equal 400ms - * ``` + * 1. Adjust all setInterval() x20 times where callback matched with `example` and delay equal 400ms + * + * ```adblock * example.org#%#//scriptlet('adjust-setInterval', 'example', '400') * ``` * - * 4. Slow down setInterval() x2 times where callback matched with `example` and delay equal 1000ms - * ``` + * 1. Slow down setInterval() x2 times where callback matched with `example` and delay equal 1000ms + * + * ```adblock * example.org#%#//scriptlet('adjust-setInterval', 'example', '', '2') * ``` - * 5. Adjust all setInterval() x50 times where delay equal 2000ms - * ``` + * + * 1. Adjust all setInterval() x50 times where delay equal 2000ms + * + * ```adblock * example.org#%#//scriptlet('adjust-setInterval', '', '2000', '0.02') * ``` - * 6. Adjust all setInterval() x1000 times where delay equal 2000ms - * ``` + * + * 1. Adjust all setInterval() x1000 times where delay equal 2000ms + * + * ```adblock * example.org#%#//scriptlet('adjust-setInterval', '', '2000', '0.001') * ``` - * 7. Adjust all setInterval() x50 times where delay is randomized - * ``` + * + * 1. Adjust all setInterval() x50 times where delay is randomized + * + * ```adblock * example.org#%#//scriptlet('adjust-setInterval', '', '*', '0.02') * ``` * diff --git a/src/scriptlets/adjust-setTimeout.js b/src/scriptlets/adjust-setTimeout.js index 1a24d94d..72bd36d9 100644 --- a/src/scriptlets/adjust-setTimeout.js +++ b/src/scriptlets/adjust-setTimeout.js @@ -22,46 +22,59 @@ import { * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#nano-settimeout-boosterjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('adjust-setTimeout'[, matchCallback [, matchDelay[, boost]]]) * ``` * * - `matchCallback` — optional, string or regular expression for stringified callback matching; - * defaults to match all callbacks; invalid regular expression will cause exit and rule will not work + * defaults to match all callbacks; invalid regular expression will cause exit and rule will not work * - `matchDelay` — optional, defaults to 1000, matching setTimeout delay; decimal integer OR '*' for any delay - * - `boost` — optional, default to 0.05, float, capped at 1000 times for up and 50 for down (0.001...50), setTimeout delay multiplier + * - `boost` — optional, default to 0.05, float, + * capped at 1000 times for up and 50 for down (0.001...50), setTimeout delay multiplier * - * **Examples** - * 1. Adjust all setTimeout() x20 times where timeout equal 1000ms: - * ``` + * ### Examples + * + * 1. Adjust all setTimeout() x20 times where timeout equal 1000ms + * + * ```adblock * example.org#%#//scriptlet('adjust-setTimeout') * ``` * - * 2. Adjust all setTimeout() x20 times where callback matched with `example` and timeout equal 1000ms - * ``` + * 1. Adjust all setTimeout() x20 times where callback matched with `example` and timeout equal 1000ms + * + * ```adblock * example.org#%#//scriptlet('adjust-setTimeout', 'example') * ``` * - * 3. Adjust all setTimeout() x20 times where callback matched with `example` and timeout equal 400ms - * ``` + * 1. Adjust all setTimeout() x20 times where callback matched with `example` and timeout equal 400ms + * + * ```adblock * example.org#%#//scriptlet('adjust-setTimeout', 'example', '400') * ``` * - * 4. Slow down setTimeout() x2 times where callback matched with `example` and timeout equal 1000ms - * ``` + * 1. Slow down setTimeout() x2 times where callback matched with `example` and timeout equal 1000ms + * + * ```adblock * example.org#%#//scriptlet('adjust-setTimeout', 'example', '', '2') * ``` - * 5. Adjust all setTimeout() x50 times where timeout equal 2000ms - * ``` + * + * 1. Adjust all setTimeout() x50 times where timeout equal 2000ms + * + * ```adblock * example.org#%#//scriptlet('adjust-setTimeout', '', '2000', '0.02') * ``` - * 6. Adjust all setTimeout() x1000 times where timeout equal 2000ms - * ``` + * + * 1. Adjust all setTimeout() x1000 times where timeout equal 2000ms + * + * ```adblock * example.org#%#//scriptlet('adjust-setTimeout', '', '2000', '0.001') * ``` - * 7. Adjust all setTimeout() x20 times where callback matched with `test` and timeout is randomized - * ``` + * + * 1. Adjust all setTimeout() x20 times where callback matched with `test` and timeout is randomized + * + * ```adblock * example.org#%#//scriptlet('adjust-setTimeout', 'test', '*') * ``` * diff --git a/src/scriptlets/close-window.js b/src/scriptlets/close-window.js index 3d227644..7126525a 100644 --- a/src/scriptlets/close-window.js +++ b/src/scriptlets/close-window.js @@ -10,20 +10,22 @@ import { * @description * Closes the browser tab immediately. * - * > `window.close()` usage is restricted in Chrome. In this case - * tab will only be closed when using AdGuard browser extension. + * > `window.close()` usage is restricted in the Chrome browser. + * > In this case tab will only be closed when using AdGuard Browser extension. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('close-window'[, path]) * ``` * * - `path` — optional, string or regular expression - * matching the current location's path: `window.location.pathname` + `window.location.search`. - * Defaults to execute on every page. + * matching the current location's path: `window.location.pathname` + `window.location.search`. + * Defaults to execute on every page. * - * **Examples** - * ``` + * ### Examples + * + * ```adblock * ! closes any example.org tab * example.org#%#//scriptlet('close-window') * diff --git a/src/scriptlets/debug-current-inline-script.js b/src/scriptlets/debug-current-inline-script.js index 7bd3ffff..250766e5 100644 --- a/src/scriptlets/debug-current-inline-script.js +++ b/src/scriptlets/debug-current-inline-script.js @@ -16,12 +16,14 @@ import { * @scriptlet debug-current-inline-script * * @description - * This scriptlet is basically the same as [abort-current-inline-script](#abort-current-inline-script), but instead of aborting it starts the debugger. + * This scriptlet is basically the same as [abort-current-inline-script](#abort-current-inline-script), + * but instead of aborting it starts the debugger. * - * **It is not supposed to be used in production filter lists!** + * > It is not allowed for prod versions of filter lists. * - * **Syntax** - *``` + * ### Examples + * + * ```adblock * ! Aborts script when it tries to access `window.alert` * example.org#%#//scriptlet('debug-current-inline-script', 'alert') * ``` diff --git a/src/scriptlets/debug-on-property-read.js b/src/scriptlets/debug-on-property-read.js index 62872c59..f281a689 100644 --- a/src/scriptlets/debug-on-property-read.js +++ b/src/scriptlets/debug-on-property-read.js @@ -15,15 +15,18 @@ import { * @scriptlet debug-on-property-read * * @description - * This scriptlet is basically the same as [abort-on-property-read](#abort-on-property-read), but instead of aborting it starts the debugger. + * This scriptlet is basically the same as [abort-on-property-read](#abort-on-property-read), + * but instead of aborting it starts the debugger. * - * **It is not supposed to be used in production filter lists!** + * > It is not allowed for prod versions of filter lists. * - * **Syntax** - * ``` + * ### Examples + * + * ```adblock * ! Debug script if it tries to access `window.alert` * example.org#%#//scriptlet('debug-on-property-read', 'alert') - * ! of `window.open` + * + * ! or `window.open` * example.org#%#//scriptlet('debug-on-property-read', 'open') * ``` * diff --git a/src/scriptlets/debug-on-property-write.js b/src/scriptlets/debug-on-property-write.js index a45cc5a4..429e8726 100644 --- a/src/scriptlets/debug-on-property-write.js +++ b/src/scriptlets/debug-on-property-write.js @@ -14,12 +14,14 @@ import { * @scriptlet debug-on-property-write * * @description - * This scriptlet is basically the same as [abort-on-property-write](#abort-on-property-write), but instead of aborting it starts the debugger. + * This scriptlet is basically the same as [abort-on-property-write](#abort-on-property-write), + * but instead of aborting it starts the debugger. * - * **It is not supposed to be used in production filter lists!** + * > It is not allowed for prod versions of filter lists. * - * **Syntax** - * ``` + * ### Examples + * + * ```adblock * ! Aborts script when it tries to write in property `window.test` * example.org#%#//scriptlet('debug-on-property-write', 'test') * ``` diff --git a/src/scriptlets/dir-string.js b/src/scriptlets/dir-string.js index 7b990b7d..27e5d502 100644 --- a/src/scriptlets/dir-string.js +++ b/src/scriptlets/dir-string.js @@ -11,17 +11,17 @@ import { hit } from '../helpers/index'; * that devtools are open (using this scriptlet), * it will automatically disable the adblock circumvention script. * - * Related ABP source: - * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L766 + * ### Syntax * - * **Syntax** - * ``` + * ```text * example.org#%#//scriptlet('dir-string'[, times]) * ``` + * * - `times` — optional, the number of times to call the `toString` method of the argument to `console.dir` * - * **Example** - * ``` + * ### Examples + * + * ```adblock * ! Run 2 times * example.org#%#//scriptlet('dir-string', '2') * ``` @@ -51,7 +51,6 @@ export function dirString(source, times) { dirString.names = [ 'dir-string', - 'abp-dir-string', ]; dirString.injections = [hit]; diff --git a/src/scriptlets/disable-newtab-links.js b/src/scriptlets/disable-newtab-links.js index 18057ce4..092f89f8 100644 --- a/src/scriptlets/disable-newtab-links.js +++ b/src/scriptlets/disable-newtab-links.js @@ -9,8 +9,9 @@ import { hit } from '../helpers/index'; * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#disable-newtab-linksjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```adblock * example.org#%#//scriptlet('disable-newtab-links') * ``` * diff --git a/src/scriptlets/hide-in-shadow-dom.js b/src/scriptlets/hide-in-shadow-dom.js index d79d283d..89039edb 100644 --- a/src/scriptlets/hide-in-shadow-dom.js +++ b/src/scriptlets/hide-in-shadow-dom.js @@ -15,25 +15,27 @@ import { * @description * Hides elements inside open shadow DOM elements. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('hide-in-shadow-dom', selector[, baseSelector]) * ``` * * - `selector` — required, CSS selector of element in shadow-dom to hide * - `baseSelector` — optional, selector of specific page DOM element, - * narrows down the part of the page DOM where shadow-dom host supposed to be, - * defaults to document.documentElement + * narrows down the part of the page DOM where shadow-dom host supposed to be, + * defaults to document.documentElement * - * > `baseSelector` should match element of the page DOM, but not of shadow DOM + * > `baseSelector` should match element of the page DOM, but not of shadow DOM. * - * **Examples** - * ``` + * ### Examples + * + * ```adblock * ! hides menu bar - * virustotal.com#%#//scriptlet('hide-in-shadow-dom', 'iron-pages', 'vt-virustotal-app') + * example.com#%#//scriptlet('hide-in-shadow-dom', '.storyAd', '#app') * * ! hides floating element - * virustotal.com#%#//scriptlet('hide-in-shadow-dom', 'vt-ui-contact-fab') + * example.com#%#//scriptlet('hide-in-shadow-dom', '.contact-fab') * ``` * * @added v1.3.0. diff --git a/src/scriptlets/inject-css-in-shadow-dom.js b/src/scriptlets/inject-css-in-shadow-dom.js index 94f406e0..d0785268 100644 --- a/src/scriptlets/inject-css-in-shadow-dom.js +++ b/src/scriptlets/inject-css-in-shadow-dom.js @@ -11,25 +11,30 @@ import { * @description * Injects CSS rule into selected Shadow DOM subtrees on a page * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('inject-css-in-shadow-dom', cssRule[, hostSelector]) * ``` * * - `cssRule` — required, string representing a single css rule - * - `hostSelector` — optional, string, selector to match shadow host elements. CSS rule will be only applied to shadow roots inside these elements. - * Defaults to injecting css rule into all available roots. + * - `hostSelector` — optional, string, selector to match shadow host elements. + * CSS rule will be only applied to shadow roots inside these elements. + * Defaults to injecting css rule into all available roots. + * + * ### Examples * - * **Examples** * 1. Apply style to all shadow dom subtrees - * ``` - * example.org#%#//scriptlet('inject-css-in-shadow-dom', '#advertisement { display: none !important; }') - * ``` * - * 2. Apply style to a specific shadow dom subtree - * ``` - * example.org#%#//scriptlet('inject-css-in-shadow-dom', '#content { margin-top: 0 !important; }', '.row > #hidden') - * ``` + * ```adblock + * example.org#%#//scriptlet('inject-css-in-shadow-dom', '#advertisement { display: none !important; }') + * ``` + * + * 1. Apply style to a specific shadow dom subtree + * + * ```adblock + * example.org#%#//scriptlet('inject-css-in-shadow-dom', '#content { margin-top: 0 !important; }', '#banner') + * ``` * * @added v1.8.2. */ diff --git a/src/scriptlets/json-prune.js b/src/scriptlets/json-prune.js index a02bca27..d1b25aa0 100644 --- a/src/scriptlets/json-prune.js +++ b/src/scriptlets/json-prune.js @@ -20,24 +20,28 @@ import { * https://github.com/gorhill/uBlock/wiki/Resources-Library#json-prunejs- * * Related ABP source: - * https://github.com/adblockplus/adblockpluscore/blob/master/lib/content/snippets.js#L1285 + * https://gitlab.com/eyeo/snippets/-/blob/main/source/behavioral/json-prune.js * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('json-prune'[, propsToRemove [, obligatoryProps [, stack]]]) * ``` * * - `propsToRemove` — optional, string of space-separated properties to remove - * - `obligatoryProps` — optional, string of space-separated properties which must be all present for the pruning to occur + * - `obligatoryProps` — optional, string of space-separated properties + * which must be all present for the pruning to occur * - `stack` — optional, string or regular expression that must match the current function call stack trace; - * if regular expression is invalid it will be skipped + * if regular expression is invalid it will be skipped * - * > Note please that you can use wildcard `*` for chain property name. - * e.g. 'ad.*.src' instead of 'ad.0.src ad.1.src ad.2.src ...' + * > Note please that you can use wildcard `*` for chain property name, + * > e.g. `ad.*.src` instead of `ad.0.src ad.1.src ad.2.src`. + * + * ### Examples * - * **Examples** * 1. Removes property `example` from the results of JSON.parse call - * ``` + * + * ```adblock * example.org#%#//scriptlet('json-prune', 'example') * ``` * @@ -47,8 +51,9 @@ import { * JSON.parse('{"one":1,"example":true}') * ``` * - * 2. If there are no specified properties in the result of JSON.parse call, pruning will NOT occur - * ``` + * 1. If there are no specified properties in the result of JSON.parse call, pruning will NOT occur + * + * ```adblock * example.org#%#//scriptlet('json-prune', 'one', 'obligatoryProp') * ``` * @@ -58,30 +63,33 @@ import { * JSON.parse('{"one":1,"two":2}') * ``` * - * 3. A property in a list of properties can be a chain of properties + * 1. A property in a list of properties can be a chain of properties * - * ``` - * example.org#%#//scriptlet('json-prune', 'a.b', 'adpath.url.first') + * ```adblock + * example.org#%#//scriptlet('json-prune', 'a.b', 'ads.url.first') * ``` * - * 4. Removes property `content.ad` from the results of JSON.parse call if its error stack trace contains `test.js` - * ``` + * 1. Removes property `content.ad` from the results of JSON.parse call if its error stack trace contains `test.js` + * + * ```adblock * example.org#%#//scriptlet('json-prune', 'content.ad', '', 'test.js') * ``` * - * 5. A property in a list of properties can be a chain of properties with wildcard in it + * 1. A property in a list of properties can be a chain of properties with wildcard in it * - * ``` - * example.org#%#//scriptlet('json-prune', 'content.*.media.src', 'content.*.media.preroll') + * ```adblock + * example.org#%#//scriptlet('json-prune', 'content.*.media.src', 'content.*.media.ad') * ``` * - * 6. Call with no arguments will log the current hostname and json payload at the console - * ``` + * 1. Call with no arguments will log the current hostname and json payload at the console + * + * ```adblock * example.org#%#//scriptlet('json-prune') * ``` * - * 7. Call with only second argument will log the current hostname and matched json payload at the console - * ``` + * 1. Call with only second argument will log the current hostname and matched json payload at the console + * + * ```adblock * example.org#%#//scriptlet('json-prune', '', '"id":"117458"') * ``` * diff --git a/src/scriptlets/log-addEventListener.js b/src/scriptlets/log-addEventListener.js index b7b8d7fe..110beca6 100644 --- a/src/scriptlets/log-addEventListener.js +++ b/src/scriptlets/log-addEventListener.js @@ -19,8 +19,9 @@ import { * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#addeventlistener-loggerjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```adblock * example.org#%#//scriptlet('log-addEventListener') * ``` * diff --git a/src/scriptlets/log-eval.js b/src/scriptlets/log-eval.js index de23e16d..0434f672 100644 --- a/src/scriptlets/log-eval.js +++ b/src/scriptlets/log-eval.js @@ -7,8 +7,9 @@ import { hit, logMessage } from '../helpers/index'; * @description * Logs all `eval()` or `new Function()` calls to the console. * - * **Syntax** - * ``` + * ### Syntax + * + * ```adblock * example.org#%#//scriptlet('log-eval') * ``` * diff --git a/src/scriptlets/log-on-stack-trace.js b/src/scriptlets/log-on-stack-trace.js index 31a85028..1953b0c2 100644 --- a/src/scriptlets/log-on-stack-trace.js +++ b/src/scriptlets/log-on-stack-trace.js @@ -13,13 +13,16 @@ import { * @scriptlet log-on-stack-trace * * @description - * This scriptlet is basically the same as [abort-on-stack-trace](#abort-on-stack-trace), but instead of aborting it logs: + * This scriptlet is basically the same as [abort-on-stack-trace](#abort-on-stack-trace), + * but instead of aborting it logs: + * * - function and source script names pairs that access the given property * - was that get or set attempt * - script being injected or inline * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.com#%#//scriptlet('log-on-stack-trace', 'property') * ``` * diff --git a/src/scriptlets/log.js b/src/scriptlets/log.js index ac8cc6c3..8efd6cc5 100644 --- a/src/scriptlets/log.js +++ b/src/scriptlets/log.js @@ -5,8 +5,9 @@ * A simple scriptlet which only purpose is to print arguments to console. * This scriptlet can be helpful for debugging and troubleshooting other scriptlets. * - * **Example** - * ``` + * ### Examples + * + * ```adblock * example.org#%#//scriptlet('log', 'arg1', 'arg2') * ``` * diff --git a/src/scriptlets/m3u-prune.js b/src/scriptlets/m3u-prune.js index 914e756a..ce8c28d8 100644 --- a/src/scriptlets/m3u-prune.js +++ b/src/scriptlets/m3u-prune.js @@ -23,35 +23,42 @@ import { * @description * Removes content from the specified M3U file. * + * ### Syntax * - * **Syntax** - * ``` + * ```text * example.org#%#//scriptlet('m3u-prune'[, propsToRemove[, urlToMatch]]) * ``` * - * - `propsToRemove` — optional, string or regular expression to match the URL line (segment) which will be removed alongside with its tags + * - `propsToRemove` — optional, string or regular expression + * to match the URL line (segment) which will be removed alongside with its tags * - `urlToMatch` — optional, string or regular expression for matching the request's URL + * * > Usage with no arguments will log response payload and URL to browser console; - * which is useful for debugging but prohibited for production filter lists. + * > it may be useful for debugging but it is not allowed for prod versions of filter lists. * - * **Examples** - * 1. Removes a tag which contains `tvessaiprod.nbcuni.com/video/`, from all requests - * ``` - * example.org#%#//scriptlet('m3u-prune', 'tvessaiprod.nbcuni.com/video/') - * ``` + * ### Examples * - * 2. Removes a line which contains `tvessaiprod.nbcuni.com/video/`, only if request's URL contains `.m3u8` - * ``` - * example.org#%#//scriptlet('m3u-prune', 'tvessaiprod.nbcuni.com/video/', '.m3u8') + * 1. Removes a tag which contains `example.com/video/`, from all requests + * + * ```adblock + * example.org#%#//scriptlet('m3u-prune', 'example.com/video/') * ``` * - * 3. Call with no arguments will log response payload and URL at the console + * 1. Removes a line which contains `example.com/video/`, only if request's URL contains `.m3u8` + * + * ```adblock + * example.org#%#//scriptlet('m3u-prune', 'example.com/video/', '.m3u8') * ``` + * + * 1. Call with no arguments will log response payload and URL at the console + * + * ```adblock * example.org#%#//scriptlet('m3u-prune') * ``` * - * 4. Call with only `urlToMatch` argument will log response payload and URL only for the matched URL - * ``` + * 1. Call with only `urlToMatch` argument will log response payload and URL only for the matched URL + * + * ```adblock * example.org#%#//scriptlet('m3u-prune', '', '.m3u8') * ``` * diff --git a/src/scriptlets/no-topics.js b/src/scriptlets/no-topics.js index f3ef6328..4b101faf 100644 --- a/src/scriptlets/no-topics.js +++ b/src/scriptlets/no-topics.js @@ -7,11 +7,12 @@ import { * @scriptlet no-topics * * @description - * Prevents using The Topics API + * Prevents using the Topics API. * https://developer.chrome.com/docs/privacy-sandbox/topics/ * - * **Syntax** - * ``` + * ### Syntax + * + * ```adblock * example.org#%#//scriptlet('no-topics') * ``` * diff --git a/src/scriptlets/noeval.js b/src/scriptlets/noeval.js index 66a2392e..5c5ccf7b 100644 --- a/src/scriptlets/noeval.js +++ b/src/scriptlets/noeval.js @@ -14,8 +14,9 @@ import { hit, logMessage } from '../helpers/index'; * It also can be used as `$redirect` rules sometimes. * See [redirect description](../wiki/about-redirects.md#noeval). * - * **Syntax** - * ``` + * ### Syntax + * + * ```adblock * example.org#%#//scriptlet('noeval') * ``` * diff --git a/src/scriptlets/nowebrtc.js b/src/scriptlets/nowebrtc.js index 17c2957c..d244c815 100644 --- a/src/scriptlets/nowebrtc.js +++ b/src/scriptlets/nowebrtc.js @@ -11,13 +11,15 @@ import { * @scriptlet nowebrtc * * @description - * Disables WebRTC by overriding `RTCPeerConnection`. The overridden function will log every attempt to create a new connection. + * Disables WebRTC by overriding `RTCPeerConnection`. + * The overridden function will log every attempt to create a new connection. * * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#nowebrtcjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```adblock * example.org#%#//scriptlet('nowebrtc') * ``` * diff --git a/src/scriptlets/prevent-addEventListener.js b/src/scriptlets/prevent-addEventListener.js index 06ac9cdf..158b9373 100644 --- a/src/scriptlets/prevent-addEventListener.js +++ b/src/scriptlets/prevent-addEventListener.js @@ -16,24 +16,28 @@ import { * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#addeventlistener-defuserjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('prevent-addEventListener'[, typeSearch[, listenerSearch]]) * ``` * * - `typeSearch` — optional, string or regular expression matching the type (event name); - * defaults to match all types; invalid regular expression will cause exit and rule will not work + * defaults to match all types; invalid regular expression will cause exit and rule will not work * - `listenerSearch` — optional, string or regular expression matching the listener function body; - * defaults to match all listeners; invalid regular expression will cause exit and rule will not work + * defaults to match all listeners; invalid regular expression will cause exit and rule will not work * - * **Examples** - * 1. Prevent all `click` listeners: - * ``` + * ### Examples + * + * 1. Prevent all `click` listeners + * + * ```adblock * example.org#%#//scriptlet('prevent-addEventListener', 'click') * ``` * -2. Prevent 'click' listeners with the callback body containing `searchString`. - * ``` + * 1. Prevent 'click' listeners with the callback body containing `searchString` + * + * ```adblock * example.org#%#//scriptlet('prevent-addEventListener', 'click', 'searchString') * ``` * diff --git a/src/scriptlets/prevent-adfly.js b/src/scriptlets/prevent-adfly.js index 4ab787d4..952c9b4e 100644 --- a/src/scriptlets/prevent-adfly.js +++ b/src/scriptlets/prevent-adfly.js @@ -14,8 +14,9 @@ import { * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#adfly-defuserjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```adblock * example.org#%#//scriptlet('prevent-adfly') * ``` * diff --git a/src/scriptlets/prevent-bab.js b/src/scriptlets/prevent-bab.js index 16af37d8..807f2768 100644 --- a/src/scriptlets/prevent-bab.js +++ b/src/scriptlets/prevent-bab.js @@ -13,8 +13,9 @@ import { hit } from '../helpers/index'; * It also can be used as `$redirect` sometimes. * See [redirect description](../wiki/about-redirects.md#prevent-bab). * - * **Syntax** - * ``` + * ### Syntax + * + * ```adblock * example.org#%#//scriptlet('prevent-bab') * ``` * diff --git a/src/scriptlets/prevent-element-src-loading.js b/src/scriptlets/prevent-element-src-loading.js index 3633a99f..a8c9f486 100644 --- a/src/scriptlets/prevent-element-src-loading.js +++ b/src/scriptlets/prevent-element-src-loading.js @@ -12,23 +12,27 @@ import { * @description * Prevents target element source loading without triggering 'onerror' listeners and not breaking 'onload' ones. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('prevent-element-src-loading', tagName, match) * ``` * - * - `tagName` — required, case-insensitive target element tagName which `src` property resource loading will be silently prevented; possible values: + * - `tagName` — required, case-insensitive target element tagName + * which `src` property resource loading will be silently prevented; possible values: * - `script` * - `img` * - `iframe` * - `link` * - `match` — required, string or regular expression for matching the element's URL; * - * **Examples** - * 1. Prevent script source loading: - * ``` + * ### Examples + * + * 1. Prevent script source loading + * + * ```adblock * example.org#%#//scriptlet('prevent-element-src-loading', 'script' ,'adsbygoogle') - * ``` + * ``` * * @added v1.6.2. */ diff --git a/src/scriptlets/prevent-eval-if.js b/src/scriptlets/prevent-eval-if.js index 8c8c1208..ca3faf77 100644 --- a/src/scriptlets/prevent-eval-if.js +++ b/src/scriptlets/prevent-eval-if.js @@ -11,17 +11,19 @@ import { toRegExp, hit } from '../helpers/index'; * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#noeval-ifjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('prevent-eval-if'[, search]) * ``` * * - `search` — optional, string or regular expression matching the stringified eval payload; - * defaults to match all stringified eval payloads; - * invalid regular expression will cause exit and rule will not work + * defaults to match all stringified eval payloads; + * invalid regular expression will cause exit and rule will not work * - * **Examples** - * ``` + * ### Examples + * + * ```adblock * ! Prevents eval if it matches 'test' * example.org#%#//scriptlet('prevent-eval-if', 'test') * ``` diff --git a/src/scriptlets/prevent-fab-3.2.0.js b/src/scriptlets/prevent-fab-3.2.0.js index ef0f88cb..c99091c0 100644 --- a/src/scriptlets/prevent-fab-3.2.0.js +++ b/src/scriptlets/prevent-fab-3.2.0.js @@ -10,8 +10,9 @@ import { hit, noopFunc, noopThis } from '../helpers/index'; * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#fuckadblockjs-320- * - * **Syntax** - * ``` + * ### Syntax + * + * ```adblock * example.org#%#//scriptlet('prevent-fab-3.2.0') * ``` * diff --git a/src/scriptlets/prevent-fetch.js b/src/scriptlets/prevent-fetch.js index 0548ff85..530efbd9 100644 --- a/src/scriptlets/prevent-fetch.js +++ b/src/scriptlets/prevent-fetch.js @@ -28,60 +28,69 @@ import { * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#no-fetch-ifjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('prevent-fetch'[, propsToMatch[, responseBody[, responseType]]]) * ``` * * - `propsToMatch` — optional, string of space-separated properties to match; possible props: - * - string or regular expression for matching the URL passed to fetch call; - * empty string, wildcard `*` or invalid regular expression will match all fetch calls - * - colon-separated pairs `name:value` where - * - `name` is [`init` option name](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#parameters) - * - `value` is string or regular expression for matching the value of the option passed to fetch call; - * invalid regular expression will cause any value matching + * - string or regular expression for matching the URL passed to fetch call; + * empty string, wildcard `*` or invalid regular expression will match all fetch calls + * - colon-separated pairs `name:value` where + * + * - `name` is [`init` option name](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#parameters) + * - `value` is string or regular expression for matching the value of the option passed to fetch call; + * invalid regular expression will cause any value matching * - `responseBody` — optional, string for defining response body value, * defaults to `emptyObj`. Possible values: - * - `emptyObj` — empty object - * - `emptyArr` — empty array + * - `emptyObj` — empty object + * - `emptyArr` — empty array * - `responseType` — optional, string for defining response type, - * original response type is used if not specified. Possible values: - * - `default` - * - `opaque` + * original response type is used if not specified. Possible values: + * - `default` + * - `opaque` * * > Usage with no arguments will log fetch calls to browser console; - * which is useful for debugging but not permitted for production filter lists. + * > it may be useful for debugging but it is not allowed for prod versions of filter lists. + * + * ### Examples * - * **Examples** * 1. Log all fetch calls - * ``` + * + * ```adblock * example.org#%#//scriptlet('prevent-fetch') * ``` * - * 2. Prevent all fetch calls - * ``` + * 1. Prevent all fetch calls + * + * ```adblock * example.org#%#//scriptlet('prevent-fetch', '*') - * OR + * ! or * example.org#%#//scriptlet('prevent-fetch', '') * ``` * - * 3. Prevent fetch call for specific url - * ``` + * 1. Prevent fetch call for specific url + * + * ```adblock * example.org#%#//scriptlet('prevent-fetch', '/url\\.part/') * ``` * - * 4. Prevent fetch call for specific request method - * ``` + * 1. Prevent fetch call for specific request method + * + * ```adblock * example.org#%#//scriptlet('prevent-fetch', 'method:HEAD') * ``` * - * 5. Prevent fetch call for specific url and request method - * ``` + * 1. Prevent fetch call for specific url and request method + * + * ```adblock * example.org#%#//scriptlet('prevent-fetch', '/specified_url_part/ method:/HEAD|GET/') * ``` * - * 6. Prevent fetch call and specify response body value - * ``` + * 1. Prevent fetch call and specify response body value + * + * ```adblock * ! Specify response body for fetch call to a specific url * example.org#%#//scriptlet('prevent-fetch', '/specified_url_part/ method:/HEAD|GET/', 'emptyArr') * @@ -89,8 +98,9 @@ import { * example.org#%#//scriptlet('prevent-fetch', '', 'emptyArr') * ``` * - * 7. Prevent all fetch calls and specify response type value - * ``` + * 1. Prevent all fetch calls and specify response type value + * + * ```adblock * example.org#%#//scriptlet('prevent-fetch', '*', '', 'opaque') * ``` * diff --git a/src/scriptlets/prevent-popads-net.js b/src/scriptlets/prevent-popads-net.js index cb7e3954..8de23dbc 100644 --- a/src/scriptlets/prevent-popads-net.js +++ b/src/scriptlets/prevent-popads-net.js @@ -11,8 +11,9 @@ import { * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#popadsnetjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```adblock * example.org#%#//scriptlet('prevent-popads-net') * ``` * diff --git a/src/scriptlets/prevent-refresh.js b/src/scriptlets/prevent-refresh.js index 12198ab2..3e93100c 100644 --- a/src/scriptlets/prevent-refresh.js +++ b/src/scriptlets/prevent-refresh.js @@ -16,23 +16,28 @@ import { * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#refresh-defuserjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('prevent-refresh'[, delay]) * ``` * - * - `delay` — optional, number of seconds for delay that indicates when scriptlet should run. If not set, source tag value will be applied. + * - `delay` — optional, number of seconds for delay that indicates when scriptlet should run. + * If not set, source tag value will be applied. * - * **Examples** - * 1. Prevent reloading of a document through a meta "refresh" tag. - * ``` - * enrt.eu#%#//scriptlet('prevent-refresh') - * ``` + * ### Examples * - * 2. Prevent reloading of a document with delay. - * ``` - * cryptodirectories.com#%#//scriptlet('prevent-refresh', 3) - * ``` + * 1. Prevent reloading of a document through a meta "refresh" tag + * + * ```adblock + * example.org#%#//scriptlet('prevent-refresh') + * ``` + * + * 1. Prevent reloading of a document with delay + * + * ```adblock + * example.com#%#//scriptlet('prevent-refresh', 3) + * ``` * * @added v1.6.2. */ diff --git a/src/scriptlets/prevent-requestAnimationFrame.js b/src/scriptlets/prevent-requestAnimationFrame.js index 246c359f..43cbcc0d 100644 --- a/src/scriptlets/prevent-requestAnimationFrame.js +++ b/src/scriptlets/prevent-requestAnimationFrame.js @@ -22,25 +22,30 @@ import { * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#no-requestanimationframe-ifjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('prevent-requestAnimationFrame'[, search]) * ``` * - * - `search` — optional, string or regular expression; invalid regular expression will be skipped and all callbacks will be matched. - * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused. - * If do not start with `!`, the stringified callback will be matched. + * - `search` — optional, string or regular expression; + * invalid regular expression will be skipped and all callbacks will be matched. + * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused. + * If do not start with `!`, the stringified callback will be matched. + * + * > Call with no argument will log all requestAnimationFrame calls, + * > it may be useful for debugging but it is not allowed for prod versions of filter lists. + * + * ### Examples * - * Call with no argument will log all requestAnimationFrame calls while debugging. - * So do not use the scriptlet without any parameter in production filter lists. + * 1. Prevents `requestAnimationFrame` calls if the callback matches `/\.test/` * - * **Examples** - * 1. Prevents `requestAnimationFrame` calls if the callback matches `/\.test/`. - * ```bash + * ```adblock * example.org#%#//scriptlet('prevent-requestAnimationFrame', '/\.test/') * ``` * * For instance, the following call will be prevented: + * * ```javascript * var times = 0; * requestAnimationFrame(function change() { @@ -51,8 +56,10 @@ import { * } * }); * ``` - * 2. Prevents `requestAnimationFrame` calls if **does not match** 'check'. - * ```bash + * + * 1. Prevents `requestAnimationFrame` calls if **does not match** 'check' + * + * ```adblock * example.org#%#//scriptlet('prevent-requestAnimationFrame', '!check') * ``` * diff --git a/src/scriptlets/prevent-setInterval.js b/src/scriptlets/prevent-setInterval.js index 1fdeb1f9..dde5d624 100644 --- a/src/scriptlets/prevent-setInterval.js +++ b/src/scriptlets/prevent-setInterval.js @@ -23,52 +23,61 @@ import { * * @description * Prevents a `setInterval` call if: - * 1) the text of the callback is matching the specified `matchCallback` string/regexp which does not start with `!`; - * otherwise mismatched calls should be defused; - * 2) the delay is matching the specified `matchDelay`; otherwise mismatched calls should be defused. + * + * 1. The text of the callback is matching the specified `matchCallback` string/regexp which does not start with `!`; + * otherwise mismatched calls should be defused. + * 1. The delay is matching the specified `matchDelay`; otherwise mismatched calls should be defused. * * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#no-setinterval-ifjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('prevent-setInterval'[, matchCallback[, matchDelay]]) * ``` * - * Call with no arguments will log calls to setInterval while debugging (`log-setInterval` superseding), - * so production filter lists' rules definitely require at least one of the parameters: - * - `matchCallback` — optional, string or regular expression; invalid regular expression will be skipped and all callbacks will be matched. - * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused. - * If do not start with `!`, the stringified callback will be matched. - * If not set, prevents all `setInterval` calls due to specified `matchDelay`. + * > Call with no arguments will log all setInterval calls (`log-setInterval` superseding), + * > it may be useful for debugging but it is not allowed for prod versions of filter lists. + * + * - `matchCallback` — optional, string or regular expression; + * invalid regular expression will be skipped and all callbacks will be matched. + * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused. + * If do not start with `!`, the stringified callback will be matched. + * If not set, prevents all `setInterval` calls due to specified `matchDelay`. * - `matchDelay` — optional, must be an integer. - * If starts with `!`, scriptlet will not match the delay but all other will be defused. - * If do not start with `!`, the delay passed to the `setInterval` call will be matched. - * Decimal delay values will be rounded down, e.g `10.95` will be matched by `matchDelay` with value `10`. + * If starts with `!`, scriptlet will not match the delay but all other will be defused. + * If do not start with `!`, the delay passed to the `setInterval` call will be matched. + * Decimal delay values will be rounded down, e.g `10.95` will be matched by `matchDelay` with value `10`. * * > If `prevent-setInterval` log looks like `setInterval(undefined, 1000)`, - * it means that no callback was passed to setInterval() and that's not scriptlet issue - * and obviously it can not be matched by `matchCallback`. + * > it means that no callback was passed to setInterval() and that's not scriptlet issue + * > and obviously it can not be matched by `matchCallback`. + * + * ### Examples * - * **Examples** - * 1. Prevents `setInterval` calls if the callback matches `/\.test/` regardless of the delay. - * ```bash + * 1. Prevents `setInterval` calls if the callback matches `/\.test/` regardless of the delay + * + * ```adblock * example.org#%#//scriptlet('prevent-setInterval', '/\.test/') * ``` * * For instance, the following call will be prevented: + * * ```javascript * setInterval(function () { * window.test = "value"; * }, 100); * ``` * - * 2. Prevents `setInterval` calls if the callback does not contain `value`. - * ``` + * 1. Prevents `setInterval` calls if the callback does not contain `value` + * + * ```adblock * example.org#%#//scriptlet('prevent-setInterval', '!value') * ``` * * For instance, only the first of the following calls will be prevented: + * * ```javascript * setInterval(function () { * window.test = "test -- prevented"; @@ -81,12 +90,14 @@ import { * }, 500); * ``` * - * 3. Prevents `setInterval` calls if the callback contains `value` and the delay is not set to `300`. - * ``` + * 1. Prevents `setInterval` calls if the callback contains `value` and the delay is not set to `300` + * + * ```adblock * example.org#%#//scriptlet('prevent-setInterval', 'value', '!300') * ``` * * For instance, only the first of the following calls will not be prevented: + * * ```javascript * setInterval(function () { * window.test = "value 1 -- executed"; @@ -99,12 +110,14 @@ import { * }, 500); * ``` * - * 4. Prevents `setInterval` calls if the callback does not contain `value` and the delay is not set to `300`. - * ``` + * 1. Prevents `setInterval` calls if the callback does not contain `value` and the delay is not set to `300` + * + * ```adblock * example.org#%#//scriptlet('prevent-setInterval', '!value', '!300') * ``` * * For instance, only the second of the following calls will be prevented: + * * ```javascript * setInterval(function () { * window.test = "test -- executed"; @@ -120,12 +133,14 @@ import { * }, 500); * ``` * - * 5. Prevents `setInterval` calls if the callback contains `value` and delay is a decimal. - * ``` + * 1. Prevents `setInterval` calls if the callback contains `value` and delay is a decimal number + * + * ```adblock * example.org#%#//scriptlet('prevent-setInterval', 'value', '300') * ``` * * For instance, the following calls will be prevented: + * * ```javascript * setInterval(function () { * window.test = "value"; diff --git a/src/scriptlets/prevent-setTimeout.js b/src/scriptlets/prevent-setTimeout.js index ce9fb9c8..73898e38 100644 --- a/src/scriptlets/prevent-setTimeout.js +++ b/src/scriptlets/prevent-setTimeout.js @@ -23,52 +23,61 @@ import { * * @description * Prevents a `setTimeout` call if: - * 1) the text of the callback is matching the specified `matchCallback` string/regexp which does not start with `!`; - * otherwise mismatched calls should be defused; - * 2) the delay is matching the specified `matchDelay`; otherwise mismatched calls should be defused. + * + * 1. The text of the callback is matching the specified `matchCallback` string/regexp which does not start with `!`; + * otherwise mismatched calls should be defused. + * 1. The delay is matching the specified `matchDelay`; otherwise mismatched calls should be defused. * * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#no-settimeout-ifjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('prevent-setTimeout'[, matchCallback[, matchDelay]]) * ``` * - * Call with no arguments will log calls to setTimeout while debugging (`log-setTimeout` superseding), - * so production filter lists' rules definitely require at least one of the parameters: - * - `matchCallback` — optional, string or regular expression; invalid regular expression will be skipped and all callbacks will be matched. - * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused. - * If do not start with `!`, the stringified callback will be matched. - * If not set, prevents all `setTimeout` calls due to specified `matchDelay`. + * > Call with no arguments will log all setTimeout calls (`log-setTimeout` superseding), + * > it may be useful for debugging but it is not allowed for prod versions of filter lists. + * + * - `matchCallback` — optional, string or regular expression; + * invalid regular expression will be skipped and all callbacks will be matched. + * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused. + * If do not start with `!`, the stringified callback will be matched. + * If not set, prevents all `setTimeout` calls due to specified `matchDelay`. * - `matchDelay` — optional, must be an integer. - * If starts with `!`, scriptlet will not match the delay but all other will be defused. - * If do not start with `!`, the delay passed to the `setTimeout` call will be matched. - * Decimal delay values will be rounded down, e.g `10.95` will be matched by `matchDelay` with value `10`. + * If starts with `!`, scriptlet will not match the delay but all other will be defused. + * If do not start with `!`, the delay passed to the `setTimeout` call will be matched. + * Decimal delay values will be rounded down, e.g `10.95` will be matched by `matchDelay` with value `10`. * * > If `prevent-setTimeout` log looks like `setTimeout(undefined, 1000)`, - * it means that no callback was passed to setTimeout() and that's not scriptlet issue - * and obviously it can not be matched by `matchCallback`. + * > it means that no callback was passed to setTimeout() and that's not scriptlet issue + * > and obviously it can not be matched by `matchCallback`. + * + * ### Examples * - * **Examples** - * 1. Prevents `setTimeout` calls if the callback matches `/\.test/` regardless of the delay. - * ```bash + * 1. Prevents `setTimeout` calls if the callback matches `/\.test/` regardless of the delay + * + * ```adblock * example.org#%#//scriptlet('prevent-setTimeout', '/\.test/') * ``` * * For instance, the following call will be prevented: + * * ```javascript * setTimeout(function () { * window.test = "value"; * }, 100); * ``` * - * 2. Prevents `setTimeout` calls if the callback does not contain `value`. - * ``` + * 1. Prevents `setTimeout` calls if the callback does not contain `value` + * + * ```adblock * example.org#%#//scriptlet('prevent-setTimeout', '!value') * ``` * * For instance, only the first of the following calls will be prevented: + * * ```javascript * setTimeout(function () { * window.test = "test -- prevented"; @@ -81,12 +90,14 @@ import { * }, 500); * ``` * - * 3. Prevents `setTimeout` calls if the callback contains `value` and the delay is not set to `300`. - * ``` + * 1. Prevents `setTimeout` calls if the callback contains `value` and the delay is not set to `300` + * + * ```adblock * example.org#%#//scriptlet('prevent-setTimeout', 'value', '!300') * ``` * * For instance, only the first of the following calls will not be prevented: + * * ```javascript * setTimeout(function () { * window.test = "value 1 -- executed"; @@ -99,12 +110,14 @@ import { * }, 500); * ``` * - * 4. Prevents `setTimeout` calls if the callback does not contain `value` and the delay is not set to `300`. - * ``` + * 1. Prevents `setTimeout` calls if the callback does not contain `value` and the delay is not set to `300` + * + * ```adblock * example.org#%#//scriptlet('prevent-setTimeout', '!value', '!300') * ``` * * For instance, only the second of the following calls will be prevented: + * * ```javascript * setTimeout(function () { * window.test = "test -- executed"; @@ -120,12 +133,14 @@ import { * }, 500); * ``` * - * 5. Prevents `setTimeout` calls if the callback contains `value` and delay is a decimal. - * ``` + * 1. Prevents `setTimeout` calls if the callback contains `value` and delay is a decimal + * + * ```adblock * example.org#%#//scriptlet('prevent-setTimeout', 'value', '300') * ``` * * For instance, the following calls will be prevented: + * * ```javascript * setTimeout(function () { * window.test = "value"; diff --git a/src/scriptlets/prevent-window-open.js b/src/scriptlets/prevent-window-open.js index 89f3d822..650e6292 100644 --- a/src/scriptlets/prevent-window-open.js +++ b/src/scriptlets/prevent-window-open.js @@ -23,59 +23,73 @@ import { * @scriptlet prevent-window-open * * @description - * Prevents `window.open` calls when URL either matches or not matches the specified string/regexp. Using it without parameters prevents all `window.open` calls. + * Prevents `window.open` calls when URL either matches or not matches the specified string/regexp. + * Using it without parameters prevents all `window.open` calls. * * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#windowopen-defuserjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('prevent-window-open'[, match[, delay[, replacement]]]) * ``` * - * - `match` — optional, string or regular expression. If not set or regular expression is invalid, all window.open calls will be matched. - * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused. - * If do not start with `!`, the stringified callback will be matched. + * - `match` — optional, string or regular expression. + * If not set or regular expression is invalid, all window.open calls will be matched. + * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused. + * If do not start with `!`, the stringified callback will be matched. * - `delay` — optional, number of seconds. If not set, scriptlet will return `null`, - * otherwise valid sham window object as injected `iframe` will be returned - * for accessing its methods (blur(), focus() etc.) and will be removed after the delay. + * otherwise valid sham window object as injected `iframe` will be returned + * for accessing its methods (blur(), focus() etc.) and will be removed after the delay. * - `replacement` — optional, string; one of the predefined constants: * - `obj` — for returning an object instead of default iframe; * for cases when the page requires a valid `window` instance to be returned - * - `log` — for logging window.open calls; permitted for production filter lists. + * - `log` — for logging window.open calls; not allowed for prod versions of filter lists. * - * **Examples** - * 1. Prevent all `window.open` calls: - * ``` + * ### Examples + * + * 1. Prevent all `window.open` calls + * + * ```adblock * example.org#%#//scriptlet('prevent-window-open') * ``` * - * 2. Prevent `window.open` for all URLs containing `example`: - * ``` + * 1. Prevent `window.open` for all URLs containing `example` + * + * ```adblock * example.org#%#//scriptlet('prevent-window-open', 'example') * ``` * - * 3. Prevent `window.open` for all URLs matching RegExp `/example\./`: - * ``` + * 1. Prevent `window.open` for all URLs matching RegExp `/example\./` + * + * ```adblock * example.org#%#//scriptlet('prevent-window-open', '/example\./') * ``` * - * 4. Prevent `window.open` for all URLs **NOT** containing `example`: - * ``` + * 1. Prevent `window.open` for all URLs **NOT** containing `example` + * + * ```adblock * example.org#%#//scriptlet('prevent-window-open', '!example') * ``` * - * Old syntax of prevent-window-open parameters: - * - `match` — optional, defaults to "matching", any positive number or nothing for "matching", 0 or empty string for "not matching" - * - `search` — optional, string or regexp for matching the URL passed to `window.open` call; defaults to search all `window.open` call - * - `replacement` — optional, string to return prop value or property instead of window.open; defaults to return noopFunc. - * **Examples** - * ``` - * example.org#%#//scriptlet('prevent-window-open', '1', '/example\./') - * example.org#%#//scriptlet('prevent-window-open', '0', 'example') - * example.org#%#//scriptlet('prevent-window-open', '', '', 'trueFunc') - * example.org#%#//scriptlet('prevent-window-open', '1', '', '{propName=noopFunc}') - * ``` + * ### Old syntax of prevent-window-open parameters + * + * - `match` — optional, defaults to "matching", any positive number or nothing for "matching", + * 0 or empty string for "not matching" + * - `search` — optional, string or regexp for matching the URL passed to `window.open` call; + * defaults to search all `window.open` call + * - `replacement` — optional, string to return prop value or property instead of window.open; + * defaults to return noopFunc. + * + * ### Examples of old syntax + * + * ```adblock + * example.org#%#//scriptlet('prevent-window-open', '1', '/example\./') + * example.org#%#//scriptlet('prevent-window-open', '0', 'example') + * example.org#%#//scriptlet('prevent-window-open', '', '', 'trueFunc') + * example.org#%#//scriptlet('prevent-window-open', '1', '', '{propName=noopFunc}') + * ``` * * > For better compatibility with uBO, old syntax is not recommended to use. * diff --git a/src/scriptlets/prevent-xhr.js b/src/scriptlets/prevent-xhr.js index 99f64fb5..093610aa 100644 --- a/src/scriptlets/prevent-xhr.js +++ b/src/scriptlets/prevent-xhr.js @@ -32,59 +32,71 @@ import { * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#no-xhr-ifjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('prevent-xhr'[, propsToMatch[, randomize]]) * ``` * * - `propsToMatch` — optional, string of space-separated properties to match; possible props: - * - string or regular expression for matching the URL passed to `XMLHttpRequest.open()` call; empty string or wildcard `*` for all `XMLHttpRequest.open()` calls match - * - colon-separated pairs `name:value` where - * - `name` is XMLHttpRequest object property name - * - `value` is string or regular expression for matching the value of the option passed to `XMLHttpRequest.open()` call - * - `randomize` — defaults to `false` for empty responseText, optional argument to randomize responseText of matched XMLHttpRequest's response; possible values: - * - `true` to randomize responseText, random alphanumeric string of 10 symbols - * - colon-separated pair `name:value` string value to customize responseText data where - * - `name` — only `length` supported for now - * - `value` — range on numbers, for example `100-300`, limited to 500000 characters + * - string or regular expression for matching the URL passed to `XMLHttpRequest.open()` call; + * empty string or wildcard `*` for all `XMLHttpRequest.open()` calls match + * - colon-separated pairs `name:value` where + * - `name` is XMLHttpRequest object property name + * - `value` is string or regular expression for matching the value of the option + * passed to `XMLHttpRequest.open()` call + * - `randomize` — defaults to `false` for empty responseText, + * optional argument to randomize responseText of matched XMLHttpRequest's response; possible values: + * - `true` to randomize responseText, random alphanumeric string of 10 symbols + * - colon-separated pair `name:value` string value to customize responseText data where + * - `name` — only `length` supported for now + * - `value` — range on numbers, for example `100-300`, limited to 500000 characters * * > Usage with no arguments will log XMLHttpRequest objects to browser console; - * which is useful for debugging but not allowed for production filter lists. + * > it may be useful for debugging but it is not allowed for prod versions of filter lists. + * + * ### Examples * - * **Examples** * 1. Log all XMLHttpRequests - * ``` + * + * ```adblock * example.org#%#//scriptlet('prevent-xhr') * ``` * - * 2. Prevent all XMLHttpRequests - * ``` + * 1. Prevent all XMLHttpRequests + * + * ```adblock * example.org#%#//scriptlet('prevent-xhr', '*') * example.org#%#//scriptlet('prevent-xhr', '') * ``` * - * 3. Prevent XMLHttpRequests for specific url - * ``` + * 1. Prevent XMLHttpRequests for specific url + * + * ```adblock * example.org#%#//scriptlet('prevent-xhr', 'example.org') * ``` * - * 4. Prevent XMLHttpRequests for specific request method - * ``` + * 1. Prevent XMLHttpRequests for specific request method + * + * ```adblock * example.org#%#//scriptlet('prevent-xhr', 'method:HEAD') * ``` * - * 5. Prevent XMLHttpRequests for specific url and specified request methods - * ``` + * 1. Prevent XMLHttpRequests for specific url and specified request methods + * + * ```adblock * example.org#%#//scriptlet('prevent-xhr', 'example.org method:/HEAD|GET/') * ``` * - * 6. Prevent XMLHttpRequests for specific url and randomize it's response text - * ``` + * 1. Prevent XMLHttpRequests for specific url and randomize it's response text + * + * ```adblock * example.org#%#//scriptlet('prevent-xhr', 'example.org', 'true') * ``` * - * 7. Prevent XMLHttpRequests for specific url and randomize it's response text with range - * ``` + * 1. Prevent XMLHttpRequests for specific url and randomize it's response text with range + * + * ```adblock * example.org#%#//scriptlet('prevent-xhr', 'example.org', 'length:100-300') * ``` * diff --git a/src/scriptlets/remove-attr.js b/src/scriptlets/remove-attr.js index 3d5c09d0..ce772f71 100644 --- a/src/scriptlets/remove-attr.js +++ b/src/scriptlets/remove-attr.js @@ -20,21 +20,25 @@ import { * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-attrjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('remove-attr', attrs[, selector, applying]) * ``` * * - `attrs` — required, attribute or list of attributes joined by '|' * - `selector` — optional, CSS selector, specifies DOM nodes from which the attributes will be removed - * - `applying` — optional, one or more space-separated flags that describe the way scriptlet apply, defaults to 'asap stay'; possible flags: + * - `applying` — optional, one or more space-separated flags that describe the way scriptlet apply, + * defaults to 'asap stay'; possible flags: * - `asap` — runs as fast as possible **once** * - `complete` — runs **once** after the whole page has been loaded * - `stay` — as fast as possible **and** stays on the page observing possible DOM changes * - * **Examples** - * 1. Removes by attribute - * ``` + * ### Examples + * + * 1. Removes by attribute + * + * ```adblock * example.org#%#//scriptlet('remove-attr', 'example|test') * ``` * @@ -46,8 +50,9 @@ import { *
Some text
* ``` * - * 2. Removes with specified selector - * ``` + * 1. Removes with specified selector + * + * ```adblock * example.org#%#//scriptlet('remove-attr', 'example', 'div[class="inner"]') * ``` * @@ -63,8 +68,9 @@ import { * * ``` * - * 3. Using flags - * ``` + * 1. Using flags + * + * ```adblock * example.org#%#//scriptlet('remove-attr', 'example', 'html', 'asap complete') * ``` * diff --git a/src/scriptlets/remove-class.js b/src/scriptlets/remove-class.js index 2860cfe6..e3ea3832 100644 --- a/src/scriptlets/remove-class.js +++ b/src/scriptlets/remove-class.js @@ -19,22 +19,26 @@ import { * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-classjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('remove-class', classes[, selector, applying]) * ``` * * - `classes` — required, class or list of classes separated by '|' * - `selector` — optional, CSS selector, specifies DOM nodes from which the classes will be removed. - * If there is no `selector`, each class of `classes` independently will be removed from all nodes which has one - * - `applying` — optional, one or more space-separated flags that describe the way scriptlet apply, defaults to 'asap stay'; possible flags: + * If there is no `selector`, each class of `classes` independently will be removed from all nodes which has one + * - `applying` — optional, one or more space-separated flags that describe the way scriptlet apply, + * defaults to 'asap stay'; possible flags: * - `asap` — runs as fast as possible **once** * - `complete` — runs **once** after the whole page has been loaded * - `stay` — as fast as possible **and** stays on the page observing possible DOM changes * - * **Examples** - * 1. Removes by classes - * ``` + * ### Examples + * + * 1. Removes by classes + * + * ```adblock * example.org#%#//scriptlet('remove-class', 'example|test') * ``` * @@ -50,8 +54,9 @@ import { *
Some text
* ``` * - * 2. Removes with specified selector - * ``` + * 1. Removes with specified selector + * + * ```adblock * example.org#%#//scriptlet('remove-class', 'branding', 'div[class^="inner"]') * ``` * @@ -67,8 +72,9 @@ import { * * ``` * - * 3. Using flags - * ``` + * 1. Using flags + * + * ```adblock * example.org#%#//scriptlet('remove-class', 'branding', 'div[class^="inner"]', 'asap complete') * ``` * diff --git a/src/scriptlets/remove-cookie.js b/src/scriptlets/remove-cookie.js index 9b1edb7d..e5f38ec9 100644 --- a/src/scriptlets/remove-cookie.js +++ b/src/scriptlets/remove-cookie.js @@ -5,26 +5,35 @@ import { hit, toRegExp } from '../helpers/index'; * @scriptlet remove-cookie * * @description - * Removes current page cookies by passed string matching with name. For current domain and subdomains. Runs on load and before unload. + * Removes current page cookies by passed string matching with name. For current domain and subdomains. + * Runs on load and before unload. * * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#cookie-removerjs- * - * **Syntax** - * ``` + * Related ABP source: + * https://gitlab.com/eyeo/snippets/-/blob/main/source/behavioral/cookie-remover.js + * + * ### Syntax + * + * ```text * example.org#%#//scriptlet('remove-cookie'[, match]) * ``` * - * - `match` — optional, string or regex matching the cookie name. If not specified all accessible cookies will be removed. + * - `match` — optional, string or regex matching the cookie name. + * If not specified all accessible cookies will be removed. * - * **Examples** - * 1. Removes all cookies: - * ``` + * ### Examples + * + * 1. Removes all cookies + * + * ```adblock * example.org#%#//scriptlet('remove-cookie') * ``` * - * 2. Removes cookies which name contains `example` string: - * ``` + * 1. Removes cookies which name contains `example` string + * + * ```adblock * example.org#%#//scriptlet('remove-cookie', 'example') * ``` * diff --git a/src/scriptlets/remove-in-shadow-dom.js b/src/scriptlets/remove-in-shadow-dom.js index 372d0cf4..1f6ae7d6 100644 --- a/src/scriptlets/remove-in-shadow-dom.js +++ b/src/scriptlets/remove-in-shadow-dom.js @@ -15,8 +15,9 @@ import { * @description * Removes elements inside open shadow DOM elements. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('remove-in-shadow-dom', selector[, baseSelector]) * ``` * @@ -25,10 +26,11 @@ import { * narrows down the part of the page DOM where shadow-dom host supposed to be, * defaults to document.documentElement * - * > `baseSelector` should match element of the page DOM, but not of shadow DOM + * > `baseSelector` should match element of the page DOM, but not of shadow DOM. * - * **Examples** - * ``` + * ### Examples + * + * ```adblock * ! removes menu bar * virustotal.com#%#//scriptlet('remove-in-shadow-dom', 'iron-pages', 'vt-virustotal-app') * diff --git a/src/scriptlets/set-attr.js b/src/scriptlets/set-attr.js index 69996303..08cf5640 100644 --- a/src/scriptlets/set-attr.js +++ b/src/scriptlets/set-attr.js @@ -15,8 +15,9 @@ import { * Sets the specified attribute on the specified elements. This scriptlet runs once when the page loads * and after that and after that on DOM tree changes. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('set-attr', selector, attr[, value]) * ``` * @@ -27,9 +28,11 @@ import { * - positive decimal integer `<= 32767` * - `true` / `false` in any case variation * - * **Examples** - * 1. Set attribute by selector - * ``` + * ### Examples + * + * 1. Set attribute by selector + * + * ```adblock * example.org#%#//scriptlet('set-attr', 'div.class > a.class', 'test-attribute', '0') * ``` * @@ -40,8 +43,10 @@ import { * * Some text * ``` - * 2. Set attribute without value - * ``` + * + * 1. Set attribute without value + * + * ```adblock * example.org#%#//scriptlet('set-attr', 'div.class > a.class', 'test-attribute') * ``` * @@ -52,8 +57,10 @@ import { * * Some text * ``` - * 3. Set attribute value to `TRUE` - * ``` + * + * 1. Set attribute value to `TRUE` + * + * ```adblock * example.org#%#//scriptlet('set-attr', 'div.class > a.class', 'test-attribute', 'TRUE') * ``` * @@ -64,8 +71,10 @@ import { * * Some text * ``` - * 4. Set attribute value to `fAlse` - * ``` + * + * 1. Set attribute value to `fAlse` + * + * ```adblock * example.org#%#//scriptlet('set-attr', 'div.class > a.class', 'test-attribute', 'fAlse') * ``` * diff --git a/src/scriptlets/set-constant.js b/src/scriptlets/set-constant.js index 5a58115d..c8ab4aae 100644 --- a/src/scriptlets/set-constant.js +++ b/src/scriptlets/set-constant.js @@ -40,8 +40,9 @@ import { * Related ABP snippet: * https://github.com/adblockplus/adblockpluscore/blob/adblockpluschrome-3.9.4/lib/content/snippets.js#L1361 * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('set-constant', property, value[, stack]) * ``` * @@ -66,23 +67,24 @@ import { * - `-1` — number value `-1` * - `yes` * - `no` - * - `stack` — string or regular expression that must match the current function call stack trace, defaults to matching every call; - * if regular expression is invalid it will be skipped + * - `stack` — string or regular expression that must match the current function call stack trace, + * defaults to matching every call; if regular expression is invalid, it will be skipped * - `valueWrapper` – optional, string to modify a value to be set. Possible wrappers: * - `asFunction` – function returning value * - `asCallback` – function returning callback, that would return value * - `asResolved` – Promise that would resolve with value * - `asRejected` – Promise that would reject with value * - * **Examples** - * ``` + * ### Examples + * + * ```adblock * ! Any access to `window.first` will return `false` * example.org#%#//scriptlet('set-constant', 'first', 'false') * * ✔ window.first === false * ``` * - * ``` + * ```adblock * ! Any call to `window.second()` will return `true` * example.org#%#//scriptlet('set-constant', 'second', 'trueFunc') * @@ -90,21 +92,21 @@ import { * ✔ window.second.toString() === "function trueFunc() {return true;}" * ``` * - * ``` + * ```adblock * ! Any call to `document.third()` will return `true` if the method is related to `checking.js` * example.org#%#//scriptlet('set-constant', 'document.third', 'trueFunc', 'checking.js') * * ✔ document.third() === true // if the condition described above is met * ``` * - * ``` + * ```adblock * ! Any call to `document.fourth()` will return `yes` * example.org#%#//scriptlet('set-constant', 'document.fourth', 'yes', '', 'asFunction') * * ✔ document.fourth() === 'yes' * ``` * - * ``` + * ```adblock * ! Any call to `document.fifth()` will return `yes` * example.org#%#//scriptlet('set-constant', 'document.fifth', '42', '', 'asRejected') * diff --git a/src/scriptlets/set-cookie-reload.js b/src/scriptlets/set-cookie-reload.js index b5dc6436..089fccb7 100644 --- a/src/scriptlets/set-cookie-reload.js +++ b/src/scriptlets/set-cookie-reload.js @@ -19,8 +19,9 @@ import { * and reloads the current page after the cookie setting. * If reloading option is not needed, use [set-cookie](#set-cookie) scriptlet. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('set-cookie-reload', name, value[, path]) * ``` * @@ -38,10 +39,11 @@ import { * - `none` — to set no path at all * * > Note that the scriptlet encodes cookie names and values, - * e.g value `"{ test: 'value'}"` becomes `%7B%20test%3A%20'value'%7D`. + * > e.g value `"{ test: 'value'}"` becomes `%7B%20test%3A%20'value'%7D`. * - * **Examples** - * ``` + * ### Examples + * + * ```adblock * example.org#%#//scriptlet('set-cookie-reload', 'checking', 'ok') * * example.org#%#//scriptlet('set-cookie-reload', 'gdpr-settings-cookie', '1') diff --git a/src/scriptlets/set-cookie.js b/src/scriptlets/set-cookie.js index 573ff68b..3ab28162 100644 --- a/src/scriptlets/set-cookie.js +++ b/src/scriptlets/set-cookie.js @@ -18,8 +18,9 @@ import { * @description * Sets a cookie with the specified name, value, and path. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('set-cookie', name, value[, path]) * ``` * @@ -37,10 +38,11 @@ import { * - `none` — to set no path at all * * > Note that the scriptlet encodes cookie names and values, - * e.g value `"{ test: 'value'}"` becomes `%7B%20test%3A%20'value'%7D`. + * > e.g value `"{ test: 'value'}"` becomes `%7B%20test%3A%20'value'%7D`. * - * **Examples** - * ``` + * ### Examples + * + * ```adblock * example.org#%#//scriptlet('set-cookie', 'CookieConsent', '1') * * example.org#%#//scriptlet('set-cookie', 'gdpr-settings-cookie', 'true') diff --git a/src/scriptlets/set-local-storage-item.js b/src/scriptlets/set-local-storage-item.js index d97fb460..fd806bb9 100644 --- a/src/scriptlets/set-local-storage-item.js +++ b/src/scriptlets/set-local-storage-item.js @@ -14,8 +14,9 @@ import { * Adds specified key and its value to localStorage object, or updates the value of the key if it already exists. * Scriptlet won't set item if storage is full. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.com#%#//scriptlet('set-local-storage-item', 'key', 'value') * ``` * @@ -33,8 +34,9 @@ import { * - `yes` * - `no` * - * **Examples** - * ``` + * ### Examples + * + * ```adblock * example.org#%#//scriptlet('set-local-storage-item', 'player.live.current.mute', 'false') * * example.org#%#//scriptlet('set-local-storage-item', 'exit-intent-marketing', '1') diff --git a/src/scriptlets/set-popads-dummy.js b/src/scriptlets/set-popads-dummy.js index d6487b08..ffd14ab4 100644 --- a/src/scriptlets/set-popads-dummy.js +++ b/src/scriptlets/set-popads-dummy.js @@ -10,8 +10,9 @@ import { hit } from '../helpers/index'; * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#popads-dummyjs- * - * **Syntax** - * ``` + * ### Syntax + * + * ```adblock * example.org#%#//scriptlet('set-popads-dummy') * ``` * diff --git a/src/scriptlets/set-session-storage-item.js b/src/scriptlets/set-session-storage-item.js index 33adee8d..06f1d150 100644 --- a/src/scriptlets/set-session-storage-item.js +++ b/src/scriptlets/set-session-storage-item.js @@ -14,8 +14,9 @@ import { * Adds specified key and its value to sessionStorage object, or updates the value of the key if it already exists. * Scriptlet won't set item if storage is full. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.com#%#//scriptlet('set-session-storage-item', 'key', 'value') * ``` * @@ -33,8 +34,9 @@ import { * - `yes` * - `no` * - * **Examples** - * ``` + * ### Examples + * + * ```adblock * example.org#%#//scriptlet('set-session-storage-item', 'player.live.current.mute', 'false') * * example.org#%#//scriptlet('set-session-storage-item', 'exit-intent-marketing', '1') diff --git a/src/scriptlets/trusted-click-element.js b/src/scriptlets/trusted-click-element.js index 5912f0d8..f9fd00e0 100644 --- a/src/scriptlets/trusted-click-element.js +++ b/src/scriptlets/trusted-click-element.js @@ -12,67 +12,86 @@ import { * @trustedScriptlet trusted-click-element * * @description - * Clicks selected elements in a strict sequence, ordered by selectors passed, and waiting for them to render in the DOM first. + * Clicks selected elements in a strict sequence, ordered by selectors passed, + * and waiting for them to render in the DOM first. * Deactivates after all elements have been clicked or by 10s timeout. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.com#%#//scriptlet('trusted-click-element', selectors[, extraMatch[, delay]]) * ``` * * - `selectors` — required, string with query selectors delimited by comma - * - `extraMatch` — optional, extra condition to check on a page; allows to match `cookie` and `localStorage`; can be set as `name:key[=value]` where `value` is optional. - * If `cookie`/`localStorage` starts with `!` then the element will only be clicked if specified cookie/localStorage item does not exist. - * Multiple conditions are allowed inside one `extraMatch` but they should be delimited by comma and each of them should match the syntax. Possible `name`s: - * - `cookie` - test string or regex against cookies on a page - * - `localStorage` - check if localStorage item is present + * - `extraMatch` — optional, extra condition to check on a page; allows to match `cookie` and `localStorage`; + * can be set as `name:key[=value]` where `value` is optional. + * If `cookie`/`localStorage` starts with `!` then the element will only be clicked + * if specified cookie/localStorage item does not exist. + * Multiple conditions are allowed inside one `extraMatch` but they should be delimited by comma + * and each of them should match the syntax. Possible `name`s: + * - `cookie` — test string or regex against cookies on a page + * - `localStorage` — check if localStorage item is present * - `delay` — optional, time in ms to delay scriptlet execution, defaults to instant execution. * - * **Examples** + * ### Examples + * * 1. Click single element by selector - * ``` - * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]') - * ``` * - * 2. Delay click execution by 500ms - * ``` - * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', '', '500') - * ``` + * ```adblock + * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]') + * ``` * - * 3. Click multiple elements by selector with a delay - * ``` - * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"], button[name="check"], input[type="submit"][value="akkoord"]', '', '500') - * ``` + * 1. Delay click execution by 500ms * - * 4. Match cookies by keys using regex and string - * ``` - * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', 'cookie:userConsentCommunity, cookie:/cmpconsent|cmp/') - * ``` + * ```adblock + * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', '', '500') + * ``` * - * 5. Match by cookie key=value pairs using regex and string - * ``` - * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', 'cookie:userConsentCommunity=true, cookie:/cmpconsent|cmp/=/[a-z]{1,5}/') - * ``` + * 1. Click multiple elements by selector with a delay * - * 6. Match by localStorage item 'promo' key - * ``` - * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', 'localStorage:promo') - * ``` + * * - * 7. Click multiple elements with delay and matching by both cookie string and localStorage item - * ``` - * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"], input[type="submit"][value="akkoord"]', 'cookie:cmpconsent, localStorage:promo', '250') - * ``` + * ```adblock + * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"], button[name="check"], input[type="submit"][value="akkoord"]', '', '500') + * ``` * - * 8. Click element only if cookie with name `cmpconsent` does not exist - * ``` - * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', '!cookie:cmpconsent') - * ``` + * 1. Match cookies by keys using regex and string * - * 9. Click element only if specified cookie string and localStorage item does not exist - * ``` - * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', '!cookie:cmpconsent, !localStorage:promo') - * ``` + * ```adblock + * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', 'cookie:userConsentCommunity, cookie:/cmpconsent|cmp/') + * ``` + * + * 1. Match by cookie key=value pairs using regex and string + * + * ```adblock + * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', 'cookie:userConsentCommunity=true, cookie:/cmpconsent|cmp/=/[a-z]{1,5}/') + * ``` + * + * 1. Match by localStorage item 'promo' key + * + * ```adblock + * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', 'localStorage:promo') + * ``` + * + * 1. Click multiple elements with delay and matching by both cookie string and localStorage item + * + * ```adblock + * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"], input[type="submit"][value="akkoord"]', 'cookie:cmpconsent, localStorage:promo', '250') + * ``` + * + * + * + * 1. Click element only if cookie with name `cmpconsent` does not exist + * + * ```adblock + * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', '!cookie:cmpconsent') + * ``` + * + * 1. Click element only if specified cookie string and localStorage item does not exist + * + * ```adblock + * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', '!cookie:consent, !localStorage:promo') + * ``` * * @added v1.7.3. */ diff --git a/src/scriptlets/trusted-replace-fetch-response.js b/src/scriptlets/trusted-replace-fetch-response.js index 74604c75..a7a2850d 100644 --- a/src/scriptlets/trusted-replace-fetch-response.js +++ b/src/scriptlets/trusted-replace-fetch-response.js @@ -24,52 +24,71 @@ import { * @description * Replaces response text content of `fetch` requests if **all** given parameters match. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('trusted-replace-fetch-response'[, pattern, replacement[, propsToMatch]]) * ``` * - * - `pattern` — optional, argument for matching contents of responseText that should be replaced. If set, `replacement` is required; - * possible values: - * - `*` to match all text content - * - non-empty string - * - regular expression - * - `replacement` — optional, should be set if `pattern` is set. String to replace the response text content matched by `pattern`. - * Empty string to remove content. Defaults to empty string. + * - `pattern` — optional, argument for matching contents of responseText that should be replaced. + * If set, `replacement` is required. Possible values: + * - `*` to match all text content + * - non-empty string + * - regular expression + * - `replacement` — optional, should be set if `pattern` is set. String to replace the response text content + * matched by `pattern`. Empty string to remove content. Defaults to empty string. * - `propsToMatch` — optional, string of space-separated properties to match; possible props: - * - string or regular expression for matching the URL passed to fetch call; empty string, wildcard `*` or invalid regular expression will match all fetch calls - * - colon-separated pairs `name:value` where - * - `name` is [`init` option name](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#parameters) - * - `value` is string or regular expression for matching the value of the option passed to fetch call; invalid regular expression will cause any value matching + * - string or regular expression for matching the URL passed to fetch call; + * empty string, wildcard `*` or invalid regular expression will match all fetch calls + * - colon-separated pairs `name:value` where + * + * - `name` is [`init` option name](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#parameters) + * - `value` is string or regular expression for matching the value of the option passed to fetch call; + * invalid regular expression will cause any value matching * * > Usage with no arguments will log fetch calls to browser console; - * which is useful for debugging but only allowed for production filter lists. + * > it may be useful for debugging but it is not allowed for prod versions of filter lists. * * > Scriptlet does nothing if response body can't be converted to text. * - * **Examples** + * ### Examples + * * 1. Log all fetch calls - * ``` + * + * ```adblock * example.org#%#//scriptlet('trusted-replace-fetch-response') * ``` * - * 2. Replace response text content of fetch requests with specific url - * ``` + * 1. Replace response text content of fetch requests with specific url + * + * + * + * ```adblock * example.org#%#//scriptlet('trusted-replace-fetch-response', 'adb_detect:true', 'adb_detect:false', 'example.org') * example.org#%#//scriptlet('trusted-replace-fetch-response', '/#EXT-X-VMAP-AD-BREAK[\s\S]*?/', '#EXT-X-ENDLIST', 'example.org') * ``` * - * 3. Remove all text content of fetch responses with specific request method - * ``` + * + * + * 1. Remove all text content of fetch responses with specific request method + * + * ```adblock * example.org#%#//scriptlet('trusted-replace-fetch-response', '*', '', 'method:GET') * ``` * - * 4. Replace response text content of fetch requests matching by URL regex and request methods - * ``` + * 1. Replace response text content of fetch requests matching by URL regex and request methods + * + * + * + * ```adblock * example.org#%#//scriptlet('trusted-replace-fetch-response', '/#EXT-X-VMAP-AD-BREAK[\s\S]*?/', '#EXT-X-ENDLIST', '/\.m3u8/ method:/GET|HEAD/') * ``` - * 5. Remove text content of all fetch responses for example.com - * ``` + * + * + * + * 1. Remove text content of all fetch responses for example.com + * + * ```adblock * example.org#%#//scriptlet('trusted-replace-fetch-response', '*', '', 'example.com') * ``` * diff --git a/src/scriptlets/trusted-replace-xhr-response.js b/src/scriptlets/trusted-replace-xhr-response.js index b32d5132..233fe64e 100644 --- a/src/scriptlets/trusted-replace-xhr-response.js +++ b/src/scriptlets/trusted-replace-xhr-response.js @@ -23,49 +23,63 @@ import { * @description * Replaces response content of `xhr` requests if **all** given parameters match. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('trusted-replace-xhr-response'[, pattern, replacement[, propsToMatch]]) * ``` * - * - `pattern` — optional, argument for matching contents of responseText that should be replaced. If set, `replacement` is required; - * possible values: - * - `*` to match all text content - * - non-empty string - * - regular expression - * - `replacement` — optional, should be set if `pattern` is set. String to replace matched content with. Empty string to remove content. + * - `pattern` — optional, argument for matching contents of responseText that should be replaced. + * If set, `replacement` is required. Possible values: + * - `*` to match all text content + * - non-empty string + * - regular expression + * - `replacement` — optional, should be set if `pattern` is set. String to replace matched content with. + * Empty string to remove content. * - `propsToMatch` — optional, string of space-separated properties to match for extra condition; possible props: - * - string or regular expression for matching the URL passed to `XMLHttpRequest.open()` call; - * - colon-separated pairs `name:value` where - * - `name` — string or regular expression for matching XMLHttpRequest property name - * - `value` — string or regular expression for matching the value of the option passed to `XMLHttpRequest.open()` call + * - string or regular expression for matching the URL passed to `XMLHttpRequest.open()` call; + * - colon-separated pairs `name:value` where + * - `name` — string or regular expression for matching XMLHttpRequest property name + * - `value` — string or regular expression for matching the value of the option + * passed to `XMLHttpRequest.open()` call * * > Usage with no arguments will log XMLHttpRequest objects to browser console; - * which is useful for debugging but not permitted for production filter lists. + * > it may be useful for debugging but it is not allowed for prod versions of filter lists. + * + * ### Examples * - * **Examples** * 1. Log all XMLHttpRequests - * ``` + * + * ```adblock * example.org#%#//scriptlet('trusted-replace-xhr-response') * ``` * - * 2. Replace text content of XMLHttpRequests with specific url - * ``` + * 1. Replace text content of XMLHttpRequests with specific url + * + * + * + * ```adblock * example.org#%#//scriptlet('trusted-replace-xhr-response', 'adb_detect:true', 'adb_detect:false', 'example.org') * example.org#%#//scriptlet('trusted-replace-xhr-response', '/#EXT-X-VMAP-AD-BREAK[\s\S]*?/', '#EXT-X-ENDLIST', 'example.org') * ``` * - * 3. Remove all text content of XMLHttpRequests with specific request method - * ``` + * + * + * 1. Remove all text content of XMLHttpRequests with specific request method + * + * ```adblock * example.org#%#//scriptlet('trusted-replace-xhr-response', '*', '', 'method:GET') * ``` * - * 4. Replace text content of XMLHttpRequests matching by URL regex and request methods - * ``` - * example.org#%#//scriptlet('trusted-replace-xhr-response', '/#EXT-X-VMAP-AD-BREAK[\s\S]*?/', '#EXT-X-ENDLIST', '/\.m3u8/ method:/GET|HEAD/') - * ``` - * 5. Remove all text content of all XMLHttpRequests for example.com + * 1. Replace text content of XMLHttpRequests matching by URL regex and request methods + * + * ```adblock + * example.org#%#//scriptlet('trusted-replace-xhr-response', '/#EXT-X-VMAP-AD-BREAK[\s\S]*?/', '#EXT-X-ENDLIST', '/\.m3u8/ method:/GET|HEAD/') * ``` + * + * 1. Remove all text content of all XMLHttpRequests for example.com + * + * ```adblock * example.org#%#//scriptlet('trusted-replace-xhr-response', '*', '', 'example.com') * ``` * diff --git a/src/scriptlets/trusted-set-constant.js b/src/scriptlets/trusted-set-constant.js index 6e7186b4..75590bae 100644 --- a/src/scriptlets/trusted-set-constant.js +++ b/src/scriptlets/trusted-set-constant.js @@ -36,50 +36,54 @@ import { * * > Use [set-constant](./about-scriptlets.md#set-constant) to set predefined values and functions. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('trusted-set-constant', property, value[, stack]) * ``` * * - `property` — required, path to a property (joined with `.` if needed). The property must be attached to `window`. - * - `value` — required, an arbitrary value to be set; value type is being inferred from the argument, e.g '500' will be set as number; - * to set string type value wrap argument into another pair of quotes: `'"500"'`; + * - `value` — required, an arbitrary value to be set; value type is being inferred from the argument, + * e.g '500' will be set as number; to set string type value wrap argument into another pair of quotes: `'"500"'`; * - `stack` — optional, string or regular expression that must match the current function call stack trace; - * if regular expression is invalid it will be skipped + * if regular expression is invalid it will be skipped + * + * ### Examples * - * **Examples** * 1. Set property values of different types - * ``` - * ! Set string value wrapping argument into another pair of quotes - * example.org#%#//scriptlet('trusted-set-constant', 'click_r', '"null"') * - * ✔ window.click_r === 'null' - * ✔ typeof window.click_r === 'string' + * ```adblock + * ! Set string value wrapping argument into another pair of quotes + * example.org#%#//scriptlet('trusted-set-constant', 'click_r', '"null"') * - * ! Set inferred null value - * example.org#%#//scriptlet('trusted-set-constant', 'click_r', 'null') + * ✔ window.click_r === 'null' + * ✔ typeof window.click_r === 'string' * - * ✔ window.click_r === null - * ✔ typeof window.click_r === 'object' + * ! Set inferred null value + * example.org#%#//scriptlet('trusted-set-constant', 'click_r', 'null') * - * ! Set number type value - * example.org#%#//scriptlet('trusted-set-constant', 'click_r', '48') + * ✔ window.click_r === null + * ✔ typeof window.click_r === 'object' * - * ✔ window.click_r === 48 - * ✔ typeof window.click_r === 'number' + * ! Set number type value + * example.org#%#//scriptlet('trusted-set-constant', 'click_r', '48') * - * ! Set array or object as property value, argument should be a JSON string - * example.org#%#//scriptlet('trusted-set-constant', 'click_r', '[1,"string"]') - * example.org#%#//scriptlet('trusted-set-constant', 'click_r', '{"aaa":123,"bbb":{"ccc":"string"}}') - * ``` + * ✔ window.click_r === 48 + * ✔ typeof window.click_r === 'number' * - * 2. Use script stack matching to set value - * ``` - * ! `document.first` will return `1` if the method is related to `checking.js` - * example.org#%#//scriptlet('trusted-set-constant', 'document.first', '1', 'checking.js') + * ! Set array or object as property value, argument should be a JSON string + * example.org#%#//scriptlet('trusted-set-constant', 'click_r', '[1,"string"]') + * example.org#%#//scriptlet('trusted-set-constant', 'click_r', '{"aaa":123,"bbb":{"ccc":"string"}}') + * ``` * - * ✔ document.first === 1 // if the condition described above is met - * ``` + * 1. Use script stack matching to set value + * + * ```adblock + * ! `document.first` will return `1` if the method is related to `checking.js` + * example.org#%#//scriptlet('trusted-set-constant', 'document.first', '1', 'checking.js') + * + * ✔ document.first === 1 // if the condition described above is met + * ``` * * @added v1.8.2. */ diff --git a/src/scriptlets/trusted-set-cookie-reload.js b/src/scriptlets/trusted-set-cookie-reload.js index 9578b72e..a3c315d3 100644 --- a/src/scriptlets/trusted-set-cookie-reload.js +++ b/src/scriptlets/trusted-set-cookie-reload.js @@ -23,54 +23,62 @@ import { * Also reloads the current page after the cookie setting. * If reloading option is not needed, use the [`trusted-set-cookie` scriptlet](#trusted-set-cookie). * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('trusted-set-cookie-reload', name, value[, offsetExpiresSec[, path]]) * ``` * * - `name` — required, cookie name to be set * - `value` — required, cookie value. Possible values: - * - arbitrary value - * - empty string for no value - * - `$now$` keyword for setting current time in ms, e.g 1667915146503 - * - `$currentDate$` keyword for setting current time as string, e.g 'Tue Nov 08 2022 13:53:19 GMT+0300' - * - `offsetExpiresSec` — optional, offset from current time in seconds, after which cookie should expire; defaults to no offset - * Possible values: - * - positive integer in seconds - * - `1year` keyword for setting expiration date to one year - * - `1day` keyword for setting expiration date to one day + * - arbitrary value + * - empty string for no value + * - `$now$` keyword for setting current time in ms, e.g 1667915146503 + * - `$currentDate$` keyword for setting current time as string, e.g 'Tue Nov 08 2022 13:53:19 GMT+0300' + * - `offsetExpiresSec` — optional, offset from current time in seconds, after which cookie should expire; + * defaults to no offset. Possible values: + * - positive integer in seconds + * - `1year` keyword for setting expiration date to one year + * - `1day` keyword for setting expiration date to one day * - `path` — optional, argument for setting cookie path, defaults to `/`; possible values: - * - `/` — root path - * - `none` — to set no path at all + * - `/` — root path + * - `none` — to set no path at all + * + * > Note that the scriptlet does not encode cookie names and values. + * > As a result, if a cookie's name or value includes `;`, + * > the scriptlet will not set the cookie since this may cause the cookie to break. * - * > Note that the scriptlet does not encode cookie names and values. As a result, if a cookie's name or value includes `;`, - * the scriptlet will not set the cookie since this may cause the cookie to break. + * ### Examples * - * **Examples** * 1. Set cookie and reload the page after it - * ``` - * example.org#%#//scriptlet('trusted-set-cookie-reload', 'cmpconsent', 'accept') - * ``` * - * 2. Set cookie with `new Date().getTime()` value and reload the page after it - * ``` - * example.org#%#//scriptlet('trusted-set-cookie-reload', 'cmpconsent', '$now$') - * ``` + * ```adblock + * example.org#%#//scriptlet('trusted-set-cookie-reload', 'cmpconsent', 'accept') + * ``` * - * 3. Set cookie which will expire in 3 days and reload the page after it - * ``` - * example.org#%#//scriptlet('trusted-set-cookie-reload', 'cmpconsent', 'accept', '259200') - * ``` + * 1. Set cookie with `new Date().getTime()` value and reload the page after it * - * 4. Set cookie which will expire in one year and reload the page after it - * ``` - * example.org#%#//scriptlet('trusted-set-cookie-reload', 'cmpconsent', 'accept', '1year') - * ``` + * ```adblock + * example.org#%#//scriptlet('trusted-set-cookie-reload', 'cmpconsent', '$now$') + * ``` * - * 5. Set cookie with no 'expire' and no path, reload the page after it - * ``` - * example.org#%#//scriptlet('trusted-set-cookie-reload', 'cmpconsent', 'decline', '', 'none') - * ``` + * 1. Set cookie which will expire in 3 days and reload the page after it + * + * ```adblock + * example.org#%#//scriptlet('trusted-set-cookie-reload', 'cmpconsent', 'accept', '259200') + * ``` + * + * 1. Set cookie which will expire in one year and reload the page after it + * + * ```adblock + * example.org#%#//scriptlet('trusted-set-cookie-reload', 'cmpconsent', 'accept', '1year') + * ``` + * + * 1. Set cookie with no 'expire' and no path, reload the page after it + * + * ```adblock + * example.org#%#//scriptlet('trusted-set-cookie-reload', 'cmpconsent', 'decline', '', 'none') + * ``` * * @added v1.7.10. */ diff --git a/src/scriptlets/trusted-set-cookie.js b/src/scriptlets/trusted-set-cookie.js index 9f1c6784..b29a7e67 100644 --- a/src/scriptlets/trusted-set-cookie.js +++ b/src/scriptlets/trusted-set-cookie.js @@ -20,55 +20,63 @@ import { * Sets a cookie with arbitrary name and value, * and with optional ability to offset cookie attribute 'expires' and set path. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('trusted-set-cookie', name, value[, offsetExpiresSec[, path]]) * ``` * * - `name` — required, cookie name to be set * - `value` — required, cookie value. Possible values: - * - arbitrary value - * - empty string for no value - * - `$now$` keyword for setting current time in ms, e.g 1667915146503 - * - `$currentDate$` keyword for setting current time as string, e.g 'Tue Nov 08 2022 13:53:19 GMT+0300' - * - `offsetExpiresSec` — optional, offset from current time in seconds, after which cookie should expire; defaults to no offset - * Possible values: - * - positive integer in seconds - * - `1year` keyword for setting expiration date to one year - * - `1day` keyword for setting expiration date to one day + * - arbitrary value + * - empty string for no value + * - `$now$` keyword for setting current time in ms, e.g 1667915146503 + * - `$currentDate$` keyword for setting current time as string, e.g 'Tue Nov 08 2022 13:53:19 GMT+0300' + * - `offsetExpiresSec` — optional, offset from current time in seconds, after which cookie should expire; + * defaults to no offset. Possible values: + * - positive integer in seconds + * - `1year` keyword for setting expiration date to one year + * - `1day` keyword for setting expiration date to one day * - `path` — optional, argument for setting cookie path, defaults to `/`; possible values: - * - `/` — root path - * - `none` — to set no path at all + * - `/` — root path + * - `none` — to set no path at all + * + * > Note that the scriptlet does not encode cookie names and values. + * > As a result, if a cookie's name or value includes `;`, + * > the scriptlet will not set the cookie since this may cause the cookie to break. * - * > Note that the scriptlet does not encode cookie names and values. As a result, if a cookie's name or value includes `;`, - * the scriptlet will not set the cookie since this may cause the cookie to break. + * ### Examples * - * **Examples** * 1. Set cookie - * ``` - * example.org#%#//scriptlet('trusted-set-cookie', 'cmpconsent', 'accept') - * example.org#%#//scriptlet('trusted-set-cookie', 'cmpconsent', '1-accept_1') - * ``` * - * 2. Set cookie with `new Date().getTime()` value - * ``` - * example.org#%#//scriptlet('trusted-set-cookie', 'cmpconsent', '$now$') - * ``` + * ```adblock + * example.org#%#//scriptlet('trusted-set-cookie', 'cmpconsent', 'accept') + * example.org#%#//scriptlet('trusted-set-cookie', 'cmpconsent', '1-accept_1') + * ``` * - * 3. Set cookie which will expire in 3 days - * ``` - * example.org#%#//scriptlet('trusted-set-cookie', 'cmpconsent', 'accept', '259200') - * ``` + * 1. Set cookie with `new Date().getTime()` value * - * 4. Set cookie which will expire in one year - * ``` - * example.org#%#//scriptlet('trusted-set-cookie', 'cmpconsent', 'accept', '1year') - * ``` + * ```adblock + * example.org#%#//scriptlet('trusted-set-cookie', 'cmpconsent', '$now$') + * ``` * - * 5. Set cookie with no path - * ``` - * example.org#%#//scriptlet('trusted-set-cookie', 'cmpconsent', 'decline', '', 'none') - * ``` + * 1. Set cookie which will expire in 3 days + * + * ```adblock + * example.org#%#//scriptlet('trusted-set-cookie', 'cmpconsent', 'accept', '259200') + * ``` + * + * 1. Set cookie which will expire in one year + * + * ```adblock + * example.org#%#//scriptlet('trusted-set-cookie', 'cmpconsent', 'accept', '1year') + * ``` + * + * 1. Set cookie with no path + * + * ```adblock + * example.org#%#//scriptlet('trusted-set-cookie', 'cmpconsent', 'decline', '', 'none') + * ``` * * @added v1.7.3. */ diff --git a/src/scriptlets/trusted-set-local-storage-item.js b/src/scriptlets/trusted-set-local-storage-item.js index 5bfef6ca..18b8b126 100644 --- a/src/scriptlets/trusted-set-local-storage-item.js +++ b/src/scriptlets/trusted-set-local-storage-item.js @@ -14,43 +14,50 @@ import { * Adds item with arbitrary key and value to localStorage object, or updates the value of the key if it already exists. * Scriptlet won't set item if storage is full. * - * **Syntax** - * ``` + * ### Syntax + * + * ```adblock * example.com#%#//scriptlet('trusted-set-local-storage-item', 'key', 'value') * ``` * * - `key` — required, key name to be set. * - `value` — required, key value; possible values: - * - arbitrary value - * - `$now$` keyword for setting current time in ms, corresponds to `Date.now()` and `(new Date).getTime()` calls - * - `$currentDate$` keyword for setting string representation of the current date and time, corresponds to `Date()` and `(new Date).toString()` calls + * - arbitrary value + * - `$now$` keyword for setting current time in ms, corresponds to `Date.now()` and `(new Date).getTime()` calls + * - `$currentDate$` keyword for setting string representation of the current date and time, + * corresponds to `Date()` and `(new Date).toString()` calls + * + * ### Examples * - * **Examples** * 1. Set local storage item - * ``` - * example.org#%#//scriptlet('trusted-set-local-storage-item', 'player.live.current.mute', 'false') * - * example.org#%#//scriptlet('trusted-set-local-storage-item', 'COOKIE_CONSENTS', '{"preferences":3,"marketing":false}') + * ```adblock + * example.org#%#//scriptlet('trusted-set-local-storage-item', 'player.live.current.mute', 'false') * - * example.org#%#//scriptlet('trusted-set-local-storage-item', 'providers', '[16364,88364]') + * example.org#%#//scriptlet('trusted-set-local-storage-item', 'COOKIE_CONSENTS', '{"preferences":3,"flag":false}') * - * example.org#%#//scriptlet('trusted-set-local-storage-item', 'providers', '{"providers":[16364,88364],"consent":"all"}') - * ``` + * example.org#%#//scriptlet('trusted-set-local-storage-item', 'providers', '[16364,88364]') * - * 2. Set item with current time since unix epoch in ms - * ``` - * example.org#%#//scriptlet('trusted-set-local-storage-item', 'player.live.current.play', '$now$') - * ``` + * example.org#%#//scriptlet('trusted-set-local-storage-item', 'providers', '{"providers":[123,456],"consent":"all"}') + * ``` * - * 3. Set item with current date, e.g 'Tue Nov 08 2022 13:53:19 GMT+0300' - * ``` - * example.org#%#//scriptlet('trusted-set-local-storage-item', 'player.live.current.play', '$currentDate$') - * ``` + * 1. Set item with current time since unix epoch in ms * - * 4. Set item without value - * ``` - * example.org#%#//scriptlet('trusted-set-local-storage-item', 'ppu_main_none', '') - * ``` + * ```adblock + * example.org#%#//scriptlet('trusted-set-local-storage-item', 'player.live.current.play', '$now$') + * ``` + * + * 1. Set item with current date, e.g 'Tue Nov 08 2022 13:53:19 GMT+0300' + * + * ```adblock + * example.org#%#//scriptlet('trusted-set-local-storage-item', 'player.live.current.play', '$currentDate$') + * ``` + * + * 1. Set item without value + * + * ```adblock + * example.org#%#//scriptlet('trusted-set-local-storage-item', 'ppu_main_none', '') + * ``` * * @added v1.7.3. */ diff --git a/src/scriptlets/xml-prune.js b/src/scriptlets/xml-prune.js index 22f53dcc..338ecc49 100644 --- a/src/scriptlets/xml-prune.js +++ b/src/scriptlets/xml-prune.js @@ -23,40 +23,48 @@ import { * @description * Removes an element from the specified XML. * - * **Syntax** - * ``` + * ### Syntax + * + * ```text * example.org#%#//scriptlet('xml-prune'[, propsToMatch[, optionalProp[, urlToMatch]]]) * ``` * * - `propsToMatch` — optional, selector of elements which will be removed from XML * - `optionalProp` — optional, selector of elements that must occur in XML document * - `urlToMatch` — optional, string or regular expression for matching the request's URL + * * > Usage with no arguments will log response payload and URL to browser console; - * which is useful for debugging but prohibited for production filter lists. + * > it may be useful for debugging but it is not allowed for prod versions of filter lists. + * + * ### Examples * - * **Examples** * 1. Remove `Period` tag whose `id` contains `-ad-` from all requests - * ``` + * + * ```adblock * example.org#%#//scriptlet('xml-prune', 'Period[id*="-ad-"]') * ``` * - * 2. Remove `Period` tag whose `id` contains `-ad-`, only if XML contains `SegmentTemplate` - * ``` + * 1. Remove `Period` tag whose `id` contains `-ad-`, only if XML contains `SegmentTemplate` + * + * ```adblock * example.org#%#//scriptlet('xml-prune', 'Period[id*="-ad-"]', 'SegmentTemplate') * ``` * - * 3. Remove `Period` tag whose `id` contains `-ad-`, only if request's URL contains `.mpd` - * ``` + * 1. Remove `Period` tag whose `id` contains `-ad-`, only if request's URL contains `.mpd` + * + * ```adblock * example.org#%#//scriptlet('xml-prune', 'Period[id*="-ad-"]', '', '.mpd') * ``` * - * 4. Call with no arguments will log response payload and URL at the console - * ``` + * 1. Call with no arguments will log response payload and URL at the console + * + * ```adblock * example.org#%#//scriptlet('xml-prune') * ``` * - * 5. Call with only `urlToMatch` argument will log response payload and URL only for the matched URL - * ``` + * 1. Call with only `urlToMatch` argument will log response payload and URL only for the matched URL + * + * ```adblock * example.org#%#//scriptlet('xml-prune', '', '', '.mpd') * ``` * diff --git a/tests/scriptlets/dir-string.test.js b/tests/scriptlets/dir-string.test.js index 593929a3..35681e4c 100644 --- a/tests/scriptlets/dir-string.test.js +++ b/tests/scriptlets/dir-string.test.js @@ -16,24 +16,6 @@ const afterEach = () => { module(name, { beforeEach, afterEach }); -test('Checking if alias name works', (assert) => { - const adgParams = { - name, - engine: 'test', - verbose: true, - }; - const abpParams = { - name: 'abp-dir-string', - engine: 'test', - verbose: true, - }; - - const codeByAdgParams = window.scriptlets.invoke(adgParams); - const codeByAbpParams = window.scriptlets.invoke(abpParams); - - assert.strictEqual(codeByAdgParams, codeByAbpParams, 'abp name - ok'); -}); - test('Adg rule times = 2', (assert) => { const scriptletArgs = [2]; runScriptlet(name, scriptletArgs); diff --git a/yarn.lock b/yarn.lock index 23597703..989b6520 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1282,6 +1282,18 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -1579,6 +1591,11 @@ "@nodelib/fs.scandir" "2.1.4" fastq "^1.6.0" +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + "@rollup/plugin-babel@^5.0.4": version "5.2.2" resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.2.2.tgz#e5623a01dd8e37e004ba87f2de218c611727d9b2" @@ -1978,6 +1995,11 @@ ansi-styles@^6.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.1.0.tgz#87313c102b8118abd57371afab34618bf7350ed3" integrity sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ== +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + anymatch@^3.0.3: version "3.1.3" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" @@ -2001,6 +2023,11 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + array-from@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/array-from/-/array-from-2.1.1.tgz#cfe9d8c26628b9dc5aecc62a9f5d8f1f352c1195" @@ -2166,6 +2193,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -2438,6 +2472,11 @@ commander@^9.2.0: resolved "https://registry.yarnpkg.com/commander/-/commander-9.2.0.tgz#6e21014b2ed90d8b7c9647230d8b7a94a4a419a9" integrity sha512-e2i4wANQiSXgnrBlIatyHtP1odfUp0BbV5Y5nEGbxtIrStkEOAAzCUirvLBNXHLr7kwLvJl6V+4V3XV9x7Wd9w== +commander@~10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" + integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== + commander@~2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" @@ -2537,7 +2576,7 @@ cross-fetch@3.1.5: dependencies: node-fetch "2.6.7" -cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -2615,6 +2654,11 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + deep-freeze@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/deep-freeze/-/deep-freeze-0.0.1.tgz#3a0b0005de18672819dfd38cd31f91179c893e84" @@ -2748,6 +2792,11 @@ duplexer@~0.1.1: resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + editorconfig@^0.15.3: version "0.15.3" resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.15.3.tgz#bef84c4e75fb8dcb0ce5cee8efd51c15999befc5" @@ -2807,6 +2856,11 @@ entities@^4.4.0: resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== +entities@~3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/entities/-/entities-3.0.1.tgz#2b887ca62585e96db3903482d336c1006c3001d4" + integrity sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q== + error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -3229,6 +3283,14 @@ follow-redirects@^1.15.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +foreground-child@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" + integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -3320,6 +3382,11 @@ get-package-type@^0.1.0: resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== +get-stdin@~9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-9.0.0.tgz#3983ff82e03d56f1b2ea0d3e60325f39d703a575" + integrity sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA== + get-stream@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" @@ -3375,6 +3442,17 @@ glob@^7.1.4, glob@^7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" +glob@~10.2.2: + version "10.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.2.3.tgz#aa6765963fe6c5936d5c2e00943e7af06302a1a7" + integrity sha512-Kb4rfmBVE3eQTAimgmeqc2LwSnN0wIOkkUL6HmxEFxNJ4fHghYHVbFba/HcGcRjE6s9KoMNK3rSOwkL4PioZjg== + dependencies: + foreground-child "^3.1.0" + jackspeak "^2.0.3" + minimatch "^9.0.0" + minipass "^5.0.0" + path-scurry "^1.7.0" + globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" @@ -3548,6 +3626,11 @@ ignore@^5.1.1: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== +ignore@~5.2.4: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + immediate@~3.0.5: version "3.0.6" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" @@ -3597,6 +3680,11 @@ ini@^1.3.4: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== +ini@~3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ini/-/ini-3.0.1.tgz#c76ec81007875bc44d544ff7a11a55d12294102d" + integrity sha512-it4HyVAUTKBc6m8e1iXWvXSTdndF7HbdN713+kvLrymxTaU4AUBWrJ4vEooP+V7fexnVD3LKcBshjGGPefSMUQ== + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -3797,6 +3885,15 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jackspeak@^2.0.3: + version "2.2.0" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.2.0.tgz#497cbaedc902ec3f31d5d61be804d2364ff9ddad" + integrity sha512-r5XBrqIJfwRIjRt/Xr5fv9Wh09qyhHfKnYddDlpM+ibRR20qrYActpCAgU6U+d53EOEjzkvxPMVHSlgR7leXrQ== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jest-changed-files@^29.5.0: version "29.5.0" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.5.0.tgz#e88786dca8bf2aa899ec4af7644e16d9dcf9b23e" @@ -4214,6 +4311,13 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + jsdoc-type-pratt-parser@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-3.1.0.tgz#a4a56bdc6e82e5865ffd9febc5b1a227ff28e67e" @@ -4300,6 +4404,11 @@ json5@^2.2.2: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== +jsonc-parser@~3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== + jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -4391,6 +4500,13 @@ linkify-it@^2.0.0: dependencies: uc.micro "^1.0.1" +linkify-it@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-4.0.1.tgz#01f1d5e508190d06669982ba31a7d9f56a5751ec" + integrity sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw== + dependencies: + uc.micro "^1.0.1" + lint-staged@^12.1.2: version "12.1.2" resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-12.1.2.tgz#90c571927e1371fc133e720671dd7989eab53f74" @@ -4537,6 +4653,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +lru-cache@^9.1.1: + version "9.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.1.1.tgz#c58a93de58630b688de39ad04ef02ef26f1902f1" + integrity sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A== + magic-string@^0.25.7: version "0.25.7" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" @@ -4571,6 +4692,17 @@ map-stream@~0.1.0: resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" integrity sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ= +markdown-it@13.0.1: + version "13.0.1" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-13.0.1.tgz#c6ecc431cacf1a5da531423fc6a42807814af430" + integrity sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q== + dependencies: + argparse "^2.0.1" + entities "~3.0.1" + linkify-it "^4.0.1" + mdurl "^1.0.1" + uc.micro "^1.0.5" + markdown-it@~7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-7.0.1.tgz#f12d8b88a93e64254348dfd183bd70bf60567a42" @@ -4582,6 +4714,34 @@ markdown-it@~7.0.0: mdurl "^1.0.1" uc.micro "^1.0.1" +markdownlint-cli@^0.34.0: + version "0.34.0" + resolved "https://registry.yarnpkg.com/markdownlint-cli/-/markdownlint-cli-0.34.0.tgz#d7a4ae8e59911de6dfb01782a7cd554e8a245947" + integrity sha512-4G9I++VBTZkaye6Yfc/7dU6HQHcyldZEVB+bYyQJLcpJOHKk/q5ZpGqK80oKMIdlxzsA3aWOJLZ4DkoaoUWXbQ== + dependencies: + commander "~10.0.1" + get-stdin "~9.0.0" + glob "~10.2.2" + ignore "~5.2.4" + js-yaml "^4.1.0" + jsonc-parser "~3.2.0" + markdownlint "~0.28.2" + minimatch "~9.0.0" + run-con "~1.2.11" + +markdownlint-micromark@0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/markdownlint-micromark/-/markdownlint-micromark-0.1.2.tgz#5520e04febffa46741875a2f297509ffdb561f5c" + integrity sha512-jRxlQg8KpOfM2IbCL9RXM8ZiYWz2rv6DlZAnGv8ASJQpUh6byTBnEsbuMZ6T2/uIgntyf7SKg/mEaEBo1164fQ== + +markdownlint@^0.28.2, markdownlint@~0.28.2: + version "0.28.2" + resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.28.2.tgz#ea31586a02fe3a06403ecafbbe22d77e363c8ed5" + integrity sha512-yYaQXoKKPV1zgrFsyAuZPEQoe+JrY9GDag9ObKpk09twx4OCU5lut+0/kZPrQ3W7w82SmgKhd7D8m34aG1unVw== + dependencies: + markdown-it "13.0.1" + markdownlint-micromark "0.1.2" + mdurl@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" @@ -4644,11 +4804,28 @@ minimatch@^3.1.1: dependencies: brace-expansion "^1.1.7" +minimatch@^9.0.0, minimatch@~9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.0.tgz#bfc8e88a1c40ffd40c172ddac3decb8451503b56" + integrity sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.2.0: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== +minimist@^1.2.6: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +minipass@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" + integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== + mkdirp-classic@^0.5.2: version "0.5.3" resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" @@ -4979,6 +5156,14 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.7.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.8.0.tgz#809e09690c63817c76d0183f19a5b21b530ff7d2" + integrity sha512-IjTrKseM404/UAWA8bBbL3Qp6O2wXkanuIE3seCxBH7ctRuvH1QRawy1N3nVDHGkdeZsjOsSe/8AQBL/VQCy2g== + dependencies: + lru-cache "^9.1.1" + minipass "^5.0.0" + path-to-regexp@^1.7.0: version "1.8.0" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a" @@ -5516,6 +5701,16 @@ rollup@^2.70.2: optionalDependencies: fsevents "~2.3.2" +run-con@~1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/run-con/-/run-con-1.2.11.tgz#0014ed430bad034a60568dfe7de2235f32e3f3c4" + integrity sha512-NEMGsUT+cglWkzEr4IFK21P4Jca45HqiAbIIZIBdX5+UZTB24Mb/21iNGgz9xZa8tL6vbW7CXmq7MFN42+VjNQ== + dependencies: + deep-extend "^0.6.0" + ini "~3.0.0" + minimist "^1.2.6" + strip-json-comments "~3.1.1" + run-parallel@^1.1.9: version "1.1.10" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.10.tgz#60a51b2ae836636c81377df16cb107351bcd13ef" @@ -5629,6 +5824,11 @@ signal-exit@^3.0.7: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +signal-exit@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967" + integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q== + sinon@^7.5.0: version "7.5.0" resolved "https://registry.yarnpkg.com/sinon/-/sinon-7.5.0.tgz#e9488ea466070ea908fd44a3d6478fd4923c67ec" @@ -5787,6 +5987,15 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^4.1.0, string-width@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" @@ -5796,15 +6005,6 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.0.1.tgz#0d8158335a6cfd8eb95da9b6b262ce314a036ffd" @@ -5814,6 +6014,15 @@ string-width@^5.0.0: is-fullwidth-code-point "^4.0.0" strip-ansi "^7.0.1" +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string.prototype.trimend@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz#a22bd53cca5c7cf44d7c9d5c732118873d6cd18b" @@ -5844,6 +6053,13 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" @@ -5851,13 +6067,6 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" -strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" @@ -5880,7 +6089,7 @@ strip-final-newline@^2.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1, strip-json-comments@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -6094,7 +6303,7 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -uc.micro@^1.0.1: +uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== @@ -6289,6 +6498,15 @@ word-wrap@^1.2.3, word-wrap@~1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -6298,14 +6516,14 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" wrappy@1: version "1.0.2"