diff --git a/.eslintrc.js b/.eslintrc.js index d9d382247..1adb6b36d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -37,6 +37,7 @@ module.exports = { 'scriptlet', 'trustedScriptlet', 'redirect', + 'added', 'jest-environment', ], }], diff --git a/CHANGELOG.md b/CHANGELOG.md index 727372552..9ba659b71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + + ## [Unreleased] ### Changed diff --git a/scripts/build-docs.js b/scripts/build-docs.js index 3f33fc341..699f68cc4 100644 --- a/scripts/build-docs.js +++ b/scripts/build-docs.js @@ -102,18 +102,21 @@ const getMarkdownData = (dataItems) => { const output = dataItems.reduce((acc, { name, type, + versionAdded, description, source, }) => { - // low case name should be used as anchor + // low case name should be used as an anchor in the table of content acc.list.push(`* [${name}](#${name.toLowerCase()})${EOL}`); const typeOfSrc = type.toLowerCase().includes('scriptlet') ? 'Scriptlet' : 'Redirect'; - // low case name should be used as anchor - const body = `### ⚡️ ${name} + // 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} +${versionAdded ? `> Added in ${versionAdded}` : '> Adding version is unknown.'} ${description}${EOL} -[${typeOfSrc} source](${source}) +[${typeOfSrc} source](${source})${EOL} * * *${EOL}${EOL}`; acc.body.push(body); @@ -135,18 +138,25 @@ const getMarkdownDataForStaticRedirects = () => { const staticRedirects = fs.readFileSync(path.resolve(__dirname, staticRedirectsPath), { encoding: 'utf8' }); const parsedStaticRedirects = yaml.safeLoad(staticRedirects); - const output = parsedStaticRedirects.reduce((acc, { title, description }) => { - if (description) { - acc.list.push(`* [${title}](#${title})${EOL}`); + const output = parsedStaticRedirects.reduce((acc, { title, description, added }) => { + if (!title) { + throw new Error('No title for static redirect'); + } + if (!description) { + throw new Error(`No description for static redirect '${title}'`); + } + if (!added) { + throw new Error(`No added version for static redirect '${title}'`); + } + + acc.list.push(`* [${title}](#${title})${EOL}`); - const body = `### ⚡️ ${title} -${description} -[Redirect source](${STATIC_REDIRECTS_RELATIVE_SOURCE}) + const body = `### ⚡️ ${title}${EOL} +${added ? `> Added in ${added}.` : '> Adding version is unknown.'}${EOL} +${description}${EOL} +[Redirect source](${STATIC_REDIRECTS_RELATIVE_SOURCE})${EOL} * * *${EOL}${EOL}`; - acc.body.push(body); - } else { - throw new Error(`No description for ${title}`); - } + acc.body.push(body); return acc; }, { list: [], body: [] }); @@ -170,18 +180,25 @@ const getMarkdownDataForBlockingRedirects = () => { const blockingRedirects = fs.readFileSync(blockingRedirectsPath, { encoding: 'utf8' }); const parsedBlockingRedirects = yaml.safeLoad(blockingRedirects); - const output = parsedBlockingRedirects.reduce((acc, { title, description }) => { - if (description) { - acc.list.push(`* [${title}](#${title})${EOL}`); + const output = parsedBlockingRedirects.reduce((acc, { title, description, added }) => { + if (!title) { + throw new Error('No title for blocking redirect'); + } + if (!description) { + throw new Error(`No description for blocking redirect '${title}'`); + } + if (!added) { + throw new Error(`No added version for blocking redirect '${title}'`); + } + + acc.list.push(`* [${title}](#${title})${EOL}`); - const body = `### ⚡️ ${title} -${description} -[Redirect source](${BLOCKING_REDIRECTS_RELATIVE_SOURCE}/${title}) + const body = `### ⚡️ ${title}${EOL} +${added ? `> Added in ${added}.` : '> Adding version is unknown.'}${EOL} +${description}${EOL} +[Redirect source](${BLOCKING_REDIRECTS_RELATIVE_SOURCE}/${title})${EOL} * * *${EOL}${EOL}`; - acc.body.push(body); - } else { - throw new Error(`No description for ${title}`); - } + acc.body.push(body); return acc; }, { list: [], body: [] }); @@ -206,8 +223,8 @@ const buildWikiAboutPages = () => { const staticRedirectsMarkdownData = getMarkdownDataForStaticRedirects(); const blockingRedirectsMarkdownData = getMarkdownDataForBlockingRedirects(); - const scriptletsPageContent = `## Available Scriptlets -${scriptletsMarkdownData.list}* * * + const scriptletsPageContent = `## Available Scriptlets${EOL} +${scriptletsMarkdownData.list}* * *${EOL} ${scriptletsMarkdownData.body}`; fs.writeFileSync( path.resolve(__dirname, aboutScriptletsPath), diff --git a/scripts/helpers.js b/scripts/helpers.js index 8dcec4ef8..e81fb1055 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -32,15 +32,15 @@ const getFilesList = (relativeDirPath) => { /** * @typedef {Object} CommentTag - * @property {string} type tag name - * @property {string} string text following the tag + * @property {string} type Tag name, e.g. `@scriptlet`, `@redirect`, `@added`. + * @property {string} string Text following the tag name. */ /** * Returns parsed tags data which we use to describe the sources: * - `@scriptlet`/`trustedScriptlet`/`@redirect` to describe the type and name of source; * - `@description` actual description for scriptlet or redirect. - * required comments from file. + * - `@added` means version when scriptlet or redirect was implemented. * In one file might be comments describing scriptlet and redirect as well. * * @param {string} filePath absolute path to file @@ -95,11 +95,17 @@ Please add one OR edit the list of NON_SCRIPTLETS_FILES / NON_REDIRECTS_FILES.`) * @returns {DescribingCommentData} */ const prepareCommentsData = (commentTags, source) => { - const [base, sup] = commentTags; + const [typeTag, descriptionTag, addedTag] = commentTags; + const name = typeTag.string; + const versionAdded = addedTag?.string; + if (!versionAdded) { + throw new Error(`No @added tag for ${name}`); + } return { - type: base.type, - name: base.string, - description: sup.string, + type: typeTag.type, + name, + description: descriptionTag.string, + versionAdded, source, }; }; diff --git a/src/redirects/amazon-apstag.js b/src/redirects/amazon-apstag.js index 959dca690..9869fce66 100644 --- a/src/redirects/amazon-apstag.js +++ b/src/redirects/amazon-apstag.js @@ -2,6 +2,7 @@ import { hit, noopFunc } from '../helpers/index'; /** * @redirect amazon-apstag + * * @description * Mocks Amazon's apstag.js * @@ -12,6 +13,8 @@ import { hit, noopFunc } from '../helpers/index'; * ``` * ||amazon-adsystem.com/aax2/apstag.js$script,redirect=amazon-apstag * ``` + * + * @added v1.2.3. */ export function AmazonApstag(source) { const apstagWrapper = { diff --git a/src/redirects/ati-smarttag.js b/src/redirects/ati-smarttag.js index 4a00ab27f..99383725f 100644 --- a/src/redirects/ati-smarttag.js +++ b/src/redirects/ati-smarttag.js @@ -2,6 +2,7 @@ import { hit, noopFunc } from '../helpers/index'; /** * @redirect ati-smarttag + * * @description * Mocks AT Internat SmartTag. * https://developers.atinternet-solutions.com/as2-tagging-en/javascript-en/getting-started-javascript-en/tracker-initialisation-javascript-en/ @@ -10,6 +11,8 @@ import { hit, noopFunc } from '../helpers/index'; * ``` * ||bloctel.gouv.fr/assets/scripts/smarttag.js$script,redirect=ati-smarttag * ``` + * + * @added v1.5.0. */ export function ATInternetSmartTag(source) { const setNoopFuncWrapper = { diff --git a/src/redirects/blocking-redirects.yml b/src/redirects/blocking-redirects.yml index 8925ad6b4..9dfc4f628 100644 --- a/src/redirects/blocking-redirects.yml +++ b/src/redirects/blocking-redirects.yml @@ -4,6 +4,7 @@ # use ">" if property contains long string - title: click2load.html + added: v1.5.0 description: |- Redirects resource and replaces supposed content by decoy frame with button for original content recovering @@ -11,6 +12,7 @@ https://github.com/gorhill/uBlock/blob/1.31.0/src/web_accessible_resources/click2load.html **Example** + ``` ||youtube.com/embed/$frame,third-party,redirect=click2load.html ``` diff --git a/src/redirects/didomi-loader.js b/src/redirects/didomi-loader.js index 06b28f13f..2ba9a60fe 100644 --- a/src/redirects/didomi-loader.js +++ b/src/redirects/didomi-loader.js @@ -9,6 +9,7 @@ import { /** * @redirect didomi-loader + * * @description * Mocks Didomi's CMP loader script. * https://developers.didomi.io/ @@ -17,6 +18,8 @@ import { * ``` * ||sdk.privacy-center.org/fbf86806f86e/loader.js$script,redirect=didomi-loader * ``` + * + * @added v1.6.2. */ export function DidomiLoader(source) { function UserConsentStatusForVendorSubscribe() { } diff --git a/src/redirects/fingerprintjs2.js b/src/redirects/fingerprintjs2.js index a3f04a8d8..258dd7b28 100644 --- a/src/redirects/fingerprintjs2.js +++ b/src/redirects/fingerprintjs2.js @@ -3,6 +3,7 @@ import { hit } from '../helpers/index'; /** * @redirect fingerprintjs2 + * * @description * Mocks FingerprintJS v2 * https://github.com/fingerprintjs @@ -14,6 +15,8 @@ import { hit } from '../helpers/index'; * ``` * ||the-japan-news.com/modules/js/lib/fgp/fingerprint2.js$script,redirect=fingerprintjs2 * ``` + * + * @added v1.5.0. */ export function Fingerprintjs2(source) { let browserId = ''; diff --git a/src/redirects/fingerprintjs3.js b/src/redirects/fingerprintjs3.js index 2c073b336..22a25fbd6 100644 --- a/src/redirects/fingerprintjs3.js +++ b/src/redirects/fingerprintjs3.js @@ -6,6 +6,7 @@ import { /** * @redirect fingerprintjs3 + * * @description * Mocks FingerprintJS v3 * https://github.com/fingerprintjs @@ -17,6 +18,8 @@ import { * ``` * ||sephora.com/js/ufe/isomorphic/thirdparty/fp.min.js$script,redirect=fingerprintjs3 * ``` + * + * @added v1.6.2. */ export function Fingerprintjs3(source) { const visitorId = (() => { diff --git a/src/redirects/gemius.js b/src/redirects/gemius.js index cfaf62849..7c6ce9b24 100644 --- a/src/redirects/gemius.js +++ b/src/redirects/gemius.js @@ -3,6 +3,7 @@ import { hit, noopFunc } from '../helpers/index'; /** * @redirect gemius + * * @description * Mocks Gemius Analytics. * https://flowplayer.com/developers/plugins/gemius @@ -11,6 +12,8 @@ import { hit, noopFunc } from '../helpers/index'; * ``` * ||gapt.hit.gemius.pl/gplayer.js$script,redirect=gemius * ``` + * + * @added v1.5.0. */ export function Gemius(source) { const GemiusPlayer = function () {}; diff --git a/src/redirects/google-analytics-ga.js b/src/redirects/google-analytics-ga.js index 9e86a66b9..0ea8fb61a 100644 --- a/src/redirects/google-analytics-ga.js +++ b/src/redirects/google-analytics-ga.js @@ -7,6 +7,7 @@ import { /** * @redirect google-analytics-ga + * * @description * Mocks old Google Analytics API. * @@ -17,6 +18,8 @@ import { * ``` * ||google-analytics.com/ga.js$script,redirect=google-analytics-ga * ``` + * + * @added v1.0.10. */ export function GoogleAnalyticsGa(source) { // Gaq constructor diff --git a/src/redirects/google-analytics.js b/src/redirects/google-analytics.js index e42214d96..d1590d6ca 100644 --- a/src/redirects/google-analytics.js +++ b/src/redirects/google-analytics.js @@ -7,6 +7,7 @@ import { /** * @redirect google-analytics + * * @description * Mocks Google's Analytics and Tag Manager APIs. * [Covers obsolete googletagmanager-gtm redirect functionality](https://github.com/AdguardTeam/Scriptlets/issues/127). @@ -19,6 +20,8 @@ import { * ||google-analytics.com/analytics.js$script,redirect=google-analytics * ||googletagmanager.com/gtm.js$script,redirect=googletagmanager-gtm * ``` + * + * @added v1.0.10. */ export function GoogleAnalytics(source) { // eslint-disable-next-line func-names diff --git a/src/redirects/google-ima3.js b/src/redirects/google-ima3.js index 807bbb799..fd8a2bdf2 100644 --- a/src/redirects/google-ima3.js +++ b/src/redirects/google-ima3.js @@ -7,6 +7,7 @@ import { /** * @redirect google-ima3 + * * @description * Mocks the IMA SDK of Google. * @@ -14,6 +15,8 @@ import { * ``` * ||imasdk.googleapis.com/js/sdkloader/ima3.js$script,redirect=google-ima3 * ``` + * + * @added v1.6.2. */ export function GoogleIma3(source) { diff --git a/src/redirects/googlesyndication-adsbygoogle.js b/src/redirects/googlesyndication-adsbygoogle.js index 80832f5a4..241b26674 100644 --- a/src/redirects/googlesyndication-adsbygoogle.js +++ b/src/redirects/googlesyndication-adsbygoogle.js @@ -3,6 +3,7 @@ import { hit } from '../helpers/index'; /* eslint-disable max-len */ /** * @redirect googlesyndication-adsbygoogle + * * @description * Mocks Google AdSense API. * @@ -13,6 +14,8 @@ import { hit } from '../helpers/index'; * ``` * ||pagead2.googlesyndication.com/pagead/js/adsbygoogle.js$script,redirect=googlesyndication-adsbygoogle * ``` + * + * @added v1.0.10. */ /* eslint-enable max-len */ export function GoogleSyndicationAdsByGoogle(source) { diff --git a/src/redirects/googletagservices-gpt.js b/src/redirects/googletagservices-gpt.js index f2ece88d1..8b0cf68cf 100644 --- a/src/redirects/googletagservices-gpt.js +++ b/src/redirects/googletagservices-gpt.js @@ -11,6 +11,7 @@ import { /** * @redirect googletagservices-gpt + * * @description * Mocks Google Publisher Tag API. * @@ -21,6 +22,8 @@ import { * ``` * ||googletagservices.com/tag/js/gpt.js$script,redirect=googletagservices-gpt * ``` + * + * @added v1.0.10. */ export function GoogleTagServicesGpt(source) { const slots = new Map(); diff --git a/src/redirects/matomo.js b/src/redirects/matomo.js index 649c87ccc..8a51ea93a 100644 --- a/src/redirects/matomo.js +++ b/src/redirects/matomo.js @@ -3,6 +3,7 @@ import { hit, noopFunc } from '../helpers/index'; /** * @redirect matomo + * * @description * Mocks the piwik.js file of Matomo (formerly Piwik). * @@ -10,6 +11,8 @@ import { hit, noopFunc } from '../helpers/index'; * ``` * ||example.org/piwik.js$script,redirect=matomo * ``` + * + * @added v1.5.0. */ export function Matomo(source) { diff --git a/src/redirects/metrika-yandex-tag.js b/src/redirects/metrika-yandex-tag.js index a432926b4..3ddeab3c1 100644 --- a/src/redirects/metrika-yandex-tag.js +++ b/src/redirects/metrika-yandex-tag.js @@ -2,6 +2,7 @@ import { hit, noopFunc } from '../helpers/index'; /** * @redirect metrika-yandex-tag + * * @description * Mocks Yandex Metrika API. * https://yandex.ru/support/metrica/objects/method-reference.html @@ -10,6 +11,8 @@ import { hit, noopFunc } from '../helpers/index'; * ``` * ||mc.yandex.ru/metrika/tag.js$script,redirect=metrika-yandex-tag * ``` + * + * @added v1.0.10. */ export function metrikaYandexTag(source) { const asyncCallbackFromOptions = (id, param, options = {}) => { diff --git a/src/redirects/metrika-yandex-watch.js b/src/redirects/metrika-yandex-watch.js index f2646de7a..10caacc6f 100644 --- a/src/redirects/metrika-yandex-watch.js +++ b/src/redirects/metrika-yandex-watch.js @@ -2,6 +2,7 @@ import { hit, noopFunc, noopArray } from '../helpers/index'; /** * @redirect metrika-yandex-watch + * * @description * Mocks the old Yandex Metrika API. * https://yandex.ru/support/metrica/objects/_method-reference.html @@ -10,6 +11,8 @@ import { hit, noopFunc, noopArray } from '../helpers/index'; * ``` * ||mc.yandex.ru/metrika/watch.js$script,redirect=metrika-yandex-watch * ``` + * + * @added v1.0.10. */ export function metrikaYandexWatch(source) { const cbName = 'yandex_metrika_callbacks'; diff --git a/src/redirects/naver-wcslog.js b/src/redirects/naver-wcslog.js index e84f0f118..df75e0b6a 100644 --- a/src/redirects/naver-wcslog.js +++ b/src/redirects/naver-wcslog.js @@ -3,6 +3,7 @@ import { hit, noopFunc } from '../helpers/index'; /** * @redirect naver-wcslog + * * @description * Mocks wcslog.js of Naver Analytics. * @@ -10,6 +11,8 @@ import { hit, noopFunc } from '../helpers/index'; * ``` * ||wcs.naver.net/wcslog.js$script,redirect=naver-wcslog * ``` + * + * @added v1.6.2. */ export function NaverWcslog(source) { diff --git a/src/redirects/noeval.js b/src/redirects/noeval.js index 698f46427..b449582e8 100644 --- a/src/redirects/noeval.js +++ b/src/redirects/noeval.js @@ -2,6 +2,7 @@ import { noeval } from '../scriptlets/noeval'; /** * @redirect noeval + * * @description * Redirects request to the source which sets static properties to PopAds and popns objects. * @@ -18,5 +19,7 @@ import { noeval } from '../scriptlets/noeval'; * ``` * ||example.org/index.js$script,redirect=noeval * ``` + * + * @added v1.0.4. */ export { noeval }; diff --git a/src/redirects/pardot-1.0.js b/src/redirects/pardot-1.0.js index e23f19040..426429e72 100644 --- a/src/redirects/pardot-1.0.js +++ b/src/redirects/pardot-1.0.js @@ -8,6 +8,7 @@ import { /** * @redirect pardot-1.0 + * * @description * Mocks the pd.js file of Salesforce. * https://pi.pardot.com/pd.js @@ -18,6 +19,8 @@ import { * ||pi.pardot.com/pd.js$script,redirect=pardot * ||pacedg.com.au/pd.js$redirect=pardot * ``` + * + * @added v1.6.55. */ export function Pardot(source) { diff --git a/src/redirects/prebid-ads.js b/src/redirects/prebid-ads.js index ff4fccc76..19483cc25 100644 --- a/src/redirects/prebid-ads.js +++ b/src/redirects/prebid-ads.js @@ -3,6 +3,7 @@ import { hit } from '../helpers/index'; /** * @redirect prebid-ads + * * @description * Sets predefined constants on a page: * - `canRunAds`: `true` @@ -12,6 +13,8 @@ import { hit } from '../helpers/index'; * ``` * ||playerdrive.me/assets/js/prebid-ads.js$script,redirect=prebid-ads * ``` + * + * @added v1.6.2. */ export function prebidAds(source) { window.canRunAds = true; diff --git a/src/redirects/prebid.js b/src/redirects/prebid.js index 77356c57a..911aa806c 100644 --- a/src/redirects/prebid.js +++ b/src/redirects/prebid.js @@ -8,6 +8,7 @@ import { /** * @redirect prebid + * * @description * Mocks the prebid.js header bidding suit. * https://docs.prebid.org/ @@ -16,6 +17,8 @@ import { * ``` * ||tmgrup.com.tr/bd/hb/prebid.js$script,redirect=prebid * ``` + * + * @added v1.6.2. */ export function Prebid(source) { diff --git a/src/redirects/prevent-bab.js b/src/redirects/prevent-bab.js index bbf4feeff..3a76f087e 100644 --- a/src/redirects/prevent-bab.js +++ b/src/redirects/prevent-bab.js @@ -2,6 +2,7 @@ import { preventBab as preventBabScriptlet } from '../scriptlets/prevent-bab'; /** * @redirect prevent-bab + * * @description * Prevents BlockAdblock script from detecting an ad blocker. * @@ -15,6 +16,8 @@ import { preventBab as preventBabScriptlet } from '../scriptlets/prevent-bab'; * ``` * /blockadblock.$script,redirect=prevent-bab * ``` + * + * @added v1.3.19. */ const preventBab = preventBabScriptlet; preventBab.names = [ diff --git a/src/redirects/prevent-bab2.js b/src/redirects/prevent-bab2.js index 85ac55237..674d9f159 100644 --- a/src/redirects/prevent-bab2.js +++ b/src/redirects/prevent-bab2.js @@ -3,6 +3,7 @@ import { hit } from '../helpers/index'; /** * @redirect prevent-bab2 + * * @description * Prevents BlockAdblock script from detecting an ad blocker. * @@ -15,6 +16,8 @@ import { hit } from '../helpers/index'; * ``` * /blockadblock.$script,redirect=prevent-bab2 * ``` + * + * @added v1.5.0. */ export function preventBab2(source) { const script = document.currentScript; diff --git a/src/redirects/prevent-fab-3.2.0.js b/src/redirects/prevent-fab-3.2.0.js index c4973295c..04f86983d 100644 --- a/src/redirects/prevent-fab-3.2.0.js +++ b/src/redirects/prevent-fab-3.2.0.js @@ -2,6 +2,7 @@ import { preventFab } from '../scriptlets/prevent-fab-3.2.0'; /** * @redirect prevent-fab-3.2.0 + * * @description * Redirects fuckadblock script to the source js file. * @@ -9,5 +10,7 @@ import { preventFab } from '../scriptlets/prevent-fab-3.2.0'; * ``` * \*\/fuckadblock-$script,redirect=prevent-fab-3.2.0 * ``` + * + * @added v1.0.4. */ export { preventFab }; diff --git a/src/redirects/prevent-popads-net.js b/src/redirects/prevent-popads-net.js index b0d2bb54e..54f0b8bf2 100644 --- a/src/redirects/prevent-popads-net.js +++ b/src/redirects/prevent-popads-net.js @@ -2,6 +2,7 @@ import { preventPopadsNet } from '../scriptlets/prevent-popads-net'; /** * @redirect prevent-popads-net + * * @description * Redirects request to the source which sets static properties to PopAds and popns objects. * @@ -9,5 +10,7 @@ import { preventPopadsNet } from '../scriptlets/prevent-popads-net'; * ``` * ||popads.net/pop.js$script,redirect=prevent-popads-net * ``` + * + * @added v1.0.4. */ export { preventPopadsNet }; diff --git a/src/redirects/scorecardresearch-beacon.js b/src/redirects/scorecardresearch-beacon.js index 9900706a2..1644a1cd7 100644 --- a/src/redirects/scorecardresearch-beacon.js +++ b/src/redirects/scorecardresearch-beacon.js @@ -2,6 +2,7 @@ import { hit } from '../helpers/index'; /** * @redirect scorecardresearch-beacon + * * @description * Mocks Scorecard Research API. * @@ -12,6 +13,8 @@ import { hit } from '../helpers/index'; * ``` * ||sb.scorecardresearch.com/beacon.js$script,redirect=scorecardresearch-beacon * ``` + * + * @added v1.0.10. */ export function ScoreCardResearchBeacon(source) { window.COMSCORE = { diff --git a/src/redirects/set-popads-dummy.js b/src/redirects/set-popads-dummy.js index 70af5001c..ca7e03496 100644 --- a/src/redirects/set-popads-dummy.js +++ b/src/redirects/set-popads-dummy.js @@ -2,6 +2,7 @@ import { setPopadsDummy } from '../scriptlets/set-popads-dummy'; /** * @redirect set-popads-dummy + * * @description * Redirects request to the source which sets static properties to PopAds and popns objects. * @@ -9,5 +10,7 @@ import { setPopadsDummy } from '../scriptlets/set-popads-dummy'; * ``` * ||popads.net^$script,redirect=set-popads-dummy,domain=example.org * ``` + * + * @added v1.0.4. */ export { setPopadsDummy }; diff --git a/src/redirects/static-redirects.yml b/src/redirects/static-redirects.yml index 118952a4e..300b04908 100644 --- a/src/redirects/static-redirects.yml +++ b/src/redirects/static-redirects.yml @@ -3,8 +3,10 @@ # add ";base64" into contentType if your source already in base64 - title: 1x1-transparent.gif + added: v1.0.4 description: |- **Example** + ``` ||example.org^$image,redirect=1x1-transparent.gif ``` @@ -17,8 +19,10 @@ content: R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== - title: 2x2-transparent.png + added: v1.0.4 description: |- **Example** + ``` ||example.org^$image,redirect=2x2-transparent.png ``` @@ -32,8 +36,10 @@ SUVORK5CYII= - title: 3x2-transparent.png + added: v1.0.4 description: |- **Example** + ``` ||example.org^$image,redirect=3x2-transparent.png ``` @@ -47,8 +53,10 @@ SUVORK5CYII= - title: 32x32-transparent.png + added: v1.0.4 description: |- **Example** + ``` ||example.org^$image,redirect=32x32-transparent.png ``` @@ -62,8 +70,10 @@ AO8GECAAAZf3V9cAAAAASUVORK5CYII= - title: noopframe + added: v1.0.4 description: |- **Example** + ``` ||example.com^$subdocument,redirect=noopframe,domain=example.org ``` @@ -80,8 +90,10 @@ - title: noopcss + added: v1.0.4 description: |- **Example** + ``` ||example.org/style.css$stylesheet,redirect=noopcss ``` @@ -93,6 +105,7 @@ content: '' - title: noopjs + added: v1.0.4 description: |- **Example** ``` @@ -106,6 +119,7 @@ content: (function() {})() - title: noopjson + added: v1.6.2 description: |- **Example** ``` @@ -116,8 +130,10 @@ content: '{}' - title: nooptext + added: v1.0.4 description: |- **Example** + ``` ||example.org/advert.js$xmlhttprequest,redirect=nooptext ``` @@ -129,6 +145,7 @@ content: '' - 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. @@ -143,10 +160,12 @@ content: '' - title: noopvmap-1.0 + added: v1.1.5 description: |- Redirects request to an empty VMAP response. **Example** + ``` ||example.org/vmap01.xml$xmlhttprequest,redirect=noopvmap-1.0 ``` @@ -157,6 +176,7 @@ content: - title: noopvast-2.0 + added: v1.0.10 description: |- Redirects request to an empty VAST 2.0 response. @@ -169,6 +189,7 @@ content: - title: noopvast-3.0 + added: v1.0.10 description: |- Redirects request to an empty VAST 3.0 response. @@ -181,6 +202,7 @@ content: - title: noopvast-4.0 + added: v1.4.3 description: |- Redirects request to an empty VAST 4.0 response. @@ -193,8 +215,10 @@ content: - title: noopmp3-0.1s + added: v1.0.4 description: |- **Example** + ``` ||example.org/advert.mp3$media,redirect=noopmp3-0.1s ``` @@ -224,8 +248,10 @@ VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV - title: noopmp4-1s + added: v1.0.4 description: |- **Example** + ``` ||example.org/advert.mp4$media,redirect=noopmp4-1s ``` diff --git a/src/scriptlets/abort-current-inline-script.js b/src/scriptlets/abort-current-inline-script.js index c3945816a..f42d398b1 100644 --- a/src/scriptlets/abort-current-inline-script.js +++ b/src/scriptlets/abort-current-inline-script.js @@ -16,6 +16,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet abort-current-inline-script + * * @description * Aborts an inline script when it attempts to **read** or **write to** the specified property * AND when the contents of the ` * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function abortCurrentInlineScript(source, property, search) { diff --git a/src/scriptlets/abort-on-property-read.js b/src/scriptlets/abort-on-property-read.js index 3f7e0101c..4af0e4a12 100644 --- a/src/scriptlets/abort-on-property-read.js +++ b/src/scriptlets/abort-on-property-read.js @@ -12,6 +12,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet abort-on-property-read + * * @description * Aborts a script when it attempts to **read** the specified property. * @@ -36,6 +37,8 @@ import { * ! Aborts script when it tries to access `navigator.language` * example.org#%#//scriptlet('abort-on-property-read', 'navigator.language') * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function abortOnPropertyRead(source, property) { diff --git a/src/scriptlets/abort-on-property-write.js b/src/scriptlets/abort-on-property-write.js index 32539845a..da3a2a662 100644 --- a/src/scriptlets/abort-on-property-write.js +++ b/src/scriptlets/abort-on-property-write.js @@ -12,6 +12,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet abort-on-property-write + * * @description * Aborts a script when it attempts to **write** the specified property. * @@ -33,6 +34,8 @@ import { * ! Aborts script when it tries to set `window.adblock` value * example.org#%#//scriptlet('abort-on-property-write', 'adblock') * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function abortOnPropertyWrite(source, property) { diff --git a/src/scriptlets/abort-on-stack-trace.js b/src/scriptlets/abort-on-stack-trace.js index 248e97e98..449efd88f 100644 --- a/src/scriptlets/abort-on-stack-trace.js +++ b/src/scriptlets/abort-on-stack-trace.js @@ -20,6 +20,7 @@ import { /* eslint-disable max-len */ /** * @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. * @@ -55,6 +56,8 @@ import { * ! Aborts script when it tries to access `window.Ya` and it's an injected script * example.org#%#//scriptlet('abort-on-stack-trace', 'Ya', 'injectedScript') * ``` + * + * @added v1.5.0. */ /* eslint-enable max-len */ export function abortOnStackTrace(source, property, stack) { diff --git a/src/scriptlets/adjust-setInterval.js b/src/scriptlets/adjust-setInterval.js index 4bdd55a9f..a5ff61e94 100644 --- a/src/scriptlets/adjust-setInterval.js +++ b/src/scriptlets/adjust-setInterval.js @@ -15,6 +15,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet adjust-setInterval + * * @description * Adjusts delay for specified setInterval() callbacks. * @@ -63,6 +64,8 @@ import { * ``` * example.org#%#//scriptlet('adjust-setInterval', '', '*', '0.02') * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function adjustSetInterval(source, matchCallback, matchDelay, boost) { diff --git a/src/scriptlets/adjust-setTimeout.js b/src/scriptlets/adjust-setTimeout.js index 4f6cf3889..1a24d94d2 100644 --- a/src/scriptlets/adjust-setTimeout.js +++ b/src/scriptlets/adjust-setTimeout.js @@ -15,6 +15,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet adjust-setTimeout + * * @description * Adjusts delay for specified setTimeout() callbacks. * @@ -63,6 +64,8 @@ import { * ``` * example.org#%#//scriptlet('adjust-setTimeout', 'test', '*') * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function adjustSetTimeout(source, matchCallback, matchDelay, boost) { diff --git a/src/scriptlets/close-window.js b/src/scriptlets/close-window.js index ff5592f88..26fb13090 100644 --- a/src/scriptlets/close-window.js +++ b/src/scriptlets/close-window.js @@ -6,6 +6,7 @@ import { /** * @scriptlet close-window + * * @description * Closes the browser tab immediately. * @@ -29,6 +30,8 @@ import { * ! closes specific example.org tab * example.org#%#//scriptlet('close-window', '/example-page.html') * ``` + * + * @added v1.5.0. */ export function forceWindowClose(source, path = '') { // https://github.com/AdguardTeam/Scriptlets/issues/158#issuecomment-993423036 diff --git a/src/scriptlets/debug-current-inline-script.js b/src/scriptlets/debug-current-inline-script.js index d2f9d492d..7bd3ffff5 100644 --- a/src/scriptlets/debug-current-inline-script.js +++ b/src/scriptlets/debug-current-inline-script.js @@ -14,6 +14,7 @@ import { /* eslint-disable max-len */ /** * @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. * @@ -24,6 +25,8 @@ import { * ! Aborts script when it tries to access `window.alert` * example.org#%#//scriptlet('debug-current-inline-script', 'alert') * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function debugCurrentInlineScript(source, property, search) { diff --git a/src/scriptlets/debug-on-property-read.js b/src/scriptlets/debug-on-property-read.js index b5bc8f61d..62872c599 100644 --- a/src/scriptlets/debug-on-property-read.js +++ b/src/scriptlets/debug-on-property-read.js @@ -13,6 +13,7 @@ import { /* eslint-disable max-len */ /** * @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. * @@ -25,6 +26,8 @@ import { * ! of `window.open` * example.org#%#//scriptlet('debug-on-property-read', 'open') * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function debugOnPropertyRead(source, property) { diff --git a/src/scriptlets/debug-on-property-write.js b/src/scriptlets/debug-on-property-write.js index 1064dbdb1..a45cc5a44 100644 --- a/src/scriptlets/debug-on-property-write.js +++ b/src/scriptlets/debug-on-property-write.js @@ -12,6 +12,7 @@ import { /* eslint-disable max-len */ /** * @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. * @@ -22,6 +23,8 @@ import { * ! Aborts script when it tries to write in property `window.test` * example.org#%#//scriptlet('debug-on-property-write', 'test') * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function debugOnPropertyWrite(source, property) { diff --git a/src/scriptlets/dir-string.js b/src/scriptlets/dir-string.js index 63de2609a..7b990b7d4 100644 --- a/src/scriptlets/dir-string.js +++ b/src/scriptlets/dir-string.js @@ -3,6 +3,7 @@ import { hit } from '../helpers/index'; /* eslint-disable max-len */ /** * @scriptlet dir-string + * * @description * Wraps the `console.dir` API to call the `toString` method of the argument. * There are several adblock circumvention systems that detect browser devtools @@ -24,6 +25,8 @@ import { hit } from '../helpers/index'; * ! Run 2 times * example.org#%#//scriptlet('dir-string', '2') * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function dirString(source, times) { diff --git a/src/scriptlets/disable-newtab-links.js b/src/scriptlets/disable-newtab-links.js index 5cc28ec80..18057ce43 100644 --- a/src/scriptlets/disable-newtab-links.js +++ b/src/scriptlets/disable-newtab-links.js @@ -2,6 +2,7 @@ import { hit } from '../helpers/index'; /** * @scriptlet disable-newtab-links + * * @description * Prevents opening new tabs and windows if there is `target` attribute in element. * @@ -12,6 +13,8 @@ import { hit } from '../helpers/index'; * ``` * example.org#%#//scriptlet('disable-newtab-links') * ``` + * + * @added v1.0.4. */ export function disableNewtabLinks(source) { document.addEventListener('click', (ev) => { diff --git a/src/scriptlets/hide-in-shadow-dom.js b/src/scriptlets/hide-in-shadow-dom.js index c424a071d..d79d283dc 100644 --- a/src/scriptlets/hide-in-shadow-dom.js +++ b/src/scriptlets/hide-in-shadow-dom.js @@ -11,6 +11,7 @@ import { /** * @scriptlet hide-in-shadow-dom + * * @description * Hides elements inside open shadow DOM elements. * @@ -34,6 +35,8 @@ import { * ! hides floating element * virustotal.com#%#//scriptlet('hide-in-shadow-dom', 'vt-ui-contact-fab') * ``` + * + * @added v1.3.0. */ export function hideInShadowDom(source, selector, baseSelector) { // do nothing if browser does not support ShadowRoot diff --git a/src/scriptlets/inject-css-in-shadow-dom.js b/src/scriptlets/inject-css-in-shadow-dom.js index c597d73a8..94f406e0d 100644 --- a/src/scriptlets/inject-css-in-shadow-dom.js +++ b/src/scriptlets/inject-css-in-shadow-dom.js @@ -7,6 +7,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet inject-css-in-shadow-dom + * * @description * Injects CSS rule into selected Shadow DOM subtrees on a page * @@ -29,6 +30,8 @@ import { * ``` * example.org#%#//scriptlet('inject-css-in-shadow-dom', '#content { margin-top: 0 !important; }', '.row > #hidden') * ``` + * + * @added v1.8.2. */ /* eslint-enable max-len */ diff --git a/src/scriptlets/json-prune.js b/src/scriptlets/json-prune.js index f38b3d20e..0b6526e56 100644 --- a/src/scriptlets/json-prune.js +++ b/src/scriptlets/json-prune.js @@ -12,8 +12,9 @@ import { /* eslint-disable max-len */ /** * @scriptlet json-prune + * * @description - * Removes specified properties from the result of calling JSON.parse and returns the caller + * Removes specified properties from the result of calling JSON.parse and returns the caller. * * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#json-prunejs- @@ -83,6 +84,8 @@ import { * ``` * example.org#%#//scriptlet('json-prune', '', '"id":"117458"') * ``` + * + * @added v1.1.0. */ /* eslint-enable max-len */ export function jsonPrune(source, propsToRemove, requiredInitialProps, stack) { diff --git a/src/scriptlets/log-addEventListener.js b/src/scriptlets/log-addEventListener.js index 354556ebf..f0b859988 100644 --- a/src/scriptlets/log-addEventListener.js +++ b/src/scriptlets/log-addEventListener.js @@ -13,6 +13,7 @@ import { /** * @scriptlet log-addEventListener + * * @description * Logs all addEventListener calls to the console. * @@ -23,6 +24,8 @@ import { * ``` * example.org#%#//scriptlet('log-addEventListener') * ``` + * + * @added v1.0.4. */ export function logAddEventListener(source) { const nativeAddEventListener = window.EventTarget.prototype.addEventListener; diff --git a/src/scriptlets/log-eval.js b/src/scriptlets/log-eval.js index 8da8ace95..de23e16d2 100644 --- a/src/scriptlets/log-eval.js +++ b/src/scriptlets/log-eval.js @@ -3,6 +3,7 @@ import { hit, logMessage } from '../helpers/index'; /** * @scriptlet log-eval + * * @description * Logs all `eval()` or `new Function()` calls to the console. * @@ -10,6 +11,8 @@ import { hit, logMessage } from '../helpers/index'; * ``` * example.org#%#//scriptlet('log-eval') * ``` + * + * @added v1.0.4. */ export function logEval(source) { // wrap eval function diff --git a/src/scriptlets/log-on-stack-trace.js b/src/scriptlets/log-on-stack-trace.js index 8bdd7d2b9..31a85028d 100644 --- a/src/scriptlets/log-on-stack-trace.js +++ b/src/scriptlets/log-on-stack-trace.js @@ -11,6 +11,7 @@ import { /* eslint-disable max-len */ /** * @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: * - function and source script names pairs that access the given property @@ -23,6 +24,8 @@ import { * ``` * * - `property` — required, path to a property. The property must be attached to window. + * + * @added v1.5.0. */ /* eslint-enable max-len */ export function logOnStacktrace(source, property) { diff --git a/src/scriptlets/log.js b/src/scriptlets/log.js index f7701a3ab..ac8cc6c35 100644 --- a/src/scriptlets/log.js +++ b/src/scriptlets/log.js @@ -1,5 +1,6 @@ /** * @scriptlet log + * * @description * A simple scriptlet which only purpose is to print arguments to console. * This scriptlet can be helpful for debugging and troubleshooting other scriptlets. @@ -8,6 +9,8 @@ * ``` * example.org#%#//scriptlet('log', 'arg1', 'arg2') * ``` + * + * @added v1.0.4. */ export function log(...args) { console.log(args); // eslint-disable-line no-console diff --git a/src/scriptlets/m3u-prune.js b/src/scriptlets/m3u-prune.js index fe4b0b10f..a31189914 100644 --- a/src/scriptlets/m3u-prune.js +++ b/src/scriptlets/m3u-prune.js @@ -41,6 +41,8 @@ import { * ``` * example.org#%#//scriptlet('m3u-prune', '', '.m3u8') * ``` + * + * @added v1.9.1. */ /* eslint-enable max-len */ diff --git a/src/scriptlets/no-topics.js b/src/scriptlets/no-topics.js index 6d8dd95e4..f3ef63280 100644 --- a/src/scriptlets/no-topics.js +++ b/src/scriptlets/no-topics.js @@ -5,6 +5,7 @@ import { /** * @scriptlet no-topics + * * @description * Prevents using The Topics API * https://developer.chrome.com/docs/privacy-sandbox/topics/ @@ -13,6 +14,8 @@ import { * ``` * example.org#%#//scriptlet('no-topics') * ``` + * + * @added v1.6.18. */ export function noTopics(source) { const TOPICS_PROPERTY_NAME = 'browsingTopics'; diff --git a/src/scriptlets/noeval.js b/src/scriptlets/noeval.js index 1d2b89f9e..66a2392e4 100644 --- a/src/scriptlets/noeval.js +++ b/src/scriptlets/noeval.js @@ -3,6 +3,7 @@ import { hit, logMessage } from '../helpers/index'; /** * @scriptlet noeval + * * @description * Prevents page to use eval. * Notifies about attempts in the console @@ -17,6 +18,8 @@ import { hit, logMessage } from '../helpers/index'; * ``` * example.org#%#//scriptlet('noeval') * ``` + * + * @added v1.0.4. */ export function noeval(source) { window.eval = function evalWrapper(s) { diff --git a/src/scriptlets/nowebrtc.js b/src/scriptlets/nowebrtc.js index 376d879a9..17c2957c8 100644 --- a/src/scriptlets/nowebrtc.js +++ b/src/scriptlets/nowebrtc.js @@ -9,6 +9,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet nowebrtc + * * @description * Disables WebRTC by overriding `RTCPeerConnection`. The overridden function will log every attempt to create a new connection. * @@ -19,6 +20,8 @@ import { * ``` * example.org#%#//scriptlet('nowebrtc') * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function nowebrtc(source) { diff --git a/src/scriptlets/prevent-addEventListener.js b/src/scriptlets/prevent-addEventListener.js index 937a30711..06ac9cdf8 100644 --- a/src/scriptlets/prevent-addEventListener.js +++ b/src/scriptlets/prevent-addEventListener.js @@ -9,6 +9,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet prevent-addEventListener + * * @description * Prevents adding event listeners for the specified events and callbacks. * @@ -43,6 +44,8 @@ import { * window.test = 'searchString'; * }); * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function preventAddEventListener(source, typeSearch, listenerSearch) { diff --git a/src/scriptlets/prevent-adfly.js b/src/scriptlets/prevent-adfly.js index a6e1d7fd3..4ab787d4e 100644 --- a/src/scriptlets/prevent-adfly.js +++ b/src/scriptlets/prevent-adfly.js @@ -7,6 +7,7 @@ import { /** * @scriptlet prevent-adfly + * * @description * Prevents anti-adblock scripts on adfly short links. * @@ -17,6 +18,8 @@ import { * ``` * example.org#%#//scriptlet('prevent-adfly') * ``` + * + * @added v1.0.4. */ export function preventAdfly(source) { const isDigit = (data) => /^\d$/.test(data); diff --git a/src/scriptlets/prevent-bab.js b/src/scriptlets/prevent-bab.js index b0ac712f0..91d8ce751 100644 --- a/src/scriptlets/prevent-bab.js +++ b/src/scriptlets/prevent-bab.js @@ -3,6 +3,7 @@ import { hit } from '../helpers/index'; /** * @scriptlet prevent-bab + * * @description * Prevents BlockAdblock script from detecting an ad blocker. * @@ -16,6 +17,8 @@ import { hit } from '../helpers/index'; * ``` * example.org#%#//scriptlet('prevent-bab') * ``` + * + * @added v1.0.4. */ export function preventBab(source) { const nativeSetTimeout = window.setTimeout; diff --git a/src/scriptlets/prevent-element-src-loading.js b/src/scriptlets/prevent-element-src-loading.js index df99bdb4c..7dc1606e9 100644 --- a/src/scriptlets/prevent-element-src-loading.js +++ b/src/scriptlets/prevent-element-src-loading.js @@ -8,6 +8,7 @@ import { /* eslint-disable max-len, consistent-return */ /** * @scriptlet prevent-element-src-loading + * * @description * Prevents target element source loading without triggering 'onerror' listeners and not breaking 'onload' ones. * @@ -27,6 +28,8 @@ import { * ``` * example.org#%#//scriptlet('prevent-element-src-loading', 'script' ,'adsbygoogle') * ``` + * + * @added v1.6.2. */ /* eslint-enable max-len */ export function preventElementSrcLoading(source, tagName, match) { diff --git a/src/scriptlets/prevent-eval-if.js b/src/scriptlets/prevent-eval-if.js index 5e3024ae5..8c8c12082 100644 --- a/src/scriptlets/prevent-eval-if.js +++ b/src/scriptlets/prevent-eval-if.js @@ -4,6 +4,7 @@ import { toRegExp, hit } from '../helpers/index'; /** * @scriptlet prevent-eval-if + * * @description * Prevents page to use eval matching payload. * @@ -24,6 +25,8 @@ import { toRegExp, hit } from '../helpers/index'; * ! Prevents eval if it matches 'test' * example.org#%#//scriptlet('prevent-eval-if', 'test') * ``` + * + * @added v1.0.4. */ export function preventEvalIf(source, search) { const searchRegexp = toRegExp(search); diff --git a/src/scriptlets/prevent-fab-3.2.0.js b/src/scriptlets/prevent-fab-3.2.0.js index 19eafc1ed..ef0f88cb0 100644 --- a/src/scriptlets/prevent-fab-3.2.0.js +++ b/src/scriptlets/prevent-fab-3.2.0.js @@ -3,6 +3,7 @@ import { hit, noopFunc, noopThis } from '../helpers/index'; /** * @scriptlet prevent-fab-3.2.0 + * * @description * Prevents execution of the FAB script v3.2.0. * @@ -13,6 +14,8 @@ import { hit, noopFunc, noopThis } from '../helpers/index'; * ``` * example.org#%#//scriptlet('prevent-fab-3.2.0') * ``` + * + * @added v1.0.4. */ export function preventFab(source) { hit(source); diff --git a/src/scriptlets/prevent-fetch.js b/src/scriptlets/prevent-fetch.js index b9bf54048..8df086e89 100644 --- a/src/scriptlets/prevent-fetch.js +++ b/src/scriptlets/prevent-fetch.js @@ -23,6 +23,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet prevent-fetch + * * @description * Prevents `fetch` calls if **all** given parameters match. * @@ -94,6 +95,8 @@ import { * ``` * example.org#%#//scriptlet('prevent-fetch', '*', '', 'opaque') * ``` + * + * @added v1.3.18. */ /* eslint-enable max-len */ export function preventFetch(source, propsToMatch, responseBody = 'emptyObj', responseType) { diff --git a/src/scriptlets/prevent-popads-net.js b/src/scriptlets/prevent-popads-net.js index bbabf584b..cb7e39540 100644 --- a/src/scriptlets/prevent-popads-net.js +++ b/src/scriptlets/prevent-popads-net.js @@ -4,6 +4,7 @@ import { /** * @scriptlet prevent-popads-net + * * @description * Aborts on property write (PopAds, popns), throws reference error with random id. * @@ -14,6 +15,8 @@ import { * ``` * example.org#%#//scriptlet('prevent-popads-net') * ``` + * + * @added v1.0.4. */ export function preventPopadsNet(source) { const rid = randomId(); diff --git a/src/scriptlets/prevent-refresh.js b/src/scriptlets/prevent-refresh.js index 082e58585..12198ab22 100644 --- a/src/scriptlets/prevent-refresh.js +++ b/src/scriptlets/prevent-refresh.js @@ -9,6 +9,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet prevent-refresh + * * @description * Prevents reloading of a document through a meta "refresh" tag. * @@ -32,6 +33,8 @@ import { * ``` * cryptodirectories.com#%#//scriptlet('prevent-refresh', 3) * ``` + * + * @added v1.6.2. */ /* eslint-enable max-len */ export function preventRefresh(source, delaySec) { diff --git a/src/scriptlets/prevent-requestAnimationFrame.js b/src/scriptlets/prevent-requestAnimationFrame.js index 7b94a8790..268107f63 100644 --- a/src/scriptlets/prevent-requestAnimationFrame.js +++ b/src/scriptlets/prevent-requestAnimationFrame.js @@ -14,6 +14,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet prevent-requestAnimationFrame + * * @description * Prevents a `requestAnimationFrame` call * if the text of the callback is matching the specified search string which does not start with `!`; @@ -77,6 +78,8 @@ import { * } * }); * ``` + * + * @added v1.1.15. */ /* eslint-enable max-len */ diff --git a/src/scriptlets/prevent-setInterval.js b/src/scriptlets/prevent-setInterval.js index 81a97a4d7..9fea16ea0 100644 --- a/src/scriptlets/prevent-setInterval.js +++ b/src/scriptlets/prevent-setInterval.js @@ -21,6 +21,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet prevent-setInterval + * * @description * Prevents a `setInterval` call if: * 1) the text of the callback is matching the specified `matchCallback` string/regexp which does not start with `!`; @@ -134,6 +135,8 @@ import { * window.test = "value"; * }, 300 + Math.random()); * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function preventSetInterval(source, matchCallback, matchDelay) { diff --git a/src/scriptlets/prevent-setTimeout.js b/src/scriptlets/prevent-setTimeout.js index d5e7b105d..aa42fc020 100644 --- a/src/scriptlets/prevent-setTimeout.js +++ b/src/scriptlets/prevent-setTimeout.js @@ -21,6 +21,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet prevent-setTimeout + * * @description * Prevents a `setTimeout` call if: * 1) the text of the callback is matching the specified `matchCallback` string/regexp which does not start with `!`; @@ -134,6 +135,8 @@ import { * window.test = "value"; * }, 300 + Math.random()); * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function preventSetTimeout(source, matchCallback, matchDelay) { diff --git a/src/scriptlets/prevent-window-open.js b/src/scriptlets/prevent-window-open.js index b0c8b34cf..9e2c0d95f 100644 --- a/src/scriptlets/prevent-window-open.js +++ b/src/scriptlets/prevent-window-open.js @@ -23,6 +23,7 @@ import { /* eslint-disable max-len */ /** * @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. * @@ -79,6 +80,8 @@ import { * ``` * * > For better compatibility with uBO, old syntax is not recommended to use. + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function preventWindowOpen(source, match = '*', delay, replacement) { diff --git a/src/scriptlets/prevent-xhr.js b/src/scriptlets/prevent-xhr.js index 43c99245b..2f253c4a5 100644 --- a/src/scriptlets/prevent-xhr.js +++ b/src/scriptlets/prevent-xhr.js @@ -25,6 +25,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet prevent-xhr + * * @description * Prevents `xhr` calls if **all** given parameters match. * @@ -86,6 +87,8 @@ import { * ``` * example.org#%#//scriptlet('prevent-xhr', 'example.org', 'length:100-300') * ``` + * + * @added v1.5.0. */ /* eslint-enable max-len */ export function preventXHR(source, propsToMatch, customResponseText) { diff --git a/src/scriptlets/remove-attr.js b/src/scriptlets/remove-attr.js index 5049b4649..24351e6f6 100644 --- a/src/scriptlets/remove-attr.js +++ b/src/scriptlets/remove-attr.js @@ -11,6 +11,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet remove-attr + * * @description * Removes the specified attributes from DOM nodes. This scriptlet runs once when the page loads * and after that periodically in order to DOM tree changes by default, @@ -66,6 +67,8 @@ import { * ``` * example.org#%#//scriptlet('remove-attr', 'example', 'html', 'asap complete') * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function removeAttr(source, attrs, selector, applying = 'asap stay') { diff --git a/src/scriptlets/remove-class.js b/src/scriptlets/remove-class.js index e2f3f4b63..dcb4be2a4 100644 --- a/src/scriptlets/remove-class.js +++ b/src/scriptlets/remove-class.js @@ -11,6 +11,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet remove-class + * * @description * Removes the specified classes from DOM nodes. This scriptlet runs once after the page loads * and after that periodically in order to DOM tree changes. @@ -70,6 +71,8 @@ import { * ``` * example.org#%#//scriptlet('remove-class', 'branding', 'div[class^="inner"]', 'asap complete') * ``` + * + * @added v1.1.1. */ /* eslint-enable max-len */ diff --git a/src/scriptlets/remove-cookie.js b/src/scriptlets/remove-cookie.js index 1edac968d..9b1edb7db 100644 --- a/src/scriptlets/remove-cookie.js +++ b/src/scriptlets/remove-cookie.js @@ -3,6 +3,7 @@ import { hit, toRegExp } from '../helpers/index'; /* eslint-disable max-len */ /** * @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. * @@ -32,6 +33,8 @@ import { hit, toRegExp } from '../helpers/index'; * ```javascript * document.cookie = '__example=randomValue'; * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function removeCookie(source, match) { diff --git a/src/scriptlets/remove-in-shadow-dom.js b/src/scriptlets/remove-in-shadow-dom.js index fca9b0ea2..372d0cf4e 100644 --- a/src/scriptlets/remove-in-shadow-dom.js +++ b/src/scriptlets/remove-in-shadow-dom.js @@ -11,6 +11,7 @@ import { /** * @scriptlet remove-in-shadow-dom + * * @description * Removes elements inside open shadow DOM elements. * @@ -34,6 +35,8 @@ import { * ! removes floating element * virustotal.com#%#//scriptlet('remove-in-shadow-dom', 'vt-ui-contact-fab') * ``` + * + * @added v1.3.14. */ export function removeInShadowDom(source, selector, baseSelector) { // do nothing if browser does not support ShadowRoot diff --git a/src/scriptlets/set-attr.js b/src/scriptlets/set-attr.js index 769bfa9a9..699963036 100644 --- a/src/scriptlets/set-attr.js +++ b/src/scriptlets/set-attr.js @@ -10,6 +10,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet set-attr + * * @description * 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. @@ -75,6 +76,8 @@ import { * * Some text * ``` + * + * @added v1.5.0. */ /* eslint-enable max-len */ export function setAttr(source, selector, attr, value = '') { diff --git a/src/scriptlets/set-constant.js b/src/scriptlets/set-constant.js index 0049314ca..837a46c28 100644 --- a/src/scriptlets/set-constant.js +++ b/src/scriptlets/set-constant.js @@ -25,6 +25,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet set-constant + * * @description * Creates a constant property and assigns it one of the values from the predefined list. * @@ -89,6 +90,8 @@ import { * * ✔ document.third() === true // if the condition described above is met * ``` + * + * @added v1.0.4. */ /* eslint-enable max-len */ export function setConstant(source, property, value, stack) { diff --git a/src/scriptlets/set-cookie-reload.js b/src/scriptlets/set-cookie-reload.js index 8cc876a60..b5dc64365 100644 --- a/src/scriptlets/set-cookie-reload.js +++ b/src/scriptlets/set-cookie-reload.js @@ -13,6 +13,7 @@ import { /** * @scriptlet set-cookie-reload + * * @description * Sets a cookie with the specified name and value, and path, * and reloads the current page after the cookie setting. @@ -47,6 +48,8 @@ import { * * example.org#%#//scriptlet('set-cookie-reload', 'cookie-set', 'true', 'none') * ``` + * + * @added v1.3.14. */ export function setCookieReload(source, name, value, path = '/') { if (isCookieSetWithValue(document.cookie, name, value)) { diff --git a/src/scriptlets/set-cookie.js b/src/scriptlets/set-cookie.js index 6f75fc5d9..573ff68b6 100644 --- a/src/scriptlets/set-cookie.js +++ b/src/scriptlets/set-cookie.js @@ -14,6 +14,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet set-cookie + * * @description * Sets a cookie with the specified name, value, and path. * @@ -46,6 +47,8 @@ import { * * example.org#%#//scriptlet('set-cookie', 'cookie_consent', 'ok', 'none') * ``` + * + * @added v1.2.3. */ /* eslint-enable max-len */ export function setCookie(source, name, value, path = '/') { diff --git a/src/scriptlets/set-local-storage-item.js b/src/scriptlets/set-local-storage-item.js index 31989bb78..d97fb460c 100644 --- a/src/scriptlets/set-local-storage-item.js +++ b/src/scriptlets/set-local-storage-item.js @@ -9,6 +9,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet set-local-storage-item + * * @description * 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. @@ -38,6 +39,8 @@ import { * * example.org#%#//scriptlet('set-local-storage-item', 'exit-intent-marketing', '1') * ``` + * + * @added v1.4.3. */ /* eslint-enable max-len */ diff --git a/src/scriptlets/set-popads-dummy.js b/src/scriptlets/set-popads-dummy.js index ec8d49bd6..d6487b088 100644 --- a/src/scriptlets/set-popads-dummy.js +++ b/src/scriptlets/set-popads-dummy.js @@ -3,6 +3,7 @@ import { hit } from '../helpers/index'; /** * @scriptlet set-popads-dummy + * * @description * Sets static properties PopAds and popns. * @@ -13,6 +14,8 @@ import { hit } from '../helpers/index'; * ``` * example.org#%#//scriptlet('set-popads-dummy') * ``` + * + * @added v1.0.4. */ export function setPopadsDummy(source) { delete window.PopAds; diff --git a/src/scriptlets/set-session-storage-item.js b/src/scriptlets/set-session-storage-item.js index 2c25c9079..33adee8dd 100644 --- a/src/scriptlets/set-session-storage-item.js +++ b/src/scriptlets/set-session-storage-item.js @@ -9,6 +9,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet set-session-storage-item + * * @description * 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. @@ -38,6 +39,8 @@ import { * * example.org#%#//scriptlet('set-session-storage-item', 'exit-intent-marketing', '1') * ``` + * + * @added v1.4.3. */ /* eslint-enable max-len */ diff --git a/src/scriptlets/trusted-click-element.js b/src/scriptlets/trusted-click-element.js index 16e5bd626..1e8c98fd3 100644 --- a/src/scriptlets/trusted-click-element.js +++ b/src/scriptlets/trusted-click-element.js @@ -10,6 +10,7 @@ import { /* eslint-disable max-len */ /** * @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. * Deactivates after all elements have been clicked or by 10s timeout. @@ -72,6 +73,8 @@ import { * ``` * example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', '!cookie:cmpconsent, !localStorage:promo') * ``` + * + * @added v1.7.3. */ /* eslint-enable max-len */ export function trustedClickElement(source, selectors, extraMatch = '', delay = NaN) { diff --git a/src/scriptlets/trusted-replace-fetch-response.js b/src/scriptlets/trusted-replace-fetch-response.js index a6aad8c4d..f3a809787 100644 --- a/src/scriptlets/trusted-replace-fetch-response.js +++ b/src/scriptlets/trusted-replace-fetch-response.js @@ -22,6 +22,7 @@ import { /* eslint-disable max-len */ /** * @trustedScriptlet trusted-replace-fetch-response + * * @description * Replaces response text content of `fetch` requests if **all** given parameters match. * @@ -73,6 +74,8 @@ import { * ``` * example.org#%#//scriptlet('trusted-replace-fetch-response', '*', '', 'example.com') * ``` + * + * @added v1.7.3. */ /* eslint-enable max-len */ export function trustedReplaceFetchResponse(source, pattern = '', replacement = '', propsToMatch = '') { diff --git a/src/scriptlets/trusted-replace-xhr-response.js b/src/scriptlets/trusted-replace-xhr-response.js index 674549f1c..980ed90b1 100644 --- a/src/scriptlets/trusted-replace-xhr-response.js +++ b/src/scriptlets/trusted-replace-xhr-response.js @@ -20,6 +20,7 @@ import { /* eslint-disable max-len */ /** * @trustedScriptlet trusted-replace-xhr-response + * * @description * Replaces response content of `xhr` requests if **all** given parameters match. * @@ -68,6 +69,8 @@ import { * ``` * example.org#%#//scriptlet('trusted-replace-xhr-response', '*', '', 'example.com') * ``` + * + * @added v1.7.3. */ /* eslint-enable max-len */ export function trustedReplaceXhrResponse(source, pattern = '', replacement = '', propsToMatch = '') { diff --git a/src/scriptlets/trusted-set-constant.js b/src/scriptlets/trusted-set-constant.js index f1daf729a..6e7186b4c 100644 --- a/src/scriptlets/trusted-set-constant.js +++ b/src/scriptlets/trusted-set-constant.js @@ -26,6 +26,7 @@ import { /* eslint-disable max-len */ /** * @trustedScriptlet trusted-set-constant + * * @description * Creates a constant property and assigns it a specified value. * @@ -79,6 +80,8 @@ import { * * ✔ document.first === 1 // if the condition described above is met * ``` + * + * @added v1.8.2. */ /* eslint-enable max-len */ export function trustedSetConstant(source, property, value, stack) { diff --git a/src/scriptlets/trusted-set-cookie-reload.js b/src/scriptlets/trusted-set-cookie-reload.js index a1caf9501..9578b72e6 100644 --- a/src/scriptlets/trusted-set-cookie-reload.js +++ b/src/scriptlets/trusted-set-cookie-reload.js @@ -16,6 +16,7 @@ import { /* eslint-disable max-len */ /** * @trustedScriptlet trusted-set-cookie-reload + * * @description * Sets a cookie with arbitrary name and value, * and with optional ability to offset cookie attribute 'expires' and set path. @@ -70,6 +71,8 @@ import { * ``` * example.org#%#//scriptlet('trusted-set-cookie-reload', 'cmpconsent', 'decline', '', 'none') * ``` + * + * @added v1.7.10. */ /* eslint-enable max-len */ diff --git a/src/scriptlets/trusted-set-cookie.js b/src/scriptlets/trusted-set-cookie.js index 397a3cc76..9f1c6784c 100644 --- a/src/scriptlets/trusted-set-cookie.js +++ b/src/scriptlets/trusted-set-cookie.js @@ -15,6 +15,7 @@ import { /* eslint-disable max-len */ /** * @trustedScriptlet trusted-set-cookie + * * @description * Sets a cookie with arbitrary name and value, * and with optional ability to offset cookie attribute 'expires' and set path. @@ -68,6 +69,8 @@ import { * ``` * example.org#%#//scriptlet('trusted-set-cookie', 'cmpconsent', 'decline', '', 'none') * ``` + * + * @added v1.7.3. */ /* eslint-enable max-len */ diff --git a/src/scriptlets/trusted-set-local-storage-item.js b/src/scriptlets/trusted-set-local-storage-item.js index 7ef16c2d8..5bfef6ca8 100644 --- a/src/scriptlets/trusted-set-local-storage-item.js +++ b/src/scriptlets/trusted-set-local-storage-item.js @@ -9,6 +9,7 @@ import { /* eslint-disable max-len */ /** * @trustedScriptlet trusted-set-local-storage-item + * * @description * 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. @@ -50,6 +51,8 @@ import { * ``` * example.org#%#//scriptlet('trusted-set-local-storage-item', 'ppu_main_none', '') * ``` + * + * @added v1.7.3. */ /* eslint-enable max-len */ diff --git a/src/scriptlets/xml-prune.js b/src/scriptlets/xml-prune.js index 6efd8450d..2b2b1c55e 100644 --- a/src/scriptlets/xml-prune.js +++ b/src/scriptlets/xml-prune.js @@ -7,6 +7,7 @@ import { /* eslint-disable max-len */ /** * @scriptlet xml-prune + * * @description * Removes an element from the specified XML. * @@ -46,6 +47,8 @@ import { * ``` * example.org#%#//scriptlet('xml-prune', '', '', '.mpd') * ``` + * + * @added 1.7.3. */ /* eslint-enable max-len */