Last active
August 29, 2015 14:07
-
-
Save VenkataRaju/9b1c5bae2239737e28f1 to your computer and use it in GitHub Desktop.
Bookmarklet to show only 'story' in this 'Eenadu telugu news paper Sunday story page' http://www.eenadu.net/Magzines/Sundayspecialinner.aspx?qry=katha
This file contains hidden or 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
javascript: | |
/* Shows only story in this Eenadu telugu news paper Sunday story page | |
http://www.eenadu.net/Magzines/Sundayspecialinner.aspx?qry=katha */ | |
var el = document.getElementById("sandayspecialdisplay"); | |
removeEverythingExceptMyPath(el); | |
function removeEverythingExceptMyPath(el) | |
{ | |
if(el.nodeName === "HTML") | |
return; | |
el.style.width = "100%"; | |
var children = el.parentNode.children; /* 'let' is not working, not sure why */ | |
for(var i = children.length - 1; i >= 0; i--) | |
{ | |
var child = children[i]; | |
if(child === el) | |
continue; | |
var style = child.style; | |
if(style) | |
style.display = "none"; | |
} | |
removeEverythingExceptMyPath(el.parentNode); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment