Skip to content

Commit

Permalink
Revert changes in wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamWr committed Oct 18, 2022
1 parent 0a48e7a commit 8e1ea58
Showing 1 changed file with 0 additions and 57 deletions.
57 changes: 0 additions & 57 deletions wiki/about-scriptlets.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
* [set-local-storage-item](#set-local-storage-item)
* [set-popads-dummy](#set-popads-dummy)
* [set-session-storage-item](#set-session-storage-item)
* [trusted-click-element](#trusted-click-element)
* [xml-prune](#xml-prune)
* * *
### <a id="abort-current-inline-script"></a> ⚡️ abort-current-inline-script
Expand Down Expand Up @@ -1696,61 +1695,6 @@ example.org#%#//scriptlet('set-session-storage-item', 'exit-intent-marketing', '
[Scriptlet source](../src/scriptlets/set-session-storage-item.js)
* * *
### <a id="trusted-click-element"></a> ⚡️ trusted-click-element
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**
```
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.
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**
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')
```
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')
```
4. Match cookies by keys using regex and string
```
example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', 'cookie:userConsentCommunity, cookie:/cmpconsent|cmp/')
```
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}/')
```
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')
```
[Scriptlet source](../src/scriptlets/trusted-click-element.js)
* * *
### <a id="xml-prune"></a> ⚡️ xml-prune
Removes an element from the specified XML.
Expand Down Expand Up @@ -1795,4 +1739,3 @@ which is useful for debugging but prohibited for production filter lists.
[Scriptlet source](../src/scriptlets/xml-prune.js)
* * *

0 comments on commit 8e1ea58

Please # to comment.