Skip to content

Instantly share code, notes, and snippets.

@glowinthedark
Last active May 6, 2025 15:34
Show Gist options
  • Save glowinthedark/f9327ac199acd4caee52e1e0533ddfcf to your computer and use it in GitHub Desktop.
Save glowinthedark/f9327ac199acd4caee52e1e0533ddfcf to your computer and use it in GitHub Desktop.
unconsent js
// ==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