1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00
uBlock/assets
Raymond Hill 1ff3878a49
Add prevent-canvas scriptlet
Prevent usage of specific or all (default) canvas APIs.

Syntax

```text
example.com##+js(prevent-canvas [, contextType])
```

- `contextType`: A specific type of canvas API to prevent (default to all
  APIs). Can be a string or regex which will be matched against the type
  used in getContext() call. Prepend with `!` to test for no-match.

Examples

1. Prevent `example.com` from accessing all canvas APIs

```adblock
example.com##+js(prevent-canvas)
```

2. Prevent access to any flavor of WebGL API, everywhere

```adblock
*##+js(prevent-canvas, /webgl/)
```

3. Prevent `example.com` from accessing any flavor of canvas API except `2d`

```adblock
example.com##+js(prevent-canvas, !2d)
```

References

https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext
2023-09-28 11:26:45 -04:00
..
resources Add prevent-canvas scriptlet 2023-09-28 11:26:45 -04:00
assets.dev.json Remove unmaintained urlhaus PUP filter list 2023-09-28 09:49:07 -04:00
assets.json Remove unmaintained urlhaus PUP filter list 2023-09-28 09:49:07 -04:00