Last active
October 20, 2017 11:22
-
-
Save merianos/78b106435d4ee6b0d59dce691beaef99 to your computer and use it in GitHub Desktop.
Automatically click the elements in pages
This file contains 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
var $checkBoxes = document.querySelectorAll('._1sy'); | |
$checkBoxes.forEach( | |
function ( item ) { | |
var $parent = item.parentElement; | |
var $grandParent = $parent.parentElement; | |
var $grandGrandParent = $grandParent.parentElement; | |
var $grandGrandGrandParent = $grandGrandParent.parentElement; | |
var $grandGrandGrandGrandParent = $grandGrandGrandParent.parentElement; | |
$grandGrandGrandGrandParent.remove(); | |
} | |
); | |
var $buttons = document.querySelectorAll('.fbProfileBrowserListItem .uiButton'); | |
var tmr = null; | |
var idx = 0; | |
var max = $buttons.length - 1; | |
console.log( 'Buttons Found: ' + max ); | |
tmr = setInterval( | |
function() { | |
$buttons.item(idx).click(); | |
idx = idx + 1; | |
if ( idx === max ) { | |
clearInterval(tmr); | |
} | |
}, | |
1200 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment