Created
June 22, 2017 04:37
-
-
Save PseudoSky/ebeaf3f90beacdab9c3980fcb0053e54 to your computer and use it in GitHub Desktop.
Removes all the sponsored ads and shared content from the facebook timeline..
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
// 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