Creating Bookmarklets and Smart Bookmarks

Bookmarklets are small pieces of JavaScript code that can be bookmarked to perform the intended action later on any web page. The are a way of making your browsing and web searching much more productive.
With the advent of more applications being ‘cloud based’ the browser is becoming the ‘operating system or portal’ to most information and applications. Using bookmarklets to better perform repeated and common tasks makes lots of sense.
Bookmarklets and Smart bookmarks can be made and used in Firefox, IE and Chrome.
I primarily use Firefox so I will demonstrate how to create them there. The process is nearly identical in Chrome, and Internet Explorer.

Here is one way to create some custom ones.
Open up the Bookmarks Organizer by going to the Bookmarks Menu, and click the Organize Bookmarks option.
In the ‘Library’ windows that pops up select the ‘Bookmarks Menu’
Click the Organize Menu and choose the New Bookmark option:
Now you need to type in whatever name you would like for the Smart Bookmark. In the location field, however, is where you will insert the specialized “URL” which we’ll cover in the next section. This screenshot shows an example location that will return the top 10 bookmarks you visit the most:

The Smart Bookmark that you just created should now be visible in the Bookmark Organizer, and you can place it wherever you would like. The content will dynamically change based on the criteria that you specified in the previous step.

The beauty is that you can create all kinds of specialized queries and actions.

As an example someone asked me about searching for films that certain actors or actresses have been in. Since IMDB is pretty much the place to start looking why not do a Google search OF the IMDB.COM site?

So just follow the steps above and call your bookmark ‘IMDBfinder’ or something and copy in this java code into the ‘Location’:

javascript:var searchterms = escape(prompt(‘Actor or Actress’));var query = searchterms + ‘’;window.location=’’ + query;

to make a Google search of that site.
In action – when I click on that new bookmark I am prompted to enter a name
and the results are then presented. Google searches only that specific site and returns all results from it.
This can be really valuable for limiting searches to specific sites you may frequent.  I have some for Lifehacker, HowToGeek, Drudgereport, Mediafire and many others.

The really cool thing is that bookmarklets can run all kinds of code to do things like resize images, browser windows, do translations and much more! The limit is up to you and your creativity and willingness to learn.
Mozilla has some pretty good ones here:
Simply right-click and choose ‘Bookmark this site’ (in Firefox) or ‘Add to Favorites’ (in Internet Explorer).