问题
Whenever I try to connect the safari web inspector to a simulator or device running mobile safari in the foreground, the site that I try to inspect never fully loads in the inspector. The DOM never fills out in the dom tree view; i have to collapse and expand the webpage in the resource view to be able to see scripts, images, frames and the like but none of the items that should show a DOM actually do. Touch mode to select a specific dom element by tapping on it on the iphone/ipad doesn't work either as a result of this.
I've correctly set the relevant ios settings and mac safari settings so that safari on mac can see each device and connect to specific websites/webviews properly but the connection seems to fail somehow.
I've had only moderate luck in getting it to work by clearing cookies and cache via the ios settings for safari, but even then it only successfully connects and shows me a dom part of the time. Has anyone else run into this? What could be going wrong? Is there a way to fix it? Is it possible to use a different web inspector to debug sites on iOS (like the webkit nightly one) and if so, how?
This happens on both my 10.7 and 10.8 machines and on various different ipads. It might be an issue with our site specifically but I don't know how to narrow down what exactly.
回答1:
I still have this issue but what has solved it for me is when I run Safari in Private Mode. Dunno why, might be chaching-related. Not a nice solution but will do as long as the problem persist.
These are the versions: - iOS Simulator Version 7.0 (463.9.4) - Safari Version 6.0.5 (8536.30.1)
回答2:
I've got the same problem tried with a light version of my page with less data (images, script, css)to load and it worked, so it seems to be linked to size of page :(
回答3:
You need cookies to be enabled in your Safari
回答4:
I have run into this. The only way i get the simulator to come up in web inspector is if i have a physical device attached. Then i see them both in the list to choose from.
回答5:
I tried private mode, which gave me a slight improvement but Björn Christensson answer above is what worked for me.
Download WebKit Nightly Build (http://nightly.webkit.org/)
This allows me to view CSS and also tap to inspect nodes on the iPad. These 2 things did not work with the use private answer above.
来源:https://stackoverflow.com/questions/15888982/how-do-i-fix-the-safari-6-web-inspector-so-that-it-works-with-ios-devices-or-sim