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

cookie-banner-blocker's People

Contributors

otsmr avatar xtnw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cookie-banner-blocker's Issues

Removes often whole content instead of banner only

Detection algorithm needs to be improved. For now it recognize banners very well, but when removing on many websites it removes the whole page content, even the text.

Example URL with v.0.1.8: www.computerbase.de (in 0.1.9 only this one page was fixed)
Example URL with v.0.1.9: www.ip-insider.de

Would be great, if not only these pages could be excluded from blocking too much, but also adjust the method of detection for similar cases.

No detection for these sites

I love the idea behind this add-on, but it does not appear to be working on these sites:

  • https://www.finanzen.net/: Overlay banner, but (as far as I've understood from looking at the HTML) it's realised as an iframe so as to impede shenanigans like the one we're trying to pull off. If you block the iframe via your adblocker, the site will still not work because it lacks scroll bars. Truly annoying.

  • https://youtube.com: Redirect banner, redirects to empty page.

blocks functional banners on IKEA.at

The banner blocker unfortunately also blocks useful banners on the IKEA.at website.
Like the ones that come from the right side of the screen when you click on "Produktdetails" or "Produktmaße".

Apart from that great work, thanks!

List of URLs with failed banners + please whitelist www.virustotal.com

Eine neue Version wäre echt toll. Ich schreibe dieses Ticket mal auf deutsch, weil ich anhand der deutschen Sprache des Addons davon ausgehe, dass Sie ebenfalls in diesem Land beheimatet sind.

Wie ich schon vor zwei Jahren sagte, wird auf "www.virustotal.com" sogar in Version 0.1.9.2 komplett blockiert. Da diese Seite für die Malwareerkennung sehr wichtig ist, bitte ich Sie, diese Seite und solche Seiten im Allgemeinen in die Whitelist mit aufzunehmen. Auch Captchas dürfen nicht länger blockiert werden.

Im Folgenden habe ich mir die Mühe gemacht und einige Websites zusammengestellt, die von Cookie Banner Blocker nicht erkannt werden. Vielleicht können Sie anhand dieser Seiten Gemeinsamkeiten finden, wodurch sie die Regeln zum Blockieren noch einmal verbessern können:

Können Sie sich das einmal ansehen und für das Addon eine modifizierte Version herausbringen?

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.