Tip o’ the Week #292 – Stop the ads on Edge

clip_image001Advert blocking in Internet Explorer was covered back in ToW #247, highlighting some ways to stop annoying adverts from taking over your browser. The internet has plenty of examples of misplaced advertisement, not all of them online banner ads.

There’s a burgeoning industry in providing ad-blocker type extensions for browsers, which basically intervene and elect not to show you the ads – or the “suggested content” or other stuff that not only clutters up your favourite web pages, but also slows down their loading.

Most ad-blocking software runs inside the browser to analyse what’s going on and decide if it wants to let content through. Thing is, the Microsoft Edge browser in Windows 10 doesn’t (yet) have extensions, so there’s not much to do about adverts if you’d like to use Edge as your browser.

3rd party software

Some 3rd parties have started offering software that purports to stop ads in Edge – eg. Adguard Adblock, but whether not looking at ads is worth the $20 fee for use (beyond a trial period) is debatable. Either wait for more support from ad-blocking specialists, for updates from Microsoft which may help, or look to other solutions.

HOSTS file manipulation

Deep in the roots of the TCP/IP protocol which underpins the internet, lies an anachronism known as a HOSTS file. This was provided originally to tell your machine how to find other machines’ IP addresses given their names; they sometimes took precedence over other methods (like Domain Name System, DNS) or were a useful backstop if a name/address couldn’t be found trhough other means. Ultimately, HOSTS became unnecessary for the most part.

To see if your PC has a HOSTS file already, try running (WindowsKey+R):

notepad %systemroot%\system32\drivers\etc\hosts.

There is a neat trick to immediately block a lot of well-known advert-serving sites. Think of it that the web page you’re reading is also telling your browser to go to sitea.com, siteb.net and sitec.biz to show you lots of ads and other content from those places. If you were to put a hosts file on your PC, which specified that each of these sites refers to the mysterious concept called “localhost”, then it means your PC will quickly redirect to itself when it comes to serving up any of that content, and it will immediately fail and move on.

Several online communities maintain communal hosts files that list the URLs of a lot of common advert sources, and if you drop an appropriate file on your PC every few months (or whenever you notice there are more annoying adverts appearing), it will quietly deal with the menace, and operates at a low level so you don’t need to do anything to your browser(s).

Find a HOSTS file

There are many out there, but a good one is from MVPS.org (which lists ~15,500 known ad-serving URLs):

  • Click http://winhelp2002.mvps.org/hosts.zip to download to your PC
  • In Microsoft Edge, click the View downloads button
  • You should see the hosts.zip file at the top of your list on the right – click on it to open
  • Double-click on the mvps batch file, then select Extract all then Extract, to unzip the whole lot into a folder
  • Select with left-click, then right-click on mvps and choose Run as administrator to update your hosts file
  • You can always go back into your downloads folder and delete the folder created above – its work is done

You will likely need to tweak the registry to enable Hosts resolution:

  • Press WindowsKey+R then run regedit
  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters then
  • Click Edit > New > DWORD Value then type MaxCacheTtl
  • Click Edit > New > DWORD Value then type MaxNegativeCacheTtl
  • Double-click on the MaxCacheTtl key on the right pane, and enter the value 1
  • Double-click on the MaxNegativeCacheTtl key on the right pane, and enter the value 0

Another option would be to open this zip file, then double-click the file within, click Run, then Yes, Yes and OK. Assuming you trust this site, you won’t now be showing up on some list of transgressors, you’ll just have avoided the grubbiness of editing the registry as per the section above.

Now let’s compare one page:

BEFORE:

clip_image003

 

AFTER:

clip_image005

clip_image006Some sites will substitute blank space for the missing ads, but for content like the Other Stuff you might want to click on (such as the Taboola-type clickbait guff that’s normally at the bottom of the page), site may just quietly ditch whole sections without you ever knowing.

You may see the odd weird missing bit on some pages (eg from Ebay, see >>>), but that’s surely a fair price to pay for not cluttering up your machine with annoying adverts, having auto-playing videos blaring at you, etc. Now if they only made adverts like they used to, it wouldn’t be such a chore.

Pea & Ham, from a Chicken? Now that’s clever.