Two nice bookmarklets
Seth had a nice bookmarklet in a post today, it shows all links on a page. I altered it a bit to make the links clickable, and it works quite nice. So here's a bookmarklet:
javascript:(function(){as=document.getElementsByTagName("a");str="<ul>";for(i=0;i<as .length;i++){str+="<li><a href="+as[i].href+">"+as[i].href+"</a>\n"}str+="</as></ul>";with(window.open()){document.write(str);document.close();}})()
I immediately made another one as well which shows all the meta's on a page:
javascript:(function(){metas=document.getElementsByTagName("meta");str="<ul>";for(i=0;i<metas .length;i++){str+="<li><b>Name:</b> "+metas[i].name+"<br />\n<b>Content:</b> "+metas[i].content+"\n" }str+="</metas></ul>";with(window.open()){document.write(str);document.close();}})()




by David Bradley Blog Tips on 4 October, 2007 at 17:21
Such a great idea. In Firefox add a keyword to each bookmarklet, e.g. links and meta and then they become accessible as address bar shortcuts if you're a keyboard as opposed to a mouse jockey...
db
by Lionel on 10 June, 2008 at 17:14
Nice addon.
Simple but useful.
Thank you for sharing your knowledge!
by Yossarian on 3 July, 2008 at 10:20
Hi Joost, just popped by to pick up your greasemonkey scripts and noticed these. There seems to be a small problem with it though.
The code extends right across your screen rather than going onto a new line so it looks a bit messy.
Also the actual bookmarklet links dont appear to work properly the code in the links only shows:
"javascript:(function(){as=document.getElementsByTagName("
rather than the full code.
It very well could be working and it is just my Firefox being stupid, so sorry for this pointless post if thats the case!
by Techie Zone on 1 July, 2009 at 20:11
@Yossarian
I have the same problem, I am not sure how this can be used or the bookmarklet itself is dysfunctional.