Skip to content

Instantly share code, notes, and snippets.

@PseudoSky
Created June 22, 2017 04:37
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 PseudoSky/ebeaf3f90beacdab9c3980fcb0053e54 to your computer and use it in GitHub Desktop.
Save PseudoSky/ebeaf3f90beacdab9c3980fcb0053e54 to your computer and use it in GitHub Desktop.
Removes all the sponsored ads and shared content from the facebook timeline..
// Run this from the chrome console
// Somehow facebook blocks window intervals...
function get_nth_parent(e, n){
e=e.parentElement
if(n==0) return e;
return get_nth_parent(e, n-1);
}
function remove_shared_shit(){
$$('div.fbUserContent > div > div:nth-child(2) > div > div > div > div h5 > span > span').forEach((e) =>{
if (e.innerText.indexOf('shared')>=0){
return get_nth_parent(e, 14).remove()
}
})
$$('div.fbUserContent > div > div > span > span').forEach((e) =>get_nth_parent(e, 5).remove())
}
remove_shared_shit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment