sourcediver.org
2026/07/13
Reading the news can be annoying when the front page features things you just do not want to hear about. I prototyped a browser extension that censors content based on natural language. The content is matched against rules using compact local LLMs and never leaves the machine.
In the 20th century, mass media started to become the main interface through which a large society perceives the “real-world”. It formed the model of reality - first looking back at it and soon also as a map that defines reality itself, this has been discussed extensively in academia, Marshall McLuhan being a prominent scholar in this field.
Be it television or a newspaper, the relationship between medium and reality has become obvious. Media no longer just reported days later that something had happened, media became able to create events to later report on them. This is a feedback loop as suddenly reality becomes self-referential through the almost instant reporting (breaking news). As the loop can influence real-time events, it’s important to ask who is in control of that loop or the algorithm that steers it.
Sites like reddit.com, lemmy, lobste.rs or news.ycombinator.com all have some sort of voting mechanism that defines relevance and even allow filtering based on topic thus allowing readers to actively show/hide certain topics. Also since the votes are more or less transparent, the relevance is at least “real” within the rules and effects of the site.
Traditional news media still represent the core truth in society and determine general direction of the narrative, even with social media platforms playing a larger role. These outlets define relevance based on their own criteria. For certain articles, the criterion is easy to deduce: a national news site will prioritize federal law discussions over global events - a local newspaper will prioritize local events over national ones. Also political biases play a role of course.
As a reader you are at the mercy of this cycle. Sometimes the cycle seems to get stuck with a certain topic. It is just not displaced by another, more relevant topic or is the newspaper pushing an agenda instead? You cannot know why a newspaper or society itself is still revolving around this topic. You cannot change it actively - you can only opt out and stop reading the news altogether when you have decided that you have heard enough or you are not interested at all. Even when you read a headline which you then filter out as not interesting the information will still reach your (sub)consciousness and thus change your perception of reality. You cannot unsee information.
This is the primary motivation of this post:
When I cannot change the news cycle actively (e.g. by voting), can I at least filter it without perceiving it?
Going back to the relationship between the event and the reporting. It seems to be like an axis where on the one side you have events that the media reports on, which have clearly nothing to do with the reporting itself (natural disasters, accidents etc.) and then there are events that are changed by the constant, self-referential reporting (elections, interest in certain products / stocks).
While soccer has a strong following in most countries, I suggest that news media need to actively manufacture an event like the FIFA championship. The outlets need to manufacture the relevance for the nation to create a spectacle and a happening in the first place. Simply because not everybody is interested so much so that they will actively seek information and thus be able to participate in the discussion in public life, be it in the work place or a bar.
That means that in the run-up to the event, the segments about the tournament will artificially be increased to make everybody aware of the event and also introduce teams, players and coaches.
While the manufacturing of such events can be beneficial for a nation, I am mostly annoyed by it. I don’t see relevance for me in this and am also shocked how much attention is caught by it in society instead of focusing on more relevant topics.
The main site of one of the largest news outlets in Germany, tagesschau.de has been filled with world cup related “news” since it began. All while the world is literally burning. I mean have you read the news lately?!
But in all seriousness, especially public service media should, in my opinion, refrain from this artificial steering of attention to create a national happening. It should rather stay sober and report on all the other events like new laws that are passed in such times.
As I cannot change the editorial direction of these outlets, I decided to focus on what I could control: my own news feed.
As mentioned before, it is impossible to filter information
without perceiving it first, thus changing your perception.
Hence I decided to try to filter out FIFA related content
from my news feed during the tournament using uBlock.
However, it became clear that regular expressions were just the
knife I brought to a gunfight.
Content appeared under a manifold of headings and in special
widgets.
futile uBlock blocking attempts
Instead of focusing on the exact content or trying to model
it with regular expressions of HTML tags and attributes like uBlock,
one would actually need to look at the content and its context
and then block the “parent” container which could be the outer
<article> of the matching headline.
As large language models are very good at parsing the semantic
meaning and context where simple patterns fail, they seem
to be the ideal tool for the job!
The user simply creates personal rules in plain language
which are then inserted into a common prompt.
The LLM runs locally (ollama) so while the website content
leaves the browser, it does not leave the machine itself.
Check whether the content is related to the following rule:
{rule}
Content:
"""
{content}
"""
Ollama has a structured output feature which
allows you to define a JSON schema for the output you expect.
For our usecase, the schema is a boolean - either
the content matches the rule or it doesn’t.
const MATCH_SCHEMA = {
type: "object",
properties: { match: { type: "boolean" } },
required: ["match"],
} as const
To have as much control over how the matching and filtering works, I decided to design a custom browser extension, inspired by [https://github.com/davmlaw/they_live_adblocker] and awwblock blog post.
When visiting a website the DOM needs to be split into small segments and for each of them, the content of this will be inserted into the above prompt for each user defined rule. Depending on the machine that runs the LLM, it can take a bit until all content has been evaluated, because of that the segments will be grayed out and one-by-one either turn black (censored) or be revealed.
tagesschau.de on 2026/07/07 with a rule that searches for football / soccer related content, including some false negatives
The above video shows a prompt that filters out football related content. The LLM is gemma4:e2b which
has sometimes false negatives but performs quite well overall.
Processing takes quite a while on a AMD Ryzen AI notebook processor (CPU-only) and in general
this only serves as a proof of concept.
I then tried the same against a AMD 7900XT and the content is evaluated really fast. Of course
the GPU is almost fully utilized but the speed is enough for everyday browsing.
sueddeutsche.de on 2026/07/09 on a AMD 7900XT filtering out football content in almost real time
Note: I click on the black segments to reveal the content to prove that football related content has actually been blocked.
Hopefully, processing of LLMs will get more efficient in the future with e.g. NPUs (broad support is still not there yet) so we can have more such applications locally on especially mobile devices. But until now such processing is reserved for devices with a lot of processing power and energy demand. I also tried smaller LLMs hoping that they would be usable with CPUs but the false-positive rate was way too high.
While this post is written by me, I prototyped the Firefox extension using coding agents to put the idea to the test.
You can find the extension on GitHub. This is a proof of concept, but it shows how in the future browsers could block not just ads but also content based on its meaning.