如何检查移动 Safari 的窗口对象? [英] How can I inspect the window object for mobile safari?
问题描述
如何检查移动 safari 的窗口对象?
How can I inspect the window object for mobile safari?
或者更具体地说 window.navigator - 尝试转换为字符串不起作用,我也无法在控制台中探索它.
Or more specifically window.navigator - trying to convert to string doesn't work and I can't explore it within the console either.
谢谢!
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.
输出是 [object Navigator]
、"{}"
或什么都没有
Output is either [object Navigator]
, "{}"
, or nothing
推荐答案
我喜欢 jsconsole.com.
I like jsconsole.com.
此外,您可以使用 json2.js 库 (https://github.com/douglascrockford/JSON-js),它会给您 JSON.stringify() 函数.
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'});
这篇关于如何检查移动 Safari 的窗口对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!