admin管理员组文章数量:1415421
I am using camera with getUserMedia and I get a few errors I want to fix. The thing is Visual Studio only allows me to debug JavaScript (I mean hitting breakpoints) with IE, and IE does not support getUserMedia.
I am using camera with getUserMedia and I get a few errors I want to fix. The thing is Visual Studio only allows me to debug JavaScript (I mean hitting breakpoints) with IE, and IE does not support getUserMedia.
Share Improve this question edited Dec 9, 2014 at 13:02 pwdst 13.8k4 gold badges37 silver badges51 bronze badges asked Dec 9, 2014 at 10:26 Arthur ReyArthur Rey 3,0443 gold badges24 silver badges49 bronze badges 5-
Set a
debugger;
on those places where you want Chrome/Firefox to stop. – Andrei V Commented Dec 9, 2014 at 10:35 - I tried this, but I can't hit any breakpoint to check its value. – Arthur Rey Commented Dec 9, 2014 at 10:44
- 1 You need to open the Development Console and inspect it in the browser, not in Visual Studio – Andrei V Commented Dec 9, 2014 at 10:57
- Is it really the only way? – Arthur Rey Commented Dec 9, 2014 at 10:59
- I, personally, can't think of another. – Andrei V Commented Dec 9, 2014 at 11:09
1 Answer
Reset to default 7If you want to debug in a browser other than Internet Explorer then you will need to use the Developer Tools of that individual browser and set your breakpoints accordingly. Alternatively you could use console.log() and/or console.warn() to get the state of your objects in code. Visual Studio does not and cannot understand the implementations of different JavaScript and rendering engines (V8, Blink, Gecko etc.) - nor should it ever attempt to do so. These engines move so rapidly with six week release cycles the IDE would be a totally misleading proxy for the actual the platform you're supposed to be testing against.
Both Firefox and Chrome allow you to retain console contents beyond a page reload/navigation and there are tools like Browser Link in Visual Studio will allow you to test in multiple browsers simultaneously - inspecting the console results afterwards for errors (interactions will have to be tested individually in each browser).
If you are testing mobile devices Adobe Shadow that would potentially allow you to test on multiple tablets and/or phone simultaneously whilst using Dev Tools (I believe Chrome) on your laptop or desktop. Otherwise desktop browsers dev tools allow you to debug page running on a connected mobile device using the same browser, or - in the case of Firefox - also Chrome instances on the device.
It is well worth getting to know browser dev tools for front end debugging and troubleshooting, as these are much more powerful for this purpose than those provided with Visual Studio. The free CodeSchool course Discover DevTools (focussed on the Chrome DevTools and sponsored by Google/Chrome) may help you discover some of the features of client developer tooling, and many of the interfaces and techniques will be broadly applicable to other browser dev tools.
If you want to test on devices that are not available to you, browsers that you cannot install on your system (e.g. Safari on Windows) or simply a newer or legacy version which you cannot install alongside the one already installed locally then there are services like Browserstack which allow you to do so in hosted virtual machines. There is a Visual Studio extension available for BrowserStack to help connect to projects running locally.
本文标签: javascriptUse ChromeFirefox while debugging clientsideStack Overflow
版权声明:本文标题:javascript - Use ChromeFirefox while debugging client-side - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745199413a2647299.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论