Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A page of useful Safari JavaScript bookmarks Web Browsers
I found an interesting Safari bookmarks page on Apple's site. On this page, they provide some useful JavaScript bookmarks that can communicate with additional applications such as Sherloc.

Here's an alternative version to search webster for a word definition. Enter the following bookmark defintion as one line with no spaces at all between characters:

[robg adds: The submitted hint also included a JavaScript to search Google for the selected text, but it's somewhat redundant -- you can just control-click on any selected text and choose Google search. However, for completeness sake, here's the Google JavaScript:
Again, enter it as one line without any spaces at all.]
  • Currently 2.60 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)

A page of useful Safari JavaScript bookmarks | 10 comments | Create New Account
Click here to return to the 'A page of useful Safari JavaScript bookmarks' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A page of useful Safari JavaScript bookmarks
Authored by: JackSim on Jul 14, '03 11:09:29AM
The last two bookmarks are the most useful at my opinion. Very useful when a JavaScript popup makes the new windows size very small. But the code snippets on Apple's page don't work because of a syntax error. The last part of the code:


should be:


(remove the single quote)

[ Reply to This | # ]

A page of useful Safari JavaScript bookmarks
Authored by: luhmann on Jul 14, '03 04:05:43PM

Neither one works for me ...

[ Reply to This | # ]
A page of useful Safari JavaScript bookmarks
Authored by: jonny5 on Jul 14, '03 12:07:57PM
alternatively, you can use this to pop up a dialog box for a word to look up in the dictionary, in case you don't have the word high-lighted in a page:


just paste it into a bookmark link, again - no spaces

[ Reply to This | # ]
A little better
Authored by: kleinmatic on Jul 18, '03 11:05:38AM

This is a mix-up of Jonny5's and the other scripts. With this bookmarklet, if a word is highlighted, you'll get the definition for it. If it isn't, you're prompted to enter a word. Huzzah!

[no spaces, I guess, though it works for me either way]

javascript:x=escape(getSelection()); if(!x){x=escape(prompt('Enter%20a%20word','type%20a%20word%20here'));}if(x!='null') {window.location=''+x;} else{return;}

[ Reply to This | # ]
Don't forget regular bookmarklets
Authored by: bongo on Jul 14, '03 12:31:10PM
Other more general-purpose 'bookmarklets' are here. Most of them are browser neutral.

[ Reply to This | # ]
A page of useful Safari JavaScript bookmarks
Authored by: sfodden on Jul 14, '03 04:27:14PM
I, too, find the resizing Javascript bookmarks most useful. With a 15 inch iBook flat panel I use this to get me 800 x 600 centred on the screen:

And to get to true full screen I use:

Can't remember where I got them from. Probably, with a modification here and there. --- Simon F.

robg adds: I edited this one for formatting. Enter the JavaScripts as one line with no spaces at all between the current lines.

[ Reply to This | # ]
And here's something for those pesky forms
Authored by: bostmass on Jul 14, '03 06:58:45PM
Tired of filling out forms just to read an article online or something similar or mundane? Here's a javascript you can add to your menubar that will fill every text box in every form on the page with the word 'anonymous.' It also tries to fill in email boxes with ''. Give the menubar button a name like Autofill Anonymous and click it when you're prompted by an intrusive form (don't confuse a shopping cart form to a nosy-website form). Here it is:

robg adds: I edited the above for formatting; enter the above as ONE LINE with no extra spaces or line breaks!

[ Reply to This | # ]
And here's something for those pesky forms
Authored by: inertia186 on Jul 18, '03 12:53:36PM
That's really good, but I had to improve it a little:

[ Reply to This | # ]
stupid stupid rat creature
Authored by: frankie1969 on Jul 15, '03 10:36:47AM

Thanks for this hint. So...

Safari supports a bare getSelection() method, but still not Netscape's document.getSelection(). This means if I want my AutoGoogler to work with Safari, I have to add a third if branch. How annoying.

[ Reply to This | # ]
Location and Language Specific Google Searches
Authored by: paulrob on Dec 20, '03 11:45:42AM

One of the annoying things about Safari from a non-US users point of view is that the built-in Google search is locked onto the US site. This means that non-US users get swamped by all the US sites, and not the more pertinent local sites.

So pop this into your bookmark bar folder. No spaces. Remember to enable JS:-


Press the button in the bookmarks bar and you get a search window. Script searches UK Google, with "UK only" option set.

Same idea for Aussies:-


Et pour les Francais, rechercher en Francais:-


And so on ... identify the URL needed to do a search at your national site, and for nationally sourced documents only by doing actually doing such a search. Copy the URL from the address bar and edit one of the above Javascripts for your local area. Note you need to insert '+x+' in the URL. Can't use in Bookmarks window.


[ Reply to This | # ]