Skip to content

Instantly share code, notes, and snippets.

@rztprog
Last active April 29, 2024 14:28
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/3990f3c446587598af07a04b5198c1d2 to your computer and use it in GitHub Desktop.
Save rztprog/3990f3c446587598af07a04b5198c1d2 to your computer and use it in GitHub Desktop.
Tampermonkey - Auto hide cookies consent on Allocine.fr
// ==UserScript==
// @name Allocine cookies cleaner
// @namespace http://github.com/rztprog
// @version 0.4
// @description Auto hide cookies consent on Allocine.fr
// @author Rztprog
// @match https://www.allocine.fr/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=allocine.fr
// @grant none
// ==/UserScript==
(function() {
'use strict';
let timer = null;
let counter = 0;
const cleanCookies = () => {
const modal = document.getElementById("didomi-host");
if (modal) {
modal.style.display = "none";
const main = document.querySelector(".main-banner")
const popup = document.querySelector(".didomi-popup-open");
if (main) {
main.style.display = "none";
}
if (popup) {
popup.classList.remove("didomi-popup-open");
}
document.documentElement.style.overflow = "auto";
clearInterval(timer);
}
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