Javascript iPad Safari 开发工具栏
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5734323/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iPad Safari Development toolbar
提问by testndtv
Is there some kind of developer toolbar that can be used within the iPad/Safari?
是否有某种可以在 iPad/Safari 中使用的开发人员工具栏?
I am aware of the same on desktop Safari as well as I know there is a Debugger option in iPad/Safari but is there a quick way of editing CSS/JS within the iPad/Safari?
我知道在桌面 Safari 上也是如此,我知道 iPad/Safari 中有一个调试器选项,但是否有一种在 iPad/Safari 中编辑 CSS/JS 的快速方法?
回答by honk31
On the ipad go to *Settings > Safari > Advanced * and activate the Web Inspector.
在 iPad 上转到 *Settings > Safari > Advanced * 并激活 Web Inspector。
Connect your ipad with your computer.
将 iPad 与计算机连接。
On your computer open Safari, enable the developer tools in the settings. check the above menu for the tab Developerand find your iPadthere.
在您的计算机上打开Safari,在设置中启用开发人员工具。检查上面的“开发人员”选项卡菜单,然后在那里找到您的iPad。
Full control via console from your desktop machine over the iOS Safariand you're done!
从您的台式机通过控制台通过iOS Safari 进行完全控制,您就大功告成了!
PS: This works exact the same way with the iPhoneas well..
PS:这与iPhone 的工作方式完全相同..
回答by Winfield Trail
There is no developer toolbar for Safari iPad, but you could definitely use something like firebug liteto do most of what you want! Just add the bookmarklet to your bookmarks, and then load it while you're looking at your page.
Safari iPad 没有开发人员工具栏,但您绝对可以使用firebug lite 之类的工具来完成大部分您想做的事情!只需将书签添加到您的书签中,然后在您查看页面时加载它。
Your other option is Weinre, a remote debugger and part of the PhoneGap project. Essentially, it lets you run an interface similar to the Chrome document inspector on your desktop machine, that manipulates the document on your iPad or iPhone. The commenter below brought my attention to this awesome tool a year ago, but since then the project's URL has changed so I'm adding it here.
您的另一个选择是Weinre,它是一个远程调试器,是 PhoneGap 项目的一部分。从本质上讲,它可以让您在台式机上运行类似于 Chrome 文档检查器的界面,该界面可以操作 iPad 或 iPhone 上的文档。一年前,下面的评论者让我注意到了这个很棒的工具,但从那时起,该项目的 URL 发生了变化,因此我将其添加到此处。
FirebugLite does have some issues with rendering speed and dealing with JavaScript, and it additionally doesn't scale its fonts very well. For these reasons, Weinre is definitely a more powerful tool - but also harder to start using.
FirebugLite 在渲染速度和处理 JavaScript 方面确实存在一些问题,而且它也不能很好地缩放字体。由于这些原因,Weinre 绝对是一个更强大的工具——但也更难开始使用。
回答by James
You can use this little trick to enable Firebug Lite or any other debugging tool built into a bookmarklet, works quite well actually!
您可以使用这个小技巧来启用 Firebug Lite 或书签中内置的任何其他调试工具,实际上效果很好!
http://www.blog.cordslatton.com/2010/11/debugging-ios-mobile-safari-ipad-iphone/
http://www.blog.cordslatton.com/2010/11/debugging-ios-mobile-safari-ipad-iphone/
回答by jrullmann
Safari iPad doesn't have a development tool, but it does have a debug toolbar. It's features include:
Safari iPad 没有开发工具,但它有一个调试工具栏。它的特点包括:
- Viewing messages sent to the console
- Viewing JavaScript errors
- Viewing CSS errors
- 查看发送到控制台的消息
- 查看 JavaScript 错误
- 查看 CSS 错误
So it's not great for development, but it's a lot better than nothing. Here's how to enable it:
所以它对开发来说不是很好,但总比没有好。以下是启用它的方法:
- Open settings
- Safari
- Advanced
- Enable debug console
- 打开设置
- 苹果浏览器
- 先进的
- 启用调试控制台
You should then see a banner at the top of web pages with messages from the debug console.
然后,您应该会在网页顶部看到带有来自调试控制台的消息的横幅。
回答by Laurenz
There is a set of developer tools in Safari. Go to Settings > Advanced and take a good look :)
Safari 中有一组开发人员工具。转到“设置”>“高级”并好好看看:)