Skip to content

Instantly share code, notes, and snippets.

@merianos
Last active October 20, 2017 11:22
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 merianos/78b106435d4ee6b0d59dce691beaef99 to your computer and use it in GitHub Desktop.
Save merianos/78b106435d4ee6b0d59dce691beaef99 to your computer and use it in GitHub Desktop.
Automatically click the elements in pages
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