1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 14:07:45 +00:00

LibWeb: Add a basic content filter (ad blocking!) :^)

This patch adds a global (per-process) filter list to LibWeb that is
used to filter all outgoing resource load requests.

Basically we check the URL against a list of filter patterns and if
it's a match for any one of them, we immediately fail the load.

The filter list is a simple text file:

    ~/.config/BrowserContentFilters.txt

It's one filter per line and they are simple glob filters for now,
with implicit asterisks (*) at the start and end of the line.
This commit is contained in:
Andreas Kling 2021-01-05 18:12:29 +01:00
parent 1c8eaf28cd
commit a6d52e0c97
5 changed files with 141 additions and 1 deletions

View file

@ -177,6 +177,7 @@ set(SOURCES
Layout/TreeBuilder.cpp
Layout/WidgetBox.cpp
LayoutTreeModel.cpp
Loader/ContentFilter.cpp
Loader/FrameLoader.cpp
Loader/ImageLoader.cpp
Loader/ImageResource.cpp