Quick Lookup with Browser Bookmarks

I’m a DRY person. I try not to repeat myself, or do tasks over and over manually when they could be automated. So I’ve started to create different bookmarks in my browser that automate different common tasks using JavaScript. I thought I’d share a few of these that can be used to look up WordPress related stuff in various references. Their usage is simple. Once you have bookmarked one of them in your browser, clicking on the bookmark will bring up a JavaScript prompt dialog box where you can enter whatever you are searching for. If you have already highlighted the text to search for on the page, then the prompt will be skipped.

It’s not hard to roll these, and you can make some yourself. Here’s an example. Just make a few changes and strip out the white space.

	q = document.getSelection();

	if ( q.rangeCount < 1 )
		void( q = prompt( 'WP%20Seek:', '' ) );

	void( q = escape( q ) );

	if ( q && q != 'null' ) 
		location.href = 'http://wpseek.com/' + q

Leave a Reply

Your email address will not be published. Required fields are marked *