Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Javascript bugs in Safari 6 on Mountain Lion

Since I've upgraded to Safari 6 on Mountain Lion I'm having several problems that seem to be javascript-related. On many sites, for no apparent reason, interface elements will stop receiving click events. For example, checkboxes and buttons don't respond when clicked. Links don't respond if they have a "click" handler but they will work if they are plain links with an href. If I try to reload the page it stalls, as if the server is not responding. I have to relaunch safari in order for the site to load and it will inevitably happen again... just not sure when.


Other points:


1. I've seen this problem on several different sites across many domains, it's not limited to a particular site.


2. There are no javascript errors (that I can attribute to this problem) and javascript is enabled (of course).


3. For all the sites that I've experienced this problem I've loaded the same site in chrome with no problems.


4. Safari was my default browser before the upgrade and I've never experienced this problem before.


5. The only extension I have is 1Password. I tried disabling it but it hasn't improved the problem.


I'm hoping that someone else is esperiencing this problem and either has a fix or can help me get Apple's attention so they will issue a fix.


Thanks!

MacBook Pro (Retina, Mid 2012), OS X Mountain Lion, Safari 6

Posted on Jul 27, 2012 8:39 AM

Reply
135 replies

Aug 3, 2012 11:26 PM in response to chrisbrantley

I am afraid it appears the latest Safari update hosed the application's cache handling. In my case, the problem manifests itself as a caching issue. No matter what steps I take to clear the Safari cache, it doesn't clear. Even after disabling cache in >Develop>"Disable Caches" and "Empty Caches", then reseting Safari, when examining the ~[Users]/Library/Caches/com.apple.Safari/Cache.db is still there and as large as it would seem approriate for several days (78.5MB). Of course, deleting the file manually works.


I discovered this while working on a website for a client... everything was fine until a recent Safari update. I modify a file, refresh the page, bang! Everything is good. But then a day or two ago, I noticed no matter what I did to the files (cascading style sheets seem to be worse than xhtml), CMD R didn't refresh my code?! Then, CMD Q and reopening Safari didn't work. So I enabled Private Browsing, disabled caching, emptied caches, did a full reset in Safari, and then restarted the MBP... no joy!


Using the inspector tools to review "resources" revealed the *.css file content didn't update when the page was reset. In other words, Safari continued to use the cached version regardless of the number of changes I made to it. The xhtml seems to update in real time, but external code files do not.


I can see how this might screw up javascript if a website updates portions of scripts in external *.js files. If the page makes a JS call from xhtml to a function in a cached file, you're screwed if changes were made to the script.


WORKAROUND: Using >Develop>User Agent>[pick any] refreshes the page and grabs the latest content frmo the site (in most cases). It isn't perfect, but at least I can see my updates in a timely fashion to get paid by my client.


Sorry about the novel, but I wanted to be as thorough as possible in hopes some Apple code guru sees this and acts on it.

Aug 5, 2012 7:09 AM in response to chrisbrantley

I've been able work around this issue by:


  1. Safari > Preferences > Advanced > Show Develop menu in menu bar
  2. Develop > Show Web Inspector (incidentally this will verify the problems you've all noted)
  3. Minimize the Web Inspector and let it run like a ghost in the dock


I have no idea why this works for me, but it does.


In the meantime, don't try to "fix" anything that wasn't broken in Lion. If it worked before, it's clearly an issue with Mountain Lion, so file a bug report and wait for Apple to release an update.


Hope that helps!

Javascript bugs in Safari 6 on Mountain Lion

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.