More pre-parser tokens

gwarser 2020-09-06 14:52:50 +02:00
parent a6e26f57b5
commit 650ecc3b0e
1 changed files with 24 additions and 15 deletions

@ -97,21 +97,30 @@ Support for pre-processor directives are the result of discussion with AdGuard d
For the time being, only a single token is supported in a `!#if` directive (can be negated using `!`), and uBO supports only the following tokens, anything else will be ignored: For the time being, only a single token is supported in a `!#if` directive (can be negated using `!`), and uBO supports only the following tokens, anything else will be ignored:
- `ext_ublock` -> true
- `env_chromium` -> all Chromium based browsers | Token | Value | Introduced in |
- `env_edge` -> Edge (legacy) | ----- | ----- | ------------- |
- `env_firefox` -> Firefox | `ext_abp` | **false** | [1.29.3b7](https://github.com/gorhill/uBlock/commit/00b790ce7210d7faa9b5a06d748d415bc1879056) |
- `env_mobile` -> mobile devices | `ext_ublock` | **true** |
- `env_safari` -> Safari (legacy, up to 12 / macOS Mojave) | `env_chromium` | _true_ on all Chromium based browsers |
- `false` -> always false, added in [1.22.0](https://github.com/gorhill/uBlock/commit/1d805fb9da1aad918d02cc74796d5aa5e974b184) | `env_edge` | _true_ on Edge (legacy) |
- `cap_html_filtering` -> supports [HTML filtering](#html-filters) | `env_firefox` | _true_ on Firefox |
- `cap_user_stylesheet` -> Firefox, Chromium 66+, supports style injection by [`tabs.insertCSS`](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/insertCSS) | `env_mobile` | _true_ on mobile devices |
- `adguard` -> false, added in [1.28.1b6](https://github.com/gorhill/uBlock/commit/83c01fb3525bbede86c54fe06caa3eb8bc8eb0ef) | `env_safari` | _true_ on Safari (legacy, up to 12 / macOS Mojave) |
- `adguard_app_windows` -> false [1.28.1b7](https://github.com/gorhill/uBlock/commit/e44a568278678e04b508c2bc1b8a94a2c54b848c) | `false` | **false** | [1.22.0](https://github.com/gorhill/uBlock/commit/1d805fb9da1aad918d02cc74796d5aa5e974b184) |
- `adguard_ext_chromium` -> Chromium based browsers, added in [1.28.1b6](https://github.com/gorhill/uBlock/commit/83c01fb3525bbede86c54fe06caa3eb8bc8eb0ef) | `cap_html_filtering` | _true_ when browser supports [HTML filtering](#html-filters) |
- `adguard_ext_edge` -> Edge (legacy), added in [1.28.1b6](https://github.com/gorhill/uBlock/commit/83c01fb3525bbede86c54fe06caa3eb8bc8eb0ef) | `cap_user_stylesheet` | _true_ on Firefox, Chromium 66+, supports style injection by [`tabs.insertCSS`](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/insertCSS) |
- `adguard_ext_firefox` -> Firefox, added in [1.28.1b6](https://github.com/gorhill/uBlock/commit/83c01fb3525bbede86c54fe06caa3eb8bc8eb0ef) | `adguard` | **false** | [1.29.0](https://github.com/gorhill/uBlock/commit/83c01fb3525bbede86c54fe06caa3eb8bc8eb0ef) |
- `adguard_ext_opera` -> Chromium, added in [1.28.1b6](https://github.com/gorhill/uBlock/commit/83c01fb3525bbede86c54fe06caa3eb8bc8eb0ef) | `adguard_app_android` | **false** | [1.29.3b7](https://github.com/gorhill/uBlock/commit/00b790ce7210d7faa9b5a06d748d415bc1879056) |
| `adguard_app_ios` | **false** | [1.29.3b7](https://github.com/gorhill/uBlock/commit/00b790ce7210d7faa9b5a06d748d415bc1879056) |
| `adguard_app_mac` | **false** | [1.29.3b7](https://github.com/gorhill/uBlock/commit/00b790ce7210d7faa9b5a06d748d415bc1879056) |
| `adguard_app_windows` | **false** | [1.29.0](https://github.com/gorhill/uBlock/commit/e44a568278678e04b508c2bc1b8a94a2c54b848c) |
| `adguard_ext_android_cb` | **false** | [1.29.3b7](https://github.com/gorhill/uBlock/commit/00b790ce7210d7faa9b5a06d748d415bc1879056) |
| `adguard_ext_chromium` | _true_ on Chromium based browsers | [1.28.1b6](https://github.com/gorhill/uBlock/commit/83c01fb3525bbede86c54fe06caa3eb8bc8eb0ef) |
| `adguard_ext_edge` | _true_ on Edge (legacy) | [1.29.0](https://github.com/gorhill/uBlock/commit/83c01fb3525bbede86c54fe06caa3eb8bc8eb0ef) |
| `adguard_ext_firefox` | _true_ on Firefox | [1.29.0](https://github.com/gorhill/uBlock/commit/83c01fb3525bbede86c54fe06caa3eb8bc8eb0ef) |
| `adguard_ext_opera` | _true_ on Chromium | [1.29.0](https://github.com/gorhill/uBlock/commit/83c01fb3525bbede86c54fe06caa3eb8bc8eb0ef) |
| `adguard_ext_safari` | **false** | [1.29.3b7](https://github.com/gorhill/uBlock/commit/00b790ce7210d7faa9b5a06d748d415bc1879056) |
Starting from [1.22.0](https://github.com/gorhill/uBlock/commit/1d805fb9da1aad918d02cc74796d5aa5e974b184) you can use `!#if false` directive to disable a large block of your filters without having to remove them. Starting from [1.22.0](https://github.com/gorhill/uBlock/commit/1d805fb9da1aad918d02cc74796d5aa5e974b184) you can use `!#if false` directive to disable a large block of your filters without having to remove them.