1
0
Fork 0
adblocker-rules/README.md

282 lines
14 KiB
Markdown
Raw Permalink Normal View History

[![uBlock syntax](_public/icons/ublock-origin-syntax.svg)](https://github.com/gorhill/uBlock/wiki/Static-filter-syntax)
[![AdGuard syntax](_public/icons/adguard-syntax.svg)](https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters)
[![ko-fi](_public/icons/ko-fi.png)](https://ko-fi.com/X8X37FUGU)
[![Donate](_public/icons/donate.png)](https://0xacab.org/my-privacy-dns/matrix/-/blob/master/DONATION.md)
2023-05-11 11:47:40 +02:00
[![My Privacy DNS](_public/icons/logo-h128.png)](https://0xacab.org/my-privacy-dns/matrix "This project is part of My Privacy DNS")
# Adblocker Rules
These adblock filters you will find inside this repository
2021-12-05 18:58:32 +01:00
will in some degree be a supportive to the more common know filters like
[EasyList][EasyList] or [AdGuard][AdGuard].
2023-02-18 12:31:12 +01:00
## About
2023-12-15 11:36:55 +01:00
2021-12-05 18:58:32 +01:00
Some important notes is this project started as a private project,
however as the time how parsed by, it looks like other users are using
one or more of our rules and filter, just as we are including 3rd party
filters.
This means the precision in the filtering rules might not be as sharp as
2023-12-15 11:36:55 +01:00
they could have been if this have been a major part of my portfolio,but
2021-12-05 18:58:32 +01:00
this is purely a side project.
## Disclaimer
2023-12-15 11:36:55 +01:00
I can't guarantee these filers won't cause problems. If you found
2023-02-07 10:29:15 +01:00
problems, [report][issues] it by filling in all the mandatory items in
Issue template; otherwise reports can be ignored. Anyone who uses any of
my filters/codes shall be deemed to have agreed that I have no
responsibility or liability for costs, losses, damages, etc. arising
from the use of the filters/codes. Unless Subscribe link is provided
these filters are assumed to be copied and pasted, or imported, into My
filters/rules (Adblock Plus / uBlock Origin) or User Rules (AdGuard).
2023-02-18 12:31:12 +01:00
## Webfront
2023-12-15 11:36:55 +01:00
2023-02-18 12:31:12 +01:00
Our HTML front end can be found at
2023-12-15 11:36:55 +01:00
- 0xacab: <https://mypdns.github.io/adblocker-rules/>
- GitHub: No longer Supported as they have incorporated SpyWare
2023-02-18 12:31:12 +01:00
## Subscribe to the rules
2023-12-15 11:36:55 +01:00
[Click here to activate these rules in your Adblocker][Subscribe]
2023-02-18 12:31:12 +01:00
The following Lnks will provide you with different resulting filters.
0xacab Editions should be the most advanced and compressed thanks to
2023-02-18 12:31:12 +01:00
the @adguard/hostlist-compiler compiler, where the GH editions relay on
the abp filter script.
- 0xacab edition via [adblocker.mypdns.org][Subscribe]
2023-03-22 17:45:20 +01:00
- Github No longer Supported
2023-02-18 12:31:12 +01:00
2023-12-15 11:36:55 +01:00
You should also be able to subscribe directly to the rules by
right-click any of the following urls, choose `<Adblocker>` =>
`<Subscribe to the filterlist>`
2023-02-18 12:31:12 +01:00
2023-12-15 11:36:55 +01:00
- <a href="abp:
subscribe?location=https://mypdns.github.io/adblocker-rules/blockrules.txt&title=My%20Privacy%20DNS%20%E2%80%93%20Adblock%20Rules&requiresLocation=https://mypdns.github.io/adblocker-rules/blockrules.txt&requiresTitle=My%20Privacy%20DNS%20%E2%80%93%20Adblock%20Rules%20%E2%80%93%20github%20Edition"
title="Subscribe to My Privacy DNS adblocker rules (0xacab
edition)">adblocker.mypdns.org | Adblock Rules (github edition)
</a>
- ~~mypdns.github.io~~ | No longer Supported
2023-02-18 12:31:12 +01:00
## Issues and comments
2023-12-15 11:36:55 +01:00
The one and only place to report any issues or post a comment are as
following:
2023-12-15 11:36:55 +01:00
2021-12-05 16:03:51 +01:00
- [Issues][issues] with any rules is reported on the My Privacy DNS Site.
- Commit Comments are posted on the individual [commit][commits]'s on
the My Privacy DNS Site, in case you don't think it need a
[Issues][issues].
- Common questions, non specific filter topics, goes straight to the
2023-12-15 11:36:55 +01:00
[Support][support] board on the My Privacy DNS Site.
- Any comments or issues posted elsewhere will in the future be ignored
2021-12-05 16:03:51 +01:00
in full. ***The grace period is excised***.
2021-12-05 16:03:51 +01:00
`github.com` is in *only* a full backup of
We do no longer operate at `Github` do to there anti-privacy terms of usage.
2021-12-05 16:17:51 +01:00
# Writing filters
## File structure
2021-12-05 18:58:32 +01:00
| File naming | Supported filter types |
2023-12-15 11:36:55 +01:00
|:-----------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
2021-12-05 18:58:32 +01:00
| `_domain.` | These filter lists is to ad rules based on a domain specific level. ***IF / WHEN*** a rules is covering more than one domain, you should add it to the corresponding `_rule` filters |
| `_rule` | The place for rules covering more than one domain. |
| `adult_*.blacklist` | This is as the filename indicating the place to add NSFW ONLY contents *AND* only if it do not match any other filter(s) |
| `adware_*.blacklist` | Let take a guess, any promotional contents this is external as internal ads |
| `annoyance_*.blacklist` | Any kind of rules which did not fit into any other filter(s) and which does not as such brakes the functionality of the site. |
| `anti_social_*.blacklist` | filters that can help preventing building any kind of tracking links to any spyware domain like google, yandex, facebook, TikTok, Reddit, Telegram or similar (anti-)"social" and anti-democracy places. |
| `anti_whitelist_*.blacklist` | Found a rules elsewhere your would like to encounter, this is the filters for it. |
| `cookie_*.blacklist` | Everything preventing cookies being set, where not needed or used for any sorts of tracking/spying/logging :cookie: (1st & 3rd party) |
| `noise.txt` | :warning: **_WARNING_**! The following filter, WILL bring interruption to sites functionality. These rules are to clean up sites by removing all the unnecessary noise, bit like @yourduskquibbles webannoyances, but breaking things doesn't matter **AT ALL** |
| `spyware_*.blacklist` | Filter preventing any kind of tracking, spying and alike. If you have to ask, you need to read [SpyWare Wiki](https://0xacab.org/my-privacy-dns/matrix/-/wikis/Categories/Spyware/SpyWare) |
2021-12-05 18:58:32 +01:00
| `whitelist_*.whitelist` | Probably not very used... But it can come in handy sometimes protecting something to keep is spinning.... |
2021-12-05 18:26:50 +01:00
### Sorting filters
2023-12-15 11:36:55 +01:00
We are sorting the rules based on the second level domain in the `_domain.`
filters. In the `_rule` we sort based on the letter/number `[a-zA-Z0-9]`
disregarding the actual filter first are present at the 3rd argument.
#### Example
2023-12-15 11:36:55 +01:00
In this rules we like to hide the `.modal-backdrop` but to actually succeed
with this, will need some more arguments.
```css
2023-12-15 11:36:55 +01:00
#
#
.show.fade.modal-backdrop
```
This should be sorted by the first `s`
2019-09-26 04:58:03 +02:00
## Filter Inclusion - Exclusions
2023-12-15 11:36:55 +01:00
We will only in sevier cases include any rules that could/can be blocked
by a DNS related firewall like DNS RPZ.
2019-09-26 04:58:03 +02:00
**IF** a rules is included, this will be to support the tor-browser where
any local firewall rule is bypassed.
2021-12-05 16:17:51 +01:00
## Writing filter guides
2023-12-15 11:36:55 +01:00
Howto? block whitelisted spyware: (~~`https://github.com/easylist/easylist/issues/4529`~~
SpyWare infected domain)
`$` always needs to exist, if you're going to use a modifier.
`,` are used to separate multiple modifier.
Example (single modifier): `$script`
Example (multiple modifiers): `$document,frame,script,stylesheet`
## Counter other's rules
2023-12-15 11:36:55 +01:00
You can't use `badfilter` modifiers for cosmetic rules.
For example, `#@#.ads` can't be disabled with `#@#.ads$badfilter`
Instead, you need to re-activate the CSS rule with a new blocking
rule, which goes under the whitelisting radar (so-to-speak).
To override `#@#.ads`, something like `##[class="ads"]`, `##[class^="ads"]`
or `##[class*="ads"]` is needed. The (`^` = begins with / `*` = contains)
will work, since `#@#.ads` only disables/whitelists `##.ads.`
* `$badfilter`: Deactivates a resource-blocking entry, even if it is
present in another list.
* `$important`: Makes a resource-blocking entry take precedence over
another whitelisting entry.
2023-12-15 11:36:55 +01:00
* `$redirect`: Redirects resources to a neutered version that has been
embedded in those extensions. Possible options are listed in
[this file][redirect-engine]
(AdGuard has a [slightly smaller selection][slightly_smaller_selection]).
2023-12-15 11:36:55 +01:00
* `$empty`: Results in a fake empty page being loaded, instead of an
error page.
2020-10-06 17:21:33 +02:00
## Source URI's
2019-10-02 01:43:45 +02:00
2023-12-15 11:36:55 +01:00
How to write filters: <https://help.eyeo.com/en/adblockplus/how-to-write-filters>
2020-10-17 02:35:31 +02:00
### badfilter example
2023-12-15 11:36:55 +01:00
2020-10-17 02:35:31 +02:00
If the original rule was like
```css
2023-12-15 11:36:55 +01:00
@
@
/
advertise.js$ script, domain
=
example.com |xyz.com
2020-10-17 02:35:31 +02:00
```
2020-10-17 02:35:31 +02:00
Then
```css
2023-12-15 11:36:55 +01:00
@
@
/
advertise.js$ script, domain
=
example.com, badfilter
2020-10-17 02:35:31 +02:00
```
is a valid filter, it disables the whitelisted rule only on `example.com`.
See the dialogue at [github][dialogue]
## External resources
2023-12-15 11:36:55 +01:00
@Yuki2718 `/adblock` (~~`https://github.com/Yuki2718/adblock`~~ Spyware
infected domain) (Pretty much all the rules)
2021-06-23 04:49:42 +02:00
@yourduskquibbles `/webannoyances` (~~`https://github.com/yourduskquibbles/webannoyances`~~
Spyware infected domain)
2021-02-16 15:07:35 +01:00
@ryanbr `fanboy-adblock` (~~`https://github.com/ryanbr/fanboy-adblock`~~
Spyware infected domain)
2021-06-23 04:49:42 +02:00
@pgl [yoyo.org](https://pgl.yoyo.org/)
2021-12-05 18:58:32 +01:00
@EasyList [easylist.to][easylist.to]
2021-06-23 04:49:42 +02:00
@Spam404 `/Spam404/lists` (~~`https://github.com/Spam404/lists`~~
Spyware infected domain)
@migueldemoura `ublock-umatrix-rulesets` (~~`https://github.com/migueldemoura/ublock-umatrix-rulesets/`~~
Spyware infected domain)
@PeterDaveHello `url shorteneres` (~~`https://github.com/PeterDaveHello/url-shorteners`~~
Spyware infected domain)
2021-12-05 16:03:51 +01:00
And everyone else I've forgot to mention here.
2022-10-07 19:36:14 +02:00
Have a look in the [source list](/adblocker-rules.template)
2021-06-23 04:49:42 +02:00
2023-12-15 11:36:55 +01:00
## Sponsors
- Jetbrains, Provided free licence to any members, who have been working more than 3 month for My Privacy DNS open
source project https://www.jetbrains.com/community/opensource/.
## Build tools
we uses the HostlistCompiler https://github.com/AdguardTeam/HostlistCompiler to build our lists
2023-05-11 15:42:17 +02:00
## Official mirrors
2023-05-11 11:47:40 +02:00
The following repositories are official mirrors and should (when things
goes right) be updated by [push on commit][poc]
2023-05-11 15:42:17 +02:00
| Project | Host | Metode (push \| pull) |
2023-12-15 11:36:55 +01:00
|:----------------|:-----------------------------------------------------------|----------------------:|
2023-05-11 15:42:17 +02:00
| Adblocker Rules | `https://git.disroot.org/my-privacy-dns/adblocker-rules` | push |
| Adblocker Rules | `https://git.kescher.at/my-privacy-dns/adblocker-rules` | pull |
| Adblocker Rules | `https://gitea.slowb.ro/spirillen/adblocker-rules` | pull |
| Adblocker Rules | `https://github.com/mypdns/adblocker-rules` | push |
| Adblocker Rules | `https://gitlab.com/my-privacy-dns/matrix/adblocker-rules` | push |
| Adblocker Rules | `https://notabug.org/my-privacy-dns/adblocker-rules` | pull |
| ============ | ===================================================== | ================ |
| Matrix | `https://git.disroot.org/my-privacy-dns/matrix` | push |
| Matrix | `https://gitea.slowb.ro/spirillen/matrix` | push |
| Matrix | `https://github.com/mypdns/matrix` | push |
| Matrix | `https://gitlab.com/my-privacy-dns/matrix/matrix` | push |
| Matrix | `https://notabug.org/my-privacy-dns/matrix` | pull |
2023-02-18 12:31:12 +01:00
## Tanks to
2023-12-15 11:36:55 +01:00
Thanks to @Yuki2718, @THEtomaso, @krystian3w and everyone else who is
spreading the knowledge of how rules should be made :smiley:
2021-12-05 18:58:32 +01:00
<!-- Own Links -->
2023-12-15 11:36:55 +01:00
2023-10-01 18:38:08 +02:00
[issues]: https://github.com/mypdns/adblocker-rules/issues
2023-12-15 11:36:55 +01:00
2023-10-01 18:38:08 +02:00
[commits]: https://github.com/mypdns/adblocker-rules
2023-12-15 11:36:55 +01:00
2023-03-22 17:45:20 +01:00
[support]: https://0xacab.org/my-privacy-dns/support
2023-12-15 11:36:55 +01:00
[Subscribe]: abp:subscribe?location=https://mypdns.github.io/adblocker-rules/blockrules.txt&title=My%20Privacy%20DNS%20%E2%80%93%200xacab%20Edition%20%E2%80%93%20Adblock%20Rules
2021-12-05 18:58:32 +01:00
<!-- External Links -->
2023-12-15 11:36:55 +01:00
[redirect-engine]: https://github.com/gorhill/uBlock/blob/master/src/js/redirect-engine.js
2023-12-15 11:36:55 +01:00
[dialogue]: https://github.com/My-External-Stuff/ublockorigin-rules/commit/c01ba1a5a0d73a89c911ab11d1322631fe3d0540
2023-12-15 11:36:55 +01:00
[slightly_smaller_selection]: https://github.com/AdguardTeam/AdguardBrowserExtension/blob/master/Extension/lib/filter/rules/scriptlets/redirects.yml
2023-12-15 11:36:55 +01:00
2021-12-05 18:58:32 +01:00
[EasyList]: https://github.com/easylist/easylist
2023-12-15 11:36:55 +01:00
2021-12-05 18:58:32 +01:00
[easylist.to]: https://easylist.to
2023-12-15 11:36:55 +01:00
2021-12-05 18:58:32 +01:00
[AdGuard]: https://adguard.com/
2023-12-15 11:36:55 +01:00
2023-05-11 15:42:17 +02:00
[poc]: https://0xacab.org/help/user/project/repository/mirror/push.md "Push mirroring"