Skip to content

Commit 5ab21cd

Browse files
author
Atlassian Bamboo
committed
deploy: update dist v1.9.91
1 parent 2255709 commit 5ab21cd

File tree

7 files changed

+1388
-250
lines changed

7 files changed

+1388
-250
lines changed

dist/build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=1.9.83
1+
version=1.9.91

dist/redirects.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# AdGuard Scriptlets (Redirects Source)
3-
# Version 1.9.83
3+
# Version 1.9.91
44
#
55
- title: 1x1-transparent.gif
66
added: v1.0.4

dist/scriptlets.corelibs.json

Lines changed: 14 additions & 8 deletions
Large diffs are not rendered by default.

dist/scriptlets.js

Lines changed: 639 additions & 118 deletions
Large diffs are not rendered by default.

dist/umd/scriptlets.umd.js

Lines changed: 639 additions & 118 deletions
Large diffs are not rendered by default.

wiki/about-scriptlets.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,8 +2315,13 @@ example.org#%#//scriptlet('set-cookie', name, value[, path])
23152315
- `yes` / `y`
23162316
- `no` / `n`
23172317
- `ok`
2318-
- `accept`/ `reject`
2319-
- `allow` / `deny`
2318+
- `on` / `off`
2319+
- `accept`/ `accepted` / `notaccepted`
2320+
- `reject` / `rejected`
2321+
- `allow` / `allowed`
2322+
- `disallow` / `deny`
2323+
- `enable` / `enabled`
2324+
- `disable` / `disabled`
23202325
- `path` — optional, cookie path, defaults to `/`; possible values:
23212326
- `/` — root path
23222327
- `none` — to set no path at all
@@ -2359,7 +2364,7 @@ example.com#%#//scriptlet('set-local-storage-item', 'key', 'value')
23592364
- `key` — required, key name to be set.
23602365
- `value` — required, key value; possible values:
23612366
- positive decimal integer `<= 32767`
2362-
- one of the predefined constants:
2367+
- one of the predefined constants in any case variation:
23632368
- `undefined`
23642369
- `false`
23652370
- `true`
@@ -2369,6 +2374,8 @@ example.com#%#//scriptlet('set-local-storage-item', 'key', 'value')
23692374
- `''` — empty string
23702375
- `yes`
23712376
- `no`
2377+
- `on`
2378+
- `off`
23722379
- `$remove$` — remove specific item from localStorage
23732380

23742381
### Examples
@@ -2426,7 +2433,7 @@ example.com#%#//scriptlet('set-session-storage-item', 'key', 'value')
24262433
- `key` — required, key name to be set.
24272434
- `value` — required, key value; possible values:
24282435
- positive decimal integer `<= 32767`
2429-
- one of the predefined constants:
2436+
- one of the predefined constants in any case variation:
24302437
- `undefined`
24312438
- `false`
24322439
- `true`
@@ -2436,6 +2443,8 @@ example.com#%#//scriptlet('set-session-storage-item', 'key', 'value')
24362443
- `''` — empty string
24372444
- `yes`
24382445
- `no`
2446+
- `on`
2447+
- `off`
24392448
- `$remove$` — remove specific item from sessionStorage
24402449

24412450
### Examples

wiki/about-trusted-scriptlets.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# <a id="trusted-scriptlets"></a> Available Trusted Scriptlets
22

33
- [trusted-click-element](#trusted-click-element)
4+
- [trusted-prune-inbound-object](#trusted-prune-inbound-object)
45
- [trusted-replace-fetch-response](#trusted-replace-fetch-response)
56
- [trusted-replace-node-text](#trusted-replace-node-text)
67
- [trusted-replace-xhr-response](#trusted-replace-xhr-response)
@@ -100,6 +101,86 @@ and each of them should match the syntax. Possible `name`s:
100101
101102
* * *
102103
104+
## <a id="trusted-prune-inbound-object"></a> ⚡️ trusted-prune-inbound-object
105+
106+
> Added in unknown.
107+
108+
Removes listed properties from the result of calling specific function (if payload contains `Object`)
109+
and returns to the caller.
110+
111+
Related UBO scriptlet:
112+
https://github.com/gorhill/uBlock/commit/1c9da227d7
113+
114+
### Syntax
115+
116+
```text
117+
example.org#%#//scriptlet('trusted-prune-inbound-object', functionName[, propsToRemove [, obligatoryProps [, stack]]])
118+
```
119+
120+
- `functionName` — required, the name of the function to trap, it must have an object as an argument
121+
- `propsToRemove` — optional, string of space-separated properties to remove
122+
- `obligatoryProps` — optional, string of space-separated properties
123+
which must be all present for the pruning to occur
124+
- `stack` — optional, string or regular expression that must match the current function call stack trace;
125+
if regular expression is invalid it will be skipped
126+
127+
> Note please that you can use wildcard `*` for chain property name,
128+
> e.g. `ad.*.src` instead of `ad.0.src ad.1.src ad.2.src`.
129+
130+
### Examples
131+
132+
1. Removes property `example` from the payload of the Object.getOwnPropertyNames call
133+
134+
```adblock
135+
example.org#%#//scriptlet('trusted-prune-inbound-object', 'Object.getOwnPropertyNames', 'example')
136+
```
137+
138+
For instance, the following call will return `['one']`
139+
140+
```html
141+
Object.getOwnPropertyNames({ one: 1, example: true })
142+
```
143+
144+
2. Removes property `ads` from the payload of the Object.keys call
145+
146+
```adblock
147+
example.org#%#//scriptlet('trusted-prune-inbound-object', 'Object.keys', 'ads')
148+
```
149+
150+
For instance, the following call will return `['one', 'two']`
151+
152+
```html
153+
Object.keys({ one: 1, two: 2, ads: true })
154+
```
155+
156+
3. Removes property `foo.bar` from the payload of the JSON.stringify call
157+
158+
```adblock
159+
example.org#%#//scriptlet('trusted-prune-inbound-object', 'JSON.stringify', 'foo.bar')
160+
```
161+
162+
For instance, the following call will return `'{"foo":{"a":2},"b":3}'`
163+
164+
```html
165+
JSON.stringify({ foo: { bar: 1, a: 2 }, b: 3 })
166+
```
167+
168+
4. Removes property `foo.bar` from the payload of the JSON.stringify call if its error stack trace contains `test.js`
169+
170+
```adblock
171+
example.org#%#//scriptlet('trusted-prune-inbound-object', 'JSON.stringify', 'foo.bar', '', 'test.js')
172+
```
173+
174+
5. Call with only first and third argument will log the current hostname and matched payload at the console
175+
176+
```adblock
177+
example.org#%#//scriptlet('trusted-prune-inbound-object', 'JSON.stringify', '', 'bar', '')
178+
```
179+
180+
[Scriptlet source](../src/scriptlets/trusted-prune-inbound-object.js)
181+
182+
* * *
183+
103184
## <a id="trusted-replace-fetch-response"></a> ⚡️ trusted-replace-fetch-response
104185
105186
> Added in v1.7.3.

0 commit comments

Comments
 (0)