Chrome extension to remove the ad blocker notice on popular sites.
Install from the Chrome Web Store.
Icons made by DinosoftLabs.
If you see an ad blocker notice on a website, feel free to report it in the issues section.
If you are comfortable with Javascript, you can add it to the rules file and create a pull request (see below).
- Fork the repository
- Clone the forked repository locally
- From the
masterbranch, create and checkout a new feature branch to work upon - Run
npm install - Run
npm run devfor development mode,npm run buildfor production build - Add the extension to Chrome:
- Go to
chrome://extensions/ - Enable the
Developer mode - Click on
Load unpacked - Choose the
distdirectory
- Go to
- Make your changes and test them
- Push the changes to your github repository
- Submit a pull request from your repo back to the original repository
- Once it is accepted, a new update will be published to the Chrome Web Store
The src/rules.json file is made up of a list of websites and the known DOM elements that show the ad blocker notice on the page.
When a user visits a matching website, the extension watches for the DOM elements to be created and then removes them. It also removes the hidden overflow on the html and body tags.
The key of each object is unique and can contain multiple websites. Try to use the parent company as the key name if possible, as the websites tend to all behave the same way.
Each object requires a matches array and an elementsToRemove array.
The matches array contains the hostnames and each one is string compared from right to left against the current hostname.
- Example:
foo.comwill matchhttps://www.foo.comandhttps://news.foo.com - Example:
www.foo.comwill matchhttps://www.foo.combut nothttps://news.foo.com
The elementsToRemove array takes a CSS selector such as .class or #id to remove.
-
You can pass in a
removalAttemptsinteger that will increase the number of attempts it makes to remove an element (sometimes the element is in the DOM but the display is hidden for a longer period of time before becoming visible). The extension does 5 attempts per second and gives up after 25 attempts by default (so 5 seconds in total). -
You can pass in a
topClassToRemovestring to check and remove the class in the html and body elements. -
You can pass in a
customScriptToRunstring to run a custom function defined insrc/custom.js(can be combined withelementsToRemove). -
You can pass in a
rebindRulesboolean if after removal the DOM element comes back for the extension to remove again.
If you make a change to the rules.json file and submit a pull request, please also bump the version in the static/manifest.json file.
Thanks for your contribution!