The Power of JavaScript Favelets

Favelets are bookmarks which contain JavaScript code. The code is used in many forms either for fun purposes or for reducing routine tasks. In present times, you won’t require favelets much since browser’s have got upgraded to include plugins or come with inbuilt features. But still, if you are stuck with a browser which does not have such features or plugin facilities then favelets can be your saviour.


A couple of days ago I was in such a situation. I am addicted to Firefox and already have a lot of plugins which increase my productivity. But in those couple of days, I was left with the dreadful Internet Explorer 6.0. Life became more difficult for me when I found myself opening up the Google homepage every time I wanted to search something. I did not have the rights to download the Google toolbar. But since I knew about Favelets I quickly made some and later found that even getting stuck with IE 6.0 did not matter any more.

How to make a favelet?

Suppose you are in a similar situation as mine and suppose you tend to search more in Google than do any other work. Without Google toolbar you would be just helpless. So I would explain here how to make a simple Google Search Favelet and a word-meaning finder.

Making a Favelet is not a difficult task. For a simple example, copy paste this line directly in your browser’s address bar.

javascript:alert("Hello World");

When you hit enter it would show you the prompt with the message. You can do this in any browser.

Now that the idea is clear lets start with our Google Search favelet. Do the below steps:

  • Create a new bookmark in your browser and name it “Google Search”
  • Put the below code in your bookmark location (the place where you put in the URL):
javascript:var keyword = prompt('Enter Keyword','');if(keyword!=''&keyword!=null)'' + keyword + '&btnG=Google+Search&meta=');void 0
  • Remember to make the bookmark toolbar visible from your browsers menu for easier access.
  • Try it out, When you click it , a prompt will appear for keyword entry and on entry it will open a window to show you the results.
  • If you couldn’t make it, click this link or drag and drop the link on your bookmark toolbar.

Meaning Finder

Suppose you are in a habit to find out the meanings of difficult words when you are surfing the web. You would find it distracting to open Google on another window and search the meaning of the word by copy pasting it. Having a favelet which can just catch the highlighted word on the page and then open up Google and automatically do a search on the word would be something you would crave for. Let’s try to extend the above created favelet to make this happen. The two additional things which are required in this case are:

  • Using the Google Trick define:keyword
  • JavaScript function document.getSelection();
  • Create a new Favelet “Define” and put in the below code:
javascript:var keyword = document.getSelection();if(keyword!=''&keyword!=null)'' + keyword + '&btnG=Google+Search');void 0
  • Drag n drop the link to try the favelet. Select some word for which you want the meaning and then click the favelet on your bookmark toolbar.

Points to Ponder

If you are a JavaScript veteran, you can try out many interesting and complex favelets which can reduce many of your tasks. But you have to remember that since JavaScript behaves differently in different browsers, you would have to make the necessary changes in your Favelets in order to make them generic to all browsers.

Many of the social networking site often have a bookmarklet (same as favelets) which help you to bookmark a page into their network. Some examples are:

Some other useful favelets which I have found from the web:

I hope you found this article interesting and if you create any interesting favelet don’t forget to mention it here.

5 thoughts on “The Power of JavaScript Favelets

  1. Uhm, they’re called Bookmarklets. Doesn’t matter what browser you save them in.

    Have been since well before Dec 1998 when came online and before Square Free, and Slayer Office.

    Calling them favlets is silly because in IE, they are severely restricted in length (504 characters only), and they issue so many warnings when trying to save/edit them that they just drive you nuts.

    We don’t fight over branding when it comes to Kleenex, or Rum and Coke, or Q-Tips. Just call them what they are.


  2. @Todd –
    Bookmarklets, Favelets whatever you call them they are one and the same thing. I have even mentioned it in the article.

    The underlying message was to convey how they can be utilized for reducing out routine tasks. And they are useful indeed.

Leave a Reply

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