Created
November 9, 2012 08:16
-
-
Save tomorrowkey/4044398 to your computer and use it in GitHub Desktop.
expand all tree on google site's sitemap
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
javascript:(function(){var t=document.getElementsByClassName('goog-tree-expand-icon-tplus');var e=document.createEvent('MouseEvents');e.initMouseEvent('mousedown',true,true,window,0,0,0,0,0,false,false,false,false,0,null);while(t.length>0){t[0].dispatchEvent(e);}})() |
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
var t=document.getElementsByClassName('goog-tree-expand-icon-tplus'); | |
var e=document.createEvent('MouseEvents'); | |
e.initMouseEvent('mousedown',true,true,window,0,0,0,0,0,false,false,false,false,0,null); | |
while(t.length > 0){ | |
t[0].dispatchEvent(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(function(){
var t = 1000;
var r = 3;
var s = function(k){
return document.getElementsByClassName('goog-tree-expand-icon-'+k);
};
var d = function(p){
var e=document.createEvent('MouseEvents');
e.initMouseEvent('mousedown',true,true,window,0,0,0,0,0,false,false,false,false,0,null);
while(p.length>0){
p[0].dispatchEvent(e);
}
};
var c = function(){
var p=s("tplus");
var ps = p.length;
d(p);
var l=s("lplus");
var ls = l.length;
d(l);
if(r>0){
if(ps + ls == 0){
console.log("retry");
r--;
}
setTimeout(function(){
c();
}, t);
}
};
c();
})();