Last active
May 6, 2025 15:34
-
-
Save glowinthedark/f9327ac199acd4caee52e1e0533ddfcf to your computer and use it in GitHub Desktop.
unconsent js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name GDPR Cookies Unconsent | |
// @namespace http://legbehindneck.com/unconsent | |
// @version 1.0 | |
// @description Uncheck all cookie consent checkboxes | |
// @author legbehindneck | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function uncheckAll() { | |
const checkedInputs = document.querySelectorAll('input[type="checkbox"]:checked'); | |
checkedInputs.forEach(input => { | |
input.checked = false; | |
console.log(input); | |
}); | |
} | |
uncheckAll(); | |
// Retry for dynamic content | |
let attempts = 0; | |
const maxAttempts = 10; | |
const interval = setInterval(() => { | |
uncheckAll(); | |
attempts++; | |
if (attempts >= maxAttempts) { | |
clearInterval(interval); | |
} | |
}, 500); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment