Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Safari 1.3 breaks some bookmarklets?

Safari 1.3 breaks some bookmarklets?
Thread Tools
Fresh-Faced Recruit
Join Date: Sep 2004
Location: New York City
Status: Offline
Reply With Quote
Apr 25, 2005, 12:47 PM
 
A handy javascript bookmarklet that worked great under Safari 1.2 no longer works under 1.3. I've done the security and java updates, and Safari handles most java pages with no problem, and is snappier than ever. However, this bookmarklet no longer gives a prompt when a word is not highlighted (it works fine when a word is highlighted):

javascript:Qr=window.getSelection();if(!Qr){void(Q r=prompt('Enter%20word%20to%20find%20in%20Wikipedi a%20Dictionary:',''))}if(Qr)location.href='http://en.wikipedia.org/wiki/Special:Search?search='+escape(Qr)+'&go=Go'

Any ideas?
     
Fresh-Faced Recruit
Join Date: Sep 2004
Location: New York City
Status: Offline
Reply With Quote
Apr 26, 2005, 05:37 PM
 
Many thanks to Dori Smith who tracked this down as a known bug, reported by the Sci-Fi Hi-Fi Blog, which says "This problem is caused by an unfortunate regression in both Safari 1.3 and Safari 2.0 [and also apparently FireFox 1.0.3 -ed.]: the Javascript “getSelection()” call no longer works properly when invoked through Safari’s “do javascript” AppleScript command."

A workaround is given at JoeMaller.com

This revised version should work, try it in your bookmarks bar:

javascript:Qr=window.getSelection()+'';if(Qr==''){ void(Qr=prompt('Enter%20word%20to%20find%20in%20Wi kipedia%20Dictionary:',''))};if(Qr)location.href=' http://en.wikipedia.org/wiki/Special:Search?search='+escape(Qr)+'&go=Go'
(Last edited by windsurfer_nyc; Apr 26, 2005 at 05:51 PM. )
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:32 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2