Skip to content

Commit

Permalink
deploy: update dist v1.9.91
Browse files Browse the repository at this point in the history
  • Loading branch information
Atlassian Bamboo committed Nov 13, 2023
1 parent 2255709 commit 5ab21cd
Show file tree
Hide file tree
Showing 7 changed files with 1,388 additions and 250 deletions.
2 changes: 1 addition & 1 deletion dist/build.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=1.9.83
version=1.9.91
2 changes: 1 addition & 1 deletion dist/redirects.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# AdGuard Scriptlets (Redirects Source)
# Version 1.9.83
# Version 1.9.91
#
- title: 1x1-transparent.gif
added: v1.0.4
Expand Down
22 changes: 14 additions & 8 deletions dist/scriptlets.corelibs.json

Large diffs are not rendered by default.

757 changes: 639 additions & 118 deletions dist/scriptlets.js

Large diffs are not rendered by default.

757 changes: 639 additions & 118 deletions dist/umd/scriptlets.umd.js

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions wiki/about-scriptlets.md
Original file line number Diff line number Diff line change
Expand Up @@ -2315,8 +2315,13 @@ example.org#%#//scriptlet('set-cookie', name, value[, path])
- `yes` / `y`
- `no` / `n`
- `ok`
- `accept`/ `reject`
- `allow` / `deny`
- `on` / `off`
- `accept`/ `accepted` / `notaccepted`
- `reject` / `rejected`
- `allow` / `allowed`
- `disallow` / `deny`
- `enable` / `enabled`
- `disable` / `disabled`
- `path` — optional, cookie path, defaults to `/`; possible values:
- `/` — root path
- `none` — to set no path at all
Expand Down Expand Up @@ -2359,7 +2364,7 @@ example.com#%#//scriptlet('set-local-storage-item', 'key', 'value')
- `key` — required, key name to be set.
- `value` — required, key value; possible values:
- positive decimal integer `<= 32767`
- one of the predefined constants:
- one of the predefined constants in any case variation:
- `undefined`
- `false`
- `true`
Expand All @@ -2369,6 +2374,8 @@ example.com#%#//scriptlet('set-local-storage-item', 'key', 'value')
- `''` — empty string
- `yes`
- `no`
- `on`
- `off`
- `$remove$` — remove specific item from localStorage
### Examples
Expand Down Expand Up @@ -2426,7 +2433,7 @@ example.com#%#//scriptlet('set-session-storage-item', 'key', 'value')
- `key` — required, key name to be set.
- `value` — required, key value; possible values:
- positive decimal integer `<= 32767`
- one of the predefined constants:
- one of the predefined constants in any case variation:
- `undefined`
- `false`
- `true`
Expand All @@ -2436,6 +2443,8 @@ example.com#%#//scriptlet('set-session-storage-item', 'key', 'value')
- `''` — empty string
- `yes`
- `no`
- `on`
- `off`
- `$remove$` — remove specific item from sessionStorage
### Examples
Expand Down
81 changes: 81 additions & 0 deletions wiki/about-trusted-scriptlets.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# <a id="trusted-scriptlets"></a> Available Trusted Scriptlets

- [trusted-click-element](#trusted-click-element)
- [trusted-prune-inbound-object](#trusted-prune-inbound-object)
- [trusted-replace-fetch-response](#trusted-replace-fetch-response)
- [trusted-replace-node-text](#trusted-replace-node-text)
- [trusted-replace-xhr-response](#trusted-replace-xhr-response)
Expand Down Expand Up @@ -100,6 +101,86 @@ and each of them should match the syntax. Possible `name`s:

* * *

## <a id="trusted-prune-inbound-object"></a> ⚡️ trusted-prune-inbound-object

> Added in unknown.
Removes listed properties from the result of calling specific function (if payload contains `Object`)
and returns to the caller.

Related UBO scriptlet:
https://github.com/gorhill/uBlock/commit/1c9da227d7

### Syntax

```text
example.org#%#//scriptlet('trusted-prune-inbound-object', functionName[, propsToRemove [, obligatoryProps [, stack]]])
```

- `functionName` — required, the name of the function to trap, it must have an object as an argument
- `propsToRemove` — optional, string of space-separated properties to remove
- `obligatoryProps` — optional, string of space-separated properties
which must be all present for the pruning to occur
- `stack` — optional, string or regular expression that must match the current function call stack trace;
if regular expression is invalid it will be skipped

> Note please that you can use wildcard `*` for chain property name,
> e.g. `ad.*.src` instead of `ad.0.src ad.1.src ad.2.src`.
### Examples

1. Removes property `example` from the payload of the Object.getOwnPropertyNames call

```adblock
example.org#%#//scriptlet('trusted-prune-inbound-object', 'Object.getOwnPropertyNames', 'example')
```

For instance, the following call will return `['one']`

```html
Object.getOwnPropertyNames({ one: 1, example: true })
```

2. Removes property `ads` from the payload of the Object.keys call

```adblock
example.org#%#//scriptlet('trusted-prune-inbound-object', 'Object.keys', 'ads')
```

For instance, the following call will return `['one', 'two']`

```html
Object.keys({ one: 1, two: 2, ads: true })
```

3. Removes property `foo.bar` from the payload of the JSON.stringify call

```adblock
example.org#%#//scriptlet('trusted-prune-inbound-object', 'JSON.stringify', 'foo.bar')
```

For instance, the following call will return `'{"foo":{"a":2},"b":3}'`

```html
JSON.stringify({ foo: { bar: 1, a: 2 }, b: 3 })
```

4. Removes property `foo.bar` from the payload of the JSON.stringify call if its error stack trace contains `test.js`

```adblock
example.org#%#//scriptlet('trusted-prune-inbound-object', 'JSON.stringify', 'foo.bar', '', 'test.js')
```

5. Call with only first and third argument will log the current hostname and matched payload at the console

```adblock
example.org#%#//scriptlet('trusted-prune-inbound-object', 'JSON.stringify', '', 'bar', '')
```

[Scriptlet source](../src/scriptlets/trusted-prune-inbound-object.js)

* * *

## <a id="trusted-replace-fetch-response"></a> ⚡️ trusted-replace-fetch-response

> Added in v1.7.3.
Expand Down

0 comments on commit 5ab21cd

Please sign in to comment.