A workaround for Safari and Google maps (and an idea of what’s causing the problem)
Mac OS X Add commentsAlong with OS X 10.3.9, Apple updated Safari to version 1.3. Many people have noticed that Google maps now has a problem where text in location bubbles and on the right side of the page is rendered incorrectly. There’s an easy workaround available to fix the problem, and I have a hypothesis as to what caused it.
[UPDATE: 4/21/05]
As of today, I was able to visit Google Maps without resetting the user agent and the page rendered correctly. Looks like a change of some kind was made on Google’s end.
First, the workaround:
1. Quit Safari.
2. Open the Terminal and type (or copy and paste) this line: defaults write com.apple.Safari IncludeDebugMenu 1
3. Restart Safari. There is now a Debug menu item in the menu bar.
4. Click Debug and scroll down to User Agent. Select Windows MSIE 6.0.
5. Load Google maps.
For those who are curious, the command in the Terminal writes a value called IncludeDebugMenu to a file named com.apple.Safari.plist and sets the value to true (1).
I’d like to also note that it’s probably a good idea to set your user agent back to Automatically Chosen when leaving Google maps.
And now for my hypothesis, which is pure speculation for which I have no facts. Safari’s javascript support has always been kinda ho-hum. When Google maps first appeared, the Google developers made it known that some modifications had to be made in order for maps to work with Safari. I’m guessing the Google maps page checks the browser’s user agent string, and if the browser identifies itself as Safari, a modified version of the javascript is loaded. With Safari 1.3, the Safari developers corrected whatever problem Google had coded around perviously, and now Safari 1.3 loads the modified javascript, which is rendered incorrectly. Setting the user agent in your browser to Windows MSIE 6.0 causes the unmodified javascript to be loaded, and Safari handles it correctly.
It’s kinda blah that Safari’s javascript capabilities had to be coded around to begin with, but it’s a good thing that Safari’s developers are actively updating the browser and making it more standards compliant with every release, unlike the developers (are there any?) of another browser who have let it sit stagnant for years, much to the detriment of web developers everywhere.
My guess is that Google will update their maps site to be a little more discerning about the user agent string, parsing it not only for a user agent type of Safari, but the associated version as well.

My .Mac Web Gallery
April 18th, 2005 at 4:56 pm
Awesome!
enabling this debug menu (and setting the useragent to IE 6.0) will probably be extremely useful for debugging web pages (i’m a web designer).
since we are stuck (persumably forever) with IE 5.X on the Mac, it is becoming more difficult all the time to debug our code for IE 6.X, which is the Windows standard now.
by using this debug menu, at least we can get a rough idea of the resulting layout immediately, before testing on a real PC.
i already tested a CSS problem that i had last week using this Safari Debug menu, and it works: my buggy page (which rendered fine in all Mac browsers) now shows its Windows-centric rendering bug in Safari, and my debugged page (which was achieved painfully, since i have no PC handy) renders correctly, thus proving that the useragent IE6 trick can help debug Windows-centric javascript AND CSS problems.
very cool. thanks!