How do I debug Internet Explorer on Windows Phone 7?

ぐ巨炮叔叔 提交于 2019-11-27 21:09:14

You'll likely find the Mobile Perf Bookmarklet to be the easiest all-in-one tool for testing any mobile device.

Works well on the iPhone/iPad/Samsung Galaxy Tab in my testing so far.

Quote:

It displays a menu with links that load other bookmarklets including Firebug Lite, Page Resources, DOM Monster, SpriteMe, CSSess, and Zoompf.

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. 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.

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.

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.

EDIT: I just tested alert and it did work fine on my Windows Phone. My guess is that a syntax error is preventing it from calling.

The following may be interesting

Simple IE debug tool for Windows Phone

Supports

  • Html traversing
  • Html node styles, properties, metrics
  • Reading console output
  • Executing js on device side from console (including intellisense)
  • Dynamic script injection - ability to debug live sites

Not supported

  • js breakpoints

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:

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.

Something that has worked for me, is to test my mobile pages through the Windows Vista built-in Internet Explorer browser. 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.

Another tip would be, that, instead of using window.alerts, you can also use document.write or set output to a div content.

I'm using this hack to have console.log send info back to the server (it uses window.fetch, which I'm polyfilling, but could use xhr instead) https://gist.github.com/wheresrhys/bf93057ee3a594454582

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!