Skip to content

Commit 0cb8ddf

Browse files
committed
Fix description of few trusted scriptlets
Squashed commit of the following: commit bed3757 Author: Adam Wróblewski <[email protected]> Date: Tue Jul 23 16:51:08 2024 +0200 Fix description of few trusted scriptlets
1 parent fbdc5d5 commit 0cb8ddf

3 files changed

+17
-5
lines changed

src/scriptlets/trusted-create-element.ts

+11-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ import type { ParsedAttributePair } from '../helpers/attribute-utils';
1818
*
1919
* ### Syntax
2020
*
21+
* <!-- markdownlint-disable line-length -->
22+
*
2123
* ```text
22-
* example.com#%#//scriptlet('trusted-create-element', parentSelector, tagName[, attributePairs[, textContent[, cleanupDelayMs]]]) <!-- markdownlint-disable-line line-length -->
24+
* example.com#%#//scriptlet('trusted-create-element', parentSelector, tagName[, attributePairs[, textContent[, cleanupDelayMs]]])
2325
* ```
2426
*
27+
* <!-- markdownlint-enable line-length -->
28+
*
2529
* - `parentSelector` — required, CSS selector of the parent element to append the created element to.
2630
* - `tagName` — required, tag name of the created element.
2731
* - `attributePairs` — optional, space-separated list of attribute name and value pairs separated by `=`.
@@ -48,10 +52,14 @@ import type { ParsedAttributePair } from '../helpers/attribute-utils';
4852
*
4953
* 1. Create a button element with multiple attributes, including attribute without value, and text content
5054
*
55+
* <!-- markdownlint-disable line-length -->
56+
*
5157
* ```adblock
52-
* example.com#%#//scriptlet('trusted-create-element', 'body', 'button', 'disabled aria-hidden="true" style="width: 0px"', 'Press here') <!-- markdownlint-disable-line line-length -->
58+
* example.com#%#//scriptlet('trusted-create-element', 'body', 'button', 'disabled aria-hidden="true" style="width: 0px"', 'Press here')
5359
* ```
5460
*
61+
* <!-- markdownlint-enable line-length -->
62+
*
5563
* 1. Create a button element with an attribute whose value contains quotes
5664
*
5765
* ```adblock
@@ -61,7 +69,7 @@ import type { ParsedAttributePair } from '../helpers/attribute-utils';
6169
* 1. Create a paragraph element with text content and remove it after 5 seconds
6270
*
6371
* ```adblock
64-
* example.com#%#//scriptlet('trusted-create-element', '.container > article', 'p', '', 'Hello world!', 5000)
72+
* example.com#%#//scriptlet('trusted-create-element', '.container > article', 'p', '', 'Hello world!', '5000')
6573
* ```
6674
*
6775
* @added v1.10.1.

src/scriptlets/trusted-replace-outbound-text.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ import {
9393
* 1. Call with `decodeMethod` and `logContent` arguments will log original and decoded text content of the specified function:
9494
*
9595
* ```adblock
96-
* example.org#%#//scriptlet('trusted-replace-outbound-text', 'Array.prototype.join', '', '', 'base64' , '', 'true')
96+
* example.org#%#//scriptlet('trusted-replace-outbound-text', 'Array.prototype.join', '', '', 'base64', '', 'true')
9797
* ```
9898
*
9999
* 1. Call with only first argument will log text content of the specified function:

src/scriptlets/trusted-replace-xhr-response.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,14 @@ import {
7676
*
7777
* 1. Replace text content of XMLHttpRequests matching by URL regex and request methods
7878
*
79+
* <!-- markdownlint-disable line-length -->
80+
*
7981
* ```adblock
80-
* example.org#%#//scriptlet('trusted-replace-xhr-response', '/#EXT-X-VMAP-AD-BREAK[\s\S]*?/', '#EXT-X-ENDLIST', '/\.m3u8/ method:/GET|HEAD/') <!-- markdownlint-disable-line line-length -->
82+
* example.org#%#//scriptlet('trusted-replace-xhr-response', '/#EXT-X-VMAP-AD-BREAK[\s\S]*?/', '#EXT-X-ENDLIST', '/\.m3u8/ method:/GET|HEAD/')
8183
* ```
8284
*
85+
* <!-- markdownlint-enable line-length -->
86+
*
8387
* 1. Remove all text content of all XMLHttpRequests for example.com
8488
*
8589
* ```adblock

0 commit comments

Comments
 (0)