From bdd74f4425c7939160eab3707881c8b6969d4aa5 Mon Sep 17 00:00:00 2001 From: Imre Kristoffer Eilertsen Date: Wed, 11 Dec 2019 18:51:01 +0100 Subject: [PATCH] Significant brushup --- ...taxMeaningsThatAreActuallyHumanReadable.md | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Wiki/SyntaxMeaningsThatAreActuallyHumanReadable.md b/Wiki/SyntaxMeaningsThatAreActuallyHumanReadable.md index 0ed78b594..e3eac523c 100644 --- a/Wiki/SyntaxMeaningsThatAreActuallyHumanReadable.md +++ b/Wiki/SyntaxMeaningsThatAreActuallyHumanReadable.md @@ -13,13 +13,13 @@ * `:not(.element)`: Finds page elements that doesn't contain a specified element or text string. Can be paired with other syntaxes à la `:not(:-abp-contains(Example text))`. * `:-abp-contains(text)`: Finds page elements that contains such text within it. * `:-abp-has(.element)`: Finds page elements that contains such an element within it. -* `:scope`: Used alongside `:-abp-has` to make it only find elements whose criteria match their immediate subelements. * `:nth-of-type(n)` / `:last-of-type` / `:only-of-type`: Finds page elements that are at a specific numerical position in a set. * `:before` / `:after`: Removes the pseudo-elements that belong to a page element. * `>`: Creates chain criteria, in which a selected page element must have a specific element above it in the filetree. * `+`: Blocks the element that is right below the criteria in the filetree. Example: `##.element + div` blocks that particular `div`. ##### Advanced examples: +* The first two `##` of an element entry, are not used for elements written after e.g. `>`, `+` or `:-abp-has`. In those cases, `##element` gets removed, `##.class` becomes `.class`, and `###id` becomes `#id`. * `##element.element2`: Hide something both based on its element (##element1) and `class` value (.element2). Note the placement/absence of fullstops. * `##.element1 > #element2`: When used in chain criteria, three `###` are replaced by a single `#`. * While they're based on the same `class` values, `##.element1` will match any `class` (sub-)value, whereas `##div[class="element1"]` and their modifiers are based on the *entire* `class` string in the F12 filetree. @@ -31,8 +31,8 @@ * `^`: Wildcard for anything that isn't alphanumerical or "_-.%" . Often used to cover both slash ( / ) and non-slash domain name endings at the same time. * `$third-party`: Ensures that resources from a domain are only blocked if you're not visiting the domain itself. * `$~third-party`: Ensures that resources from a domain are only blocked if you're visiting the domain itself. -* `$domain=`: Ensures that resources from a domain are only blocked if you're visiting a specified website. -* `$generichide`: Prevents all non-domain-specific (a.k.a. generic) hiding entries from working on a website. On Nano/uBO it prevents *all* non-domain-specific entries from working. +* `$domain=`: Ensures that resources from a domain are only blocked if you're visiting a specified website. Multiple domains are separated with `|` (Vertical line) and not commas. +* `@@||` + `$generichide`: Prevents all non-domain-specific (a.k.a. generic) hiding entries from working on a website. On Nano/uBO it prevents *all* non-domain-specific entries from working. * `$script`: Blocks resources from domains or parts thereof from being loaded, but only if it's a script, e.g. a JavaScript runtime. * `$csp`: Inserts additional *Content Security Policies* into the page. * `$xmlhttprequest` / `$websocket` / `$dom`: Prevents such resources from being downloaded through the titular JavaScript APIs. @@ -50,6 +50,9 @@ * `! Version:` The version number/alphanumeric of the list. Unofficially used to distinguish which version of a list a user is using. Used administratively by Adblock Plus' list report system (which requires a number-only version value). Has significant overlap with `! Last modified`. * `! Expires:`: Determines the timespan between each automated sync attempt with the list's source. Values are given in "n day/days". ABP also supports "hour/hours". +### Nano Adblocker, uBlock Origin, Adblock Plus and AdBlock only: +* `:scope`: Used alongside `:-abp-has` to make it only find elements whose criteria match their immediate subelements. + ### Nano Adblocker, uBlock Origin and AdGuard only: #### Hiding * `:style`: Changes the CSS values of an element, in much the same way as what userstyle extensions like Stylish would've done. @@ -71,7 +74,7 @@ * `:xpath`: An entry written with the very advanced Xpath syntax. * `##^`: Blocks resources before they've even been loaded, based on their values in *View source* instead of their F12 ones. #### Blocking -* `127.0.0.1` / `0.0.0.0` / `::1` / `0` / `::`: Used by "*hosts*" system files to signify that network requests to such a domain shall be redirected to a local-only IP address, thus preventing it from loading. Nano and uBO treats it the same as `||`. +* `127.0.0.1` / `0.0.0.0` / `::1` / `0` / `::`: Used by "*hosts*" system files to signify that network requests to such a domain shall be redirected to a local-only IP address, thus preventing it from loading. Nano and uBO treats it the same as `||`. It only supports whole domains; using `/` or any other non-alphanumeric-or-period characters is not accepted. * `||` + `$document`: Guarantees a danger warning when loading a page, which is not 110% guaranteed otherwise. * `$3p`: Same as `$third-party`. * `$first-party` / `$1p`: Same as `$~third-party`. @@ -81,7 +84,7 @@ ### Adblock Plus and AdBlock only: * `! Redirect: `: Tells the adblocker to look for list updates from a new URL from that point on. -* `#?#`: Required to make entries with `:-abp-has`, `:-abp-contains` and `:-abp-properties` work in those particular extensions. +* `#?#`: Required to make entries with `:-abp-has`, `:-abp-contains` and `:-abp-properties` work in those particular extensions, and to make `:style` entries not break the list extremely heavily. * `@@||` + `$document`: Turns off adblocking entirely while on that domain. * `@@||` + `$genericblock`: Prevents all non-domain-specific blocking entries from working on a website. * `:-abp-properties`: A highly modified version of `:matches-css[-before]`, with some syntax differences. Can also select text encodings (à la Base64) and a few other non-CSS traits. @@ -109,20 +112,15 @@ * `@@` + `$extensions` = Prevents AdGuard userscripts from working on that site. * `@@` + `$content` = Prevents `$$script` entries from working on that site. * `@@` + `$stealth` = Turns off Stealth Mode on that site. -* `$mp4` = Presumably equivalent to `$redirect=noopmp4`. -* `$replace` = Changes the text of text elements on a site. Supports and requires use of RegEx. +* `$mp4` = Seems to be equivalent to `$redirect=noopmp4`, but does not require any AdGuard trust rights. +* `$replace` = Changes the text of text elements on a site. Supports and requires use of RegEx. Requires ridiculous amounts of trust rights and cannot be used in web-hosted lists. -# Particularly important usage notes +# Other particularly important usage notes -* `||` entries do support asterisk wildcards, but only in the criteria text. Additionally, when using `$domain=`, domains are separated with vertical lines, since commas are instead used to stack multiple `$` values. -* ABP is known to severely struggle with handling `:style` entries, to the point where having ABP try to load a list with such an entry will cause it to invalidate the list *and* all its entries. A workaround is to use `#?#` in all `:style` entries. * To make the text detection for `:-abp-contains` and `:has-text` case-insensitive, wrap the paranthesised text into `(/Example text/i)`. -* `127.0.0.1` / `0.0.0.0` / `::1` supports only whole domains, and it can not be narrowed down to subdomains or elements. * The `"` in `[href="text"]` is optional, but *only* if the criteria text is only a single word. -* In `:-abp-has` and `:has`, it is not needed to pre-empt the criteria elements with `##`. * `:style` and `{ }` does not allow changing `background-image` into a URL value. * It is claimed in [this comment](https://github.com/DandelionSprout/adfilt/issues/7#issuecomment-481978609) that Safari does not properly accept the use of `$third-party`. -* Domains in `$domain=` are seperated by a vertical line (`|`), instead of the usual comma. * Amazingly, using `! Redirect: ` in the intended target link's list, will cause an infinite loop that prevents the list from being loaded. * In Opera, the F12 filetree is not actually opened with F12 by default, but instead with Ctrl+Shift+I (Capital İ).