How can I inspect the window object for mobile safari?
Or more specifically window.navigator - trying to convert to string doesn't work and I can't explore it within the console either.
Thanks!
EDIT:
console.log(window.navigator);
console.log(String(window.navigator));
console.log(JSON.stringify(window.navigator));
console.log(window.navigator.serialize());
Also tried sending all these variations over the socket to the server and logging them there.
Output is either [object Navigator]
, "{}"
, or nothing
The steps to do so are as follows: Open Safari browser. Click on Safari > Preferences > Advanced. Tick the checkbox Show Develop menu in the menu bar.
With Safari open, select the Develop menu in the menu bar. Toward the top of that list, you should see your device's name and the windows that are available to inspect. Select the page or application to inspect, and the inspection window will open.
Update!!! On OS X you can use the Safari web inspector on the iOS Simulator AND iOS 6 devices.
Next, enable remote debugging on your iOS device (or simulator).
Settings > Safari > Advanced > Web Inspector (ON)
Note: You'll see your device in the Developer menu ONLY when Safari is active and running.
Enjoy!
I like jsconsole.com.
Also, you can use the json2.js library (https://github.com/douglascrockford/JSON-js), which will give you JSON.stringify() function.
console.log(JSON.stringify({a:'a',b:'b'});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With