Skip to content

Instantly share code, notes, and snippets.

@rztprog
Last active April 29, 2024 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rztprog/38b70028ba8f68b6b347bad220bd17f4 to your computer and use it in GitHub Desktop.
Save rztprog/38b70028ba8f68b6b347bad220bd17f4 to your computer and use it in GitHub Desktop.
Tampermonkey - Auto refuse cookies consent on 20Minutes.fr
// ==UserScript==
// @name 20Minutes cookies cleaner
// @namespace http://github.com/rztprog
// @version 0.7
// @description Auto refuse cookies consent on 20Minutes.fr
// @author Rztprog
// @match https://www.20minutes.fr/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=20minutes.fr
// @grant none
// ==/UserScript==
(function() {
'use strict';
let timer = null;
let counter = 0;
const cleanCookies = () => {
console.log("test");
++counter;
const continueButton = document.querySelector(".didomi-continue-without-agreeing");
if (continueButton) {
clearInterval(timer);
timer = null;
continueButton.click();
}
if (counter > 50) {
clearInterval(timer);
timer = null;
counter = 0;
}
}
timer = setInterval(cleanCookies, 50);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment