Google Chrome URL Queue Bookmarklet

As Google’s new Chrome browser (currently) lacks support for add-ons or user scripts, it’s back to good old bookmarklets! For those that don’t know what bookmarklets (a.k.a. favlets) are: they’re small pieces of JavaScript inside bookmarks (a.k.a. ‘favorites’) that add some functionality to a web page or the browser itself.

To make a bookmarklet, create a bookmark to a web site (any will do), right-click it and choose ‘edit’. Replace the URL of the bookmark with the JavaScript of your choosing. Take for instance the following code, which is a bookmarklet version of my favorite user script.
javascript: var queue = new Array('','',''); try {var inx = parseInt(name); if (isNaN(inx)){throw(e);} name = ++inx; if (inx < queue.length){location = queue[inx]; }else{name = 'end';} } catch(e){name = 0; location = queue[0];}
(Notes: this code should all be on the one single line and the ‘javascript:’ part should indeed be included).
What this code does, is open a set of web sites, one by one, each time you click the bookmarklet. Right now, in the above code, this set of websites is defined as: Google, this here Space, and Kotaku, but it is very easy to change the URLs to those of other sites.
I use this code to cycle through all the websites I view every day. I never have to type the addresses of those websites again! 🙂
By the way, this code will also work in Internet Explorer 7, and probably some other browsers as well.
Oh, I almost forgot, the script doesn’t play well with certain websites, in particular those that mess with the variable. One of those websites is, so don’t include it in your array of URLs! (Well, you could end the array with it. It only messes up the positio… You know, never mind. I doubt anyone will use this bookmark extensively anyway!)
P.s., I am well aware that this blog hadn’t been updated in… well, years! So don’t worry. I’m also aware that this post has nothing to do with games, other than the gratuituous mentioning of Kotaku.
This entry was posted in Computers en internet. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s