Skip to content

Commit 978bf5a

Browse files
author
Atlassian Bamboo
committed
deploy: update docs for v2.3.1
1 parent c75c18f commit 978bf5a

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

wiki/about-scriptlets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ https://github.com/gorhill/uBlock/wiki/Resources-Library#disable-newtab-linksjs-
647647
example.org#%#//scriptlet('disable-newtab-links')
648648
```
649649

650-
[Scriptlet source](../src/scriptlets/disable-newtab-links.js)
650+
[Scriptlet source](../src/scriptlets/disable-newtab-links.ts)
651651

652652
* * *
653653

wiki/about-trusted-scriptlets.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,15 +417,17 @@ example.org#%#//scriptlet('trusted-json-set', methodPath, propsPath, argumentVal
417417
- `trueFunc` — function returning true
418418
- `falseFunc` — function returning false
419419
- `throwFunc` — function throwing an error
420-
- `noopPromiseResolve` — function returning Promise resolved with an empty response
421-
- `noopPromiseReject` — function returning Promise.reject()
420+
- `noopPromiseResolve` — function returning `Promise` resolved with an empty response
421+
- `noopPromiseReject` — function returning `Promise.reject()`
422422
- any other string is set as a string literal
423+
423424
Can also be a replacement applied to the current string value at the target path,
424425
in the format `replace:/regex/replacement/`:
425426
- `replace:/foo/bar/` — replaces the first occurrence of `foo` with `bar`
426427
- `replace:/foo/bar/g` — replaces all occurrences
427-
Or `json:{...}` — parses the provided JSON value, can be used to apply multiple modifications at once;
428-
if the current target value is also an object, the parsed object is merged into it.
428+
429+
Or `json:{...}` — parses the provided `JSON` value, can be used to apply multiple modifications at once.
430+
If the current target value is also an object, the parsed object is merged into it.
429431
- `requiredInitialProps` — optional, space-separated list of property paths.
430432
All listed paths must be present in the JSON object for the modification to occur.
431433
- `jsonSource` — optional, where to read and modify the JSON value from. Defaults to `result`.
@@ -599,8 +601,8 @@ example.org#%#//scriptlet('trusted-json-set', methodPath, propsPath, argumentVal
599601
1. Only modifies the JSON object if `tracking.enabled` property is present
600602
601603
```adblock
602-
example.org#%#//scriptlet(
603-
'trusted-json-set', 'JSON.parse', 'tracking.enabled', 'false', 'tracking.enabled', 'result')
604+
example.org#%#//scriptlet('trusted-json-set', 'JSON.parse', 'tracking.enabled', 'false', 'tracking.enabled', 'result')
605+
```
604606
605607
Input JSON:
606608

0 commit comments

Comments
 (0)