简体   繁体   English

如何在 Windows Phone 7 上调试 Internet Explorer?

[英]How do I debug Internet Explorer on Windows Phone 7?

I'm not a Windows Phone developer, and I want as little to do as possible with anything related to Microsoft.我不是 Windows Phone 开发人员,我希望尽可能少做与 Microsoft 相关的任何事情。 Nonetheless, I need to get my mobile web app running properly on Windows Phone 7. What debugging tools are available for the platform?尽管如此,我需要让我的移动 Web 应用程序在 Windows Phone 7 上正常运行。该平台有哪些调试工具可用? Something like the Webkit developer tools or Firebug would be ideal, either from the phone itself or more likely, remotely debugging from my computer. Webkit 开发人员工具或 Firebug 之类的东西是理想的,无论是从手机本身还是更有可能从我的计算机远程调试。

If such a thing doesn't exist, I'd settle for being able to read Javascript error messages, and view the contents of variables using alert() or similar.如果这样的东西不存在,我会满足于能够读取 Javascript 错误消息,并使用alert()或类似方法查看变量的内容。 At this point, all I know is that my JS is failing: I don't know where or why, let alone how to fix it.在这一点上,我只知道我的 JS 失败了:我不知道在哪里或为什么,更不用说如何修复它了。

My dev computer is running OS X, and I'd really like to be able to use these tools from OS X if possible.我的开发计算机运行的是 OS X,如果可能的话,我真的希望能够从 OS X 使用这些工具。 Assuming that debugging tools exist (which I really hope they do) are they designed for Windows only?假设存在调试工具(我真的希望他们这样做)它们是否仅适用于 Windows? If so, does anyone know how well they would work with Wine or similar?如果是这样,有没有人知道他们与Wine或类似产品的搭配效果如何?

EDIT : I have a physical Windows Phone 7 device, so I can use that.编辑:我有一个物理 Windows Phone 7 设备,所以我可以使用它。 However, alert() doesn't seem to be working, which is why I'm posting this question.但是, alert()似乎不起作用,这就是我发布此问题的原因。 Does alert() normally work on the WP7 browser? alert()在 WP7 浏览器上正常工作吗?

You'll likely find the Mobile Perf Bookmarklet to be the easiest all-in-one tool for testing any mobile device.您可能会发现Mobile Perf Bookmarklet是用于测试任何移动设备的最简单的多合一工具。

Works well on the iPhone/iPad/Samsung Galaxy Tab in my testing so far.到目前为止,在我的测试中,在 iPhone/iPad/Samsung Galaxy Tab 上运行良好。

Quote:引用:

It displays a menu with links that load other bookmarklets including Firebug Lite, Page Resources, DOM Monster, SpriteMe, CSSess, and Zoompf.它显示一个菜单,其中包含加载其他书签的链接,包括 Firebug Lite、Page Resources、DOM Monster、SpriteMe、CSSess 和 Zoompf。

在此处输入图片说明

The following may be interesting以下内容可能很有趣

Simple IE debug tool for Windows Phone适用于 Windows Phone 的简单 IE 调试工具

Supports支持

  • Html traversing html遍历
  • Html node styles, properties, metrics Html 节点样式、属性、指标
  • Reading console output读取控制台输出
  • Executing js on device side from console (including intellisense)从控制台在设备端执行 js(包括智能感知)
  • Dynamic script injection - ability to debug live sites动态脚本注入 - 调试实时站点的能力

Not supported不支持

  • js breakpoints js断点

Just wanted to add a note to say that full JavaScript debugging is possible now with Windows Phone 8.1 and Visual Studio 2013 Update 2. Full details are available at:只是想添加一个注释,说明现在可以使用 Windows Phone 8.1 和 Visual Studio 2013 Update 2 进行完整的 JavaScript 调试。完整详细信息可在以下位置获得:

http://blogs.msdn.com/b/visualstudioalm/archive/2014/04/04/diagnosing-mobile-website-issues-on-windows-phone-8-1-with-visual-studio.aspx http://blogs.msdn.com/b/visualstudioalm/archive/2014/04/04/diagnosing-mobile-website-issues-on-windows-phone-8-1-with-visual-studio.aspx

I realize that this doesn't help the versions referenced in the original question (WP7), but I'm hoping this will help people who may find this question and are running a more recent version.我意识到这对原始问题(WP7)中引用的版本没有帮助,但我希望这会帮助那些可能发现这个问题并正在运行更新版本的人。

Unless you have a Windows Phone 7 device, you will need to run Windows in BootCamp and install the Windows Phone Developer Tools in order to test in IE on the emulator.除非您有 Windows Phone 7 设备,否则您需要在 BootCamp 中运行 Windows 并安装Windows Phone Developer Tools ,以便在模拟器上的 IE 中进行测试。 I don't know about Whine, but I ran into major problems trying to test in Parallels - so based on my experience, I suggest keeping it as simple as possible.我不知道 Whine,但我在尝试在 Parallels 中进行测试时遇到了重大问题 - 所以根据我的经验,我建议尽可能保持简单。

There is no console in IE on the phone, so you will need to use alert, like you suggested, or just write text to a div on your page as a custom console.手机上的 IE 中没有控制台,因此您需要像您建议的那样使用警报,或者只是将文本写入页面上的 div 作为自定义控制台。

If you really want to code in OS X (which I definitely understand), using a separate machine for testing IE in the WP7 emulator is going to be your best bet.如果你真的想在 OS X 中编码(我绝对理解),使用单独的机器在 WP7 模拟器中测试 IE 将是你最好的选择。

EDIT: I just tested alert and it did work fine on my Windows Phone.编辑:我刚刚测试了警报,它在我的 Windows Phone 上运行良好。 My guess is that a syntax error is preventing it from calling.我的猜测是语法错误阻止它调用。

我正在使用这个 hack 让 console.log 将信息发送回服务器(它使用 window.fetch,我正在 polyfilling,但可以使用 xhr 代替) https://gist.github.com/wheresrhys/bf93057ee3a594454582

Something that has worked for me, is to test my mobile pages through the Windows Vista built-in Internet Explorer browser.对我有用的是通过 Windows Vista 内置的 Internet Explorer 浏览器测试我的移动页面。 It comes with a script debugger ( which you have to enable in Advanced Options tab through the Internet Options menu ), and it seems that it gets really close to the Internet Explorer Mobile implementation.它带有一个脚本调试器(您必须通过 Internet 选项菜单在高级选项选项卡中启用它),而且它似乎非常接近 Internet Explorer Mobile 的实现。

Another tip would be, that, instead of using window.alerts, you can also use document.write or set output to a div content.另一个提示是,除了使用 window.alerts,您还可以使用 document.write 或将输出设置为 div 内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何区分Internet Explorer 10 / Windows Phone 8中的单击和触摸事件 - How to distinguish click and touch events in Internet Explorer 10 / Windows Phone 8 添加特定于Windows Phone Internet Explorer的代码 - Adding code specific to Windows Phone Internet Explorer Internet Explorer + Windows Phone IEMobile条件注释 - Internet Explorer + Windows Phone IEMobile Conditional Comments 如何在Internet Explorer 8中获取innerWidth - How Do I Get innerWidth in Internet explorer 8 如何在Windows 7上进行Internet Explorer 7测试和javascript调试? - How to do Internet Explorer 7 testing and javascript debugging on windows 7? 如何在Internet Explorer中调试菜单中的“摇摆” - How to debug a “Wiggle” in a menu in Internet Explorer 如何在Windows Phone 8 OS的诺基亚Lumina 92​​5中的Internet Explorer中禁用Java脚本? - How to disable java script in internet explorer in nokia lumia 925 in windows phone 8 os? Windows Phone Internet Explorer Mobile 7浏览器是否支持触摸事件? - Does the Windows Phone Internet Explorer Mobile 7 browser support touch events? 如何更改“睡眠”功能以在Internet Explorer中工作? - How do I change the “sleep” function to work in Internet Explorer? 如何在Internet Explorer中禁用复选框 - How do I keep a Checkbox disabled in Internet Explorer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM