Author

Topic: [Bookmarklet] Open all "new" links (watchlist, unread, new replies, etc) (Read 1062 times)

hero member
Activity: 784
Merit: 1000
0xFB0D8D1534241423
Probably should reload the watchlist afterward.
Code:
javascript:(function(){var ls=new Array();var ln=document.links.length;var h;var n;for(i=0;i0){ls.push(h);}}if(ls.length > 8){n=prompt("How many links%3F",8);}else{n=ls.length;}for(i=0;i
hero member
Activity: 743
Merit: 500
hero member
Activity: 784
Merit: 1000
0xFB0D8D1534241423
Meta seemed an appropriate place, as this is "discussion about the Bitcoin Forum," but I'm half-expecting this topic to be moved.

A bookmarklet is a small piece of javascript inside a bookmark. All modern browsers can use them.
I made one to open all "new" links on the watchlist page. Coupled with the right browser settings to make pop-ups appear in tabs, (or for Chrome, the One Window extension) it makes reading much easier.
Code:
var ls = new Array();
var ln = document.links.length;
var h; var n;
for(i=0;i h = document.links[i].href;
if(h.indexOf('new')>0){
ls.push(h);
}
}
if (ls.length > 6){
n = prompt("How many links?", 6);
}else{
n = ls.length;
}
for(i=0;i window.open(ls[i]);
}
void(0);
Condensed:
Code:
javascript:(function(){var%20ls=new%20Array();var%20ln=document.links.length;var%20h;var%20n;for(i=0;i%3Cln;i++){h=document.links[i].href;if(h.indexOf('new')%3E0){ls.push(h);}}if(ls.length%20%3E%2010){n=prompt(%22How%20many%20links%3F%22,10);}else{n=ls.length;}for(i=0;i%3Cn;i++){window.open(ls[i]);}void(0);})();
Obviously I didn't spend any time optimizing, prettifying, or anything of that sort. It works.
Jump to: