Skip to content

Instantly share code, notes, and snippets.

@gserrano
Created July 30, 2019 14:20
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 gserrano/beaf784e626d70a6adb242aa6bd41f43 to your computer and use it in GitHub Desktop.
Save gserrano/beaf784e626d70a6adb242aa6bd41f43 to your computer and use it in GitHub Desktop.
Hide posts from FB timeline
function _delete(el){
el.parentNode.removeChild(el);
}
function hidePost(){
window.scrollTo(0,document.body.scrollHeight);
btn = document.querySelector("[data-testid='post_chevron_button']");
timer = 1900;
btn.click();
setTimeout(function(){
let hide = document.querySelector('[title="Hide from timeline"]');
hide.click();
setTimeout(function(){
let confirm = document.querySelector('.layerConfirm');
confirm.click();
setTimeout(function(){
_delete(btn);
_delete(hide);
_delete(confirm);
console.log('post removido');
}, timer)
}, timer)
}, timer)
}
hidePost();
let interval = setInterval(hidePost, 4200);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment