Google results aren't recorded inSafari history.
November 16, 2011 3:57 PM   Subscribe

Is there a way to fix this infuriating Apple Safari/Google glitch? Perhaps someone who knows Javascript and/or Safari extensions could help me.

I'm using up-to-date Safari on up-to-date Snow Leopard.

If I do a Google Search, then command click on results to open them in new tabs, as one does, they are not recorded properly in Safari's history. Instead, a Google URL is recorded, and not the name of the page, as shown here. This is not helpful. If I open the search result in the same window, things work fine, but I want to be able to open multiple results in tabs. Switching off Javascript fixes things, but breaks almost everything else on the Internet, and so is not a solution.

Is there a known fix for this? I'm pretty sure I ran into the problem once before and cured it by switching off instant search, but that no longer works.

Failing that, the links on the Google results page look like this:
a href="" class=l onmousedown="return rwt(this,'','','','6','AFQjCNEEBzIME2Zyyud9G7EF6sAijxC_3w','','0CE8QFjAF')"
Is there something I could inject via a Safari extension that might override or poison the Javascript call here? I know how to make extensions that tweak CSS but know no Javascript. Or some other way to specifically kill this behaviour without breaking Gmail etc.?

(no I don't want to switch to Firefox or Chrome at this time)
posted by nowonmai to Computers & Internet (4 answers total)
Unfortunately, that's not a Safari-exclusive "feature". That's how Google's links work. It's the same in Firefox.
posted by Thorzdad at 4:52 PM on November 16, 2011

Best answer: This seems to work:
var links = document.getElementsByClassName('l');
for(l in links) if (links[l].onmousedown) links[l].removeAttribute("onmousedown");
How do you get it to automatically execute after a page of google search results loads? I don't know. If you run it in the safari javascript console, though, it fixes your problem.
posted by tylerkaraszewski at 4:57 PM on November 16, 2011

Response by poster: Thanks, Tyler, I slapped that into a Safari extension as an "End Script" enabled for and and it works a treat!

The extension is here if anyone else wants it. If there's any interest, I can update it to cover other countries.

I would think it should also be possible to get this to work with Greasemonkey if Firefox users have the same problem.
posted by nowonmai at 5:22 PM on November 16, 2011

Slick. Danke!
posted by Thorzdad at 5:24 PM on November 16, 2011

« Older Do hands-free headsets help reduce accident rates?   |   Snappy Brassy Girl Newer »
This thread is closed to new comments.