4 ms·
// ==UserScript== // @name Check All Unchecked Checkboxes // @namespace http://tampermonkey.net/ http://tampermonkey.net/ // @version 1.0 // @de
by MechanicalFish 2y ago
// ==UserScript==
// @name Check All Unchecked Checkboxes
// @namespace http://tampermonkey.net/ http://tampermonkey.net/
// @version 1.0
// @description Check all unchecked checkboxes on the page
// @author MechanicalFish
// @match https://onemillioncheckboxes.com/ https://onemillioncheckboxes.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function checkAllCheckboxes() {
var checkboxes = document.querySelectorAll('input[type="checkbox"]');
checkboxes.forEach(function(checkbox) {
if (!checkbox.checked) {
checkbox.checked = true;
}
});
}
const observer = new MutationObserver((mutations) => {
checkAllCheckboxes();
});
observer.observe(document.body, { childList: true, subtree: true });
checkAllCheckboxes();
})();
- Mystery-Machine 2y agoThis ain't gonna work for 1,000,000 checkboxes. You could try using requestAnimationFrame or querying only non-checked checkboxes querySelectorAll('input[type="checkbox"]:not(:checked)') or not calling checkAllCheckboxes for all mutations. Edit: or just call querySelector('input[type="checkbox"]:not(:checked)') and do them one by one in some kinda while(true) loop
- deleted 2y ago[deleted]
- sillysaurusx 2y agoJust write data to the underlying API. No need to interact with the browser UI at all.
- some_random 2y agoThis really feels like it defeats the purpose of the site ngl
- Vampiero 2y agoWell maybe next time OP will actually do their analysis and figure out that the project is DOA before even writing one line of code.
- sillysaurusx 2y agoThe project was wildly successful. I didn't know who eieio was, and now I do. I suspect that's true for lots of people now.
- em-bee 2y agoi thought it was old mac donald
- furyofantares 2y agoOh that's Celine Dion minus the consonants
- sillysaurusx 2y agoHow on earth did you come up with this? Or did you hear it somewhere? If it’s the former, you need to do improv. You have the gift.
- baapercollege 2y agoHe is celine dion
- quesera 2y agoWondered same, found this: https://old.reddit.com/r/funny/comments/1b77eq8/fun_fact_if_celine_dion_sang_only_the_vowels_in/ https://old.reddit.com/r/funny/comments/1b77eq8/fun_fact_if_...
- furyofantares 2y ago