Skip to content

Commit

Permalink
fix some scriptlets wiki page anchors
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 1facb64
Author: Slava Leleka <v.leleka@adguard.com>
Date:   Wed Jan 11 19:55:16 2023 +0200

    update scriptlets wiki page

commit 34a54f9
Author: Slava Leleka <v.leleka@adguard.com>
Date:   Wed Jan 11 19:54:54 2023 +0200

    fix build docs script
  • Loading branch information
slavaleleka committed Jan 12, 2023
1 parent 4e560ef commit 515a563
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
6 changes: 4 additions & 2 deletions scripts/build-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ const getMarkdownData = (dataItems) => {
description,
source,
}) => {
acc.list.push(`* [${name}](#${name})${EOL}`);
// low case name should be used as anchor
acc.list.push(`* [${name}](#${name.toLowerCase()})${EOL}`);

const typeOfSrc = type.toLowerCase().includes('scriptlet') ? 'Scriptlet' : 'Redirect';

const body = `### <a id="${name}"></a> ⚡️ ${name}
// low case name should be used as anchor
const body = `### <a id="${name.toLowerCase()}"></a> ⚡️ ${name}
${description}${EOL}
[${typeOfSrc} source](${source})
* * *${EOL}${EOL}`;
Expand Down
28 changes: 14 additions & 14 deletions wiki/about-scriptlets.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* [abort-on-property-read](#abort-on-property-read)
* [abort-on-property-write](#abort-on-property-write)
* [abort-on-stack-trace](#abort-on-stack-trace)
* [adjust-setInterval](#adjust-setInterval)
* [adjust-setTimeout](#adjust-setTimeout)
* [adjust-setInterval](#adjust-setinterval)
* [adjust-setTimeout](#adjust-settimeout)
* [close-window](#close-window)
* [debug-current-inline-script](#debug-current-inline-script)
* [debug-on-property-read](#debug-on-property-read)
Expand All @@ -13,14 +13,14 @@
* [disable-newtab-links](#disable-newtab-links)
* [hide-in-shadow-dom](#hide-in-shadow-dom)
* [json-prune](#json-prune)
* [log-addEventListener](#log-addEventListener)
* [log-addEventListener](#log-addeventlistener)
* [log-eval](#log-eval)
* [log-on-stack-trace](#log-on-stack-trace)
* [log](#log)
* [no-topics](#no-topics)
* [noeval](#noeval)
* [nowebrtc](#nowebrtc)
* [prevent-addEventListener](#prevent-addEventListener)
* [prevent-addEventListener](#prevent-addeventlistener)
* [prevent-adfly](#prevent-adfly)
* [prevent-bab](#prevent-bab)
* [prevent-element-src-loading](#prevent-element-src-loading)
Expand All @@ -29,9 +29,9 @@
* [prevent-fetch](#prevent-fetch)
* [prevent-popads-net](#prevent-popads-net)
* [prevent-refresh](#prevent-refresh)
* [prevent-requestAnimationFrame](#prevent-requestAnimationFrame)
* [prevent-setInterval](#prevent-setInterval)
* [prevent-setTimeout](#prevent-setTimeout)
* [prevent-requestAnimationFrame](#prevent-requestanimationframe)
* [prevent-setInterval](#prevent-setinterval)
* [prevent-setTimeout](#prevent-settimeout)
* [prevent-window-open](#prevent-window-open)
* [prevent-xhr](#prevent-xhr)
* [remove-attr](#remove-attr)
Expand Down Expand Up @@ -205,7 +205,7 @@ example.org#%#//scriptlet('abort-on-stack-trace', 'Ya', 'injectedScript')
[Scriptlet source](../src/scriptlets/abort-on-stack-trace.js)
* * *
### <a id="adjust-setInterval"></a> ⚡️ adjust-setInterval
### <a id="adjust-setinterval"></a> ⚡️ adjust-setInterval
Adjusts delay for specified setInterval() callbacks.
Expand Down Expand Up @@ -254,7 +254,7 @@ defaults to match all callbacks; invalid regular expression will cause exit and
[Scriptlet source](../src/scriptlets/adjust-setInterval.js)
* * *

### <a id="adjust-setTimeout"></a> ⚡️ adjust-setTimeout
### <a id="adjust-settimeout"></a> ⚡️ adjust-setTimeout

Adjusts delay for specified setTimeout() callbacks.

Expand Down Expand Up @@ -523,7 +523,7 @@ e.g. 'ad.*.src' instead of 'ad.0.src ad.1.src ad.2.src ...'
[Scriptlet source](../src/scriptlets/json-prune.js)
* * *

### <a id="log-addEventListener"></a> ⚡️ log-addEventListener
### <a id="log-addeventlistener"></a> ⚡️ log-addEventListener

Logs all addEventListener calls to the console.

Expand Down Expand Up @@ -627,7 +627,7 @@ example.org#%#//scriptlet('nowebrtc')
[Scriptlet source](../src/scriptlets/nowebrtc.js)
* * *
### <a id="prevent-addEventListener"></a> ⚡️ prevent-addEventListener
### <a id="prevent-addeventlistener"></a> ⚡️ prevent-addEventListener
Prevents adding event listeners for the specified events and callbacks.
Expand Down Expand Up @@ -878,7 +878,7 @@ example.org#%#//scriptlet('prevent-refresh'[, delay])
[Scriptlet source](../src/scriptlets/prevent-refresh.js)
* * *

### <a id="prevent-requestAnimationFrame"></a> ⚡️ prevent-requestAnimationFrame
### <a id="prevent-requestanimationframe"></a> ⚡️ prevent-requestAnimationFrame

Prevents a `requestAnimationFrame` call
if the text of the callback is matching the specified search string which does not start with `!`;
Expand Down Expand Up @@ -946,7 +946,7 @@ So do not use the scriptlet without any parameter in production filter lists.
[Scriptlet source](../src/scriptlets/prevent-requestAnimationFrame.js)
* * *
### <a id="prevent-setInterval"></a> ⚡️ prevent-setInterval
### <a id="prevent-setinterval"></a> ⚡️ prevent-setInterval
Prevents a `setInterval` call if:
1) the text of the callback is matching the specified `matchCallback` string/regexp which does not start with `!`;
Expand Down Expand Up @@ -1048,7 +1048,7 @@ and obviously it can not be matched by `matchCallback`.
[Scriptlet source](../src/scriptlets/prevent-setInterval.js)
* * *
### <a id="prevent-setTimeout"></a> ⚡️ prevent-setTimeout
### <a id="prevent-settimeout"></a> ⚡️ prevent-setTimeout
Prevents a `setTimeout` call if:
1) the text of the callback is matching the specified `matchCallback` string/regexp which does not start with `!`;
Expand Down

0 comments on commit 515a563

Please sign in to comment.