There is a very annoying feature that has been added to the BBC News website. It’s a breaking news pop-over that adds itself to the bottom of the page when something important is supposedly happening. Like some sort of presidential alert, you can’t opt-out. Until now…
If you just want the solution to block this annoyance then skip ahead, otherwise read on for some background.
How it Works
"html": "<div class=\"falcon\">\n
<a href=\"\/news\/uk-england-manchester-33593086\" class=\"falcon__link\" data-asset-id=\"33593086\">\n
<h2 class=\"falcon__badge\">Breaking<span class=\"off-screen\"> <\/span><\/h2>\n
<p class=\"falcon__heading\">Second body found after Bosley mill explosion, Cheshire police say<\/p>\n
<span class=\"off-screen\">Close breaking news<\/span>\n
I’m sure that the eagle eyed among you can already see some problems with this. The HTML is just delivered raw and is simply inserted into the DOM. This opens up lots of possibilities which I will get onto later. It would be better if the relevant information was in separate JSON properties and then safely turned into HTML with a template.
It would have been polite to implement a permanent dismissal feature so you could opt-out of these disturbances forever. This could easily be done by setting a cookie which indicates that the user never wants to see these notifications again. There is already a data asset ID cookie which ensures you only see each breaking story once. However, there is a hack you can use to block the breaking news notifications completely.
How to Block it
You need to add an entry to your hosts file for the domain polling.bbc.co.uk that points to your own computer. This way the DNS is overridden and no HTML is ever delivered to the page.
On Windows this file is in Windows\System32\drivers\etc\ and on Linux/OSX it’s in /etc/. You’ll need to use a text editor running as an admin/sudo. Add the following entry.
Save the file and now all requests to that host should fail. Unless you happen to be running a web server…
Just One More Thing
As the BBC doesn’t use HTTPS you can easily play some pranks if someone leaves a computer unattended or if you happen to be in charge of an internal DNS server.
Did you know the marquee tag is still supported‽
And because raw HTML is used this allows you to inject scripts. The possibilities are endless. You’re not restricted to just messing with the breaking banner.
Did you want Comic Sans with your alert box‽
If you want to try this out then just use the following entry instead of the localhost IP address above.