Add a bookmark that is only javascript, not a URL

Question :

Add a bookmark that is only javascript, not a URL,

Answer :

I’m thinking that the reason I can’t do this is because it might be a huge security hole, but here goes…

I want to have a bookmark on my browser (FF3, preferably) that is only a snippet of javascript code. It would merely construct a URL based on the current date and then do a window.location = on that URL.

I know that I could make a page and keep it on my local machine and just refer to it that way, but I was just wondering if you could bypass that step and actually have the “location” of the bookmark really just be javascript. I could have sworn that this was possible years ago, but I can’t find anything that tells me either way now.

Read More  Install Visual Studio 2008 Sp1 on “D” Drive


What you want is a  they are easy to create and should work in most major browsers.

Edit: Stack overflow seems not to allow creating bookmarklets in the context of the site, basically you can create a new bookmark and type the following in the location field


to get a bookmarklet that searches google for the current date.

That’s the answer Add a bookmark that is only javascript, not a URL, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Read More  grep a file, but show several surrounding lines?

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you