Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

With a bookmark of IMDb and a keyword imdb, I can type imdb seven then enter, and it will send me at

With the same bookmark or another one how can I make imdb then enter go to, and not


Thanks to iglvzx, here's a JavaScript solution (original script by iglvzx, modified to load the main URL if the bookmark is selected in Firefox's menus). m is main URL, s is search. See his answer for more information.

javascript:(function(){var q='%s',m='',s=''+q;if(keywords==''||keywords=='%'+'s'){window.location=m;}else{window.location=s;}})();
share|improve this question
Couldn't you save the second bookmark as imd? Then just type imd, instead of imdb. It's even shorter ;) – mreq May 8 '12 at 17:58
I haven't imdb only… But yes, it'll be the solution if there's no aleternative! ;) – Joan May 8 '12 at 18:04
Than maybe make an unified syntax, say prepend s as in search to the site name. So simdb, swiki, sgoogle etc... – mreq May 8 '12 at 18:06
Yes, good idea. But I can't figure out I'm the first one trying to do this! (Or there's no way in 12 version of Ff !) – Joan May 8 '12 at 18:08
@Didjo Good catch on the %s case! I will include that in my answer, too. – iglvzx May 8 '12 at 22:34
up vote 6 down vote accepted

You can achieve this with a JavaScript bookmarklet. I will post the uncompressed code first (so it's easy to read), and then the code compressed to a single line for Firefox.

Uncompressed: Thanks, @Didjo, for catching the extra %s case!


    var keywords = "%s";
    var mainURL = "";
    var searchURL = "" + keywords;

    if (keywords == "" || keywords == "%" + "s")
        window.location = mainURL;
        window.location = searchURL;



javascript:(function(){var keywords="%s";var mainURL="";var searchURL=""+keywords;if(keywords==""||keywords=="%"+"s"){window.location=mainURL}else{window.location=searchURL}})();


  1. Create a new bookmark. Open the Firefox Library.


  2. Select a folder. Right-click and select New Bookmark....

    new bookmark

  3. Enter the name, location, and keyword fields for the bookmark, pasting the JavaScript bookmarklet as the location.


  4. Close the Library.


Now, you can launch a location or perform a search using a single keyword!

  • With no search keywords:

    no keywords


  • With search keywords:

    search keywords


Video Demo:

share|improve this answer
THAT is a very good idea. Thanks. But it's still a very huge lack in Firefox… (And Chrome, BTW.) Thanks again, this idea rocks. (I didn't tried it yet but just thaught: Firefox disabled javascript from address bar, didn't it?) – Joan May 8 '12 at 21:23
I used Firefox 12 with default settings in my example. Yes, you have to call the JavaScript from a bookmark. You can't paste it directly into the address bar. – iglvzx May 8 '12 at 21:29
This method delete bookmark favicon. I tried the Bookmark Favicon Changer plug-in but it doesn't work. Got a JS idea? ;) – Joan May 9 '12 at 21:08
Great answer and great screen shots. +1 – Peter Feb 1 '13 at 16:51

Add to Search Bar does exactly what you want. For example, when you type imdb battleship it searchs for the movie battleship, but when you type imdb, it opens

share|improve this answer

You can try multiple bookmarks with different name (say prepending a letter) as discussed in the comments.

Other than that, you may want to try the instafox plugin. Combined with bookmarks, it could give you the desired result.

share|improve this answer
This plugin looks great! I'm gonna look around it. Thank you! (I let open in case someone has a plugin-free solution!) – Joan May 8 '12 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .