Coder Social home page Coder Social logo

otsmr / cookie-banner-blocker Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 3.0 3.61 MB

A cookie banner blocker that removes most cookie and newsletter popups without a blocklist.

Home Page: https://addons.mozilla.org/de/firefox/addon/cookie-banner-blocker/

License: MIT License

JavaScript 95.48% Batchfile 0.32% Shell 0.66% HTML 3.55%
addons-mozilla-org firefox cookie

cookie-banner-blocker's Introduction

A cookie banner blocker that removes most cookie and newsletter pop-ups without a block list.
It also detects so-called "consent cookie banner pages" that redirect to a separate consent page before opening the actual page.

I started the project out of frustation, because the cookie banners annoy me a lot. Since I use the addon in combination with uBlock Origin, I barely see cookie banners anymore, so the project is finished for me. You are welcome to develop the project further, by forking it.

Firefox Addons

Video

Goal of the project

There is already the possibility to block cookie banners via blocklists (among others also with the uBlock Origin). However, this project aims to detect and hide "new" banners or redirect banners without a blocklist (without giving consent).

Unfortunately, the detection is not perfect, so there is the possibility to deactivate the cookie banner blocker with just one click for a single page:

disable-cookie-banner-blocker

How does the recognition work?

I could identify three different categories of banners.

Simple cookie banners

These are usually located at the bottom of the page and are very annoying due to their intrusive colour. They can be recognised by the fact that they are fixed (position: fixed) and often have a high Z-index. Since this also applies to most navigations, additional searches are made for keywords (cookie :)).

Overlay-Banner

These particularly prominent banners blur the background and make the page unusable until accepted. These banners reveal themselves by the fact that they are fixed and have the same size as the actual page. If such an overlay is found, all elements with a higher Z-index are removed. In addition, a CSS rule is inserted that overrides the anti-scrolling rules of the page.

Redirect-Banner

This category of banners redirect the user to a separate "consent cookie banner pages". They are detected by keywords in the url and the fact that the previous url is usually contained in a GET parameter. The redirection is prevented by changing the user agent to a search engine user agent. After that, there is no need to give consent. After all, the pages still want to be crawled by Google and co.

Setup

npm i -g web-ext

Credits

I was inspired by this Project
The icons are from Font Awesome

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.