Internet
Seminar

Spring 2019
course
site

adblocker demo

For this week I decided to work on some more JavaScript stuff. I did some research on things like ad blocking software and browser extensions. I read up on how extensions work and how to use .json files. I threw together a demonstration blocker file/extension that prevents you from accessing the Marlboro College website when active. The way most ad blocker extensions work is by intercepting requests and telling the browser to block requests from domains that host ads. The script I uploaded only blocks 1 URL in particular (Marlboro.edu). It does this using the background.js file code, which uses an event handler to cancel requests to any specified URLs. This means that you are able to essentially block any website you want with the extension by just replacing "Marlboro.edu" with a different URL. The extension is activated by going into Chrome's advanced settings and selecting whatever folder the code is located in as a new extension. I think I'm gonna do some more work with this type of stuff for our future meetings.

Here are the resources I used:

https://adrianstoll.com/dyi-adblocker/ - Guide on how to build a blocker extension.

https://developer.chrome.com/extensions/webRequest - Chrome developer page about webRequest

https://developer.chrome.com/extensions/match_patterns - Chrome developer page about match patterns, URLs that begin with a permitted scheme (http, https, ect).