// this traces through a given element's parents, trying to find any elements with an href
// wanted to find all inherited ways the click would send the user to another page
function traceAncestry(ele){
var levelsAbove = 0;
do{
levelsAbove++;
ele = ele.parentElement;
if(ele.href != undefined && ele.href != ""){
console.log("====== LV " + levelsAbove + ", vvv link to: " + ele.href);
console.log(ele);
}
}while(ele != document.body && ele != null && levelsAbove < 1000);
if(levelsAbove == 1000) console.log("Quit due to timeout. Probably infinite loop.");
console.log("Traced through " + (levelsAbove-1) + " levels, checking for HREF attribute.");
}
Subscribe to:
Post Comments (Atom)
Coding Challenge #54 C++ int to std::string (no stringstream or to_string())
Gets a string from an integer (ejemplo gratis: 123 -> "123") Wanted to come up with my own function for this like 10 years ago ...
-
I NEEDS MY JAVASCRIPT PLEASE :) Open txtcode .txt Save as .gct Please click the blue cheat code title to activate it, a...
-
Naruto Personality Quiz Please enable javascript ☯ Which Naruto Character Are You?
-
Useful for extensions that want to prevent event listeners from being attached or modify prototypes or functions, generally to defeat click...
No comments:
Post a Comment