在Chrome或Firefox上使用Visual Studio 2015调试Java脚本 [英] Debug Java Script with Visual Studio 2015 on Chrome or Firefox

查看:173
本文介绍了在Chrome或Firefox上使用Visual Studio 2015调试Java脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以用IE调试没有任何问题,但是当我尝试不同的浏览器代码不是停止断点。我有一个目前与IE不兼容的项目。我使用OpenJSCAD作为我的项目中的依赖项,因此我需要在Chrome或Firefox上调试。

I can debug with IE without any problem, but when I try different browsers code is not stopping on breakpoints. I hava a project that is currently not compatible with IE. I'm using OpenJSCAD as a dependency in my project, therefore I need to debug on Chrome or Firefox.

是否可以使用Visual Studio 2015在Chrome上调试Java Script或者Firefox?

Is it possible to debug Java Script with Visual Studio 2015 on Chrome or Firefox?

推荐答案

你可以做到这一点,但是有点棘手。在工具栏中,单击按钮获取要调试的浏览器的下拉列表,然后单击浏览...。单击添加...,将程序设置到Chrome的机器上的任何位置,并将参数设置为 - remote-debugging-port = 9222 。您也可以设置隐身模式,因为我必须忽略缓存,但不是必需的。

You can absolutely do it, however it is a bit tricky to do. In the toolbar, click the button to get the dropdown of browsers to debug with and then click "Browse with...". Click "Add...", set Program to wherever Chrome is on your machine and set Arguments to --remote-debugging-port=9222. You can also set Incognito as I have to ignore cache but it is not required.


重要! Chrome无法启动,Chrome需要从Visual Studio开始,否则调试将无法正常工作。

Important! Chrome cannot be started before, Chrome needs to start fresh from Visual Studio otherwise debugging won't work.

此后转到调试 - >附加到进程... - >选择具有项目标题或类似的chrome实例,然后单击附加。

After this goto "Debug" -> "Attach to Process..." -> select the chrome instance with the title of your project or similar and then click Attach.

如果一切正常,您现在可以在Visual Studio中调试JavaScript,并使用所有Chrome功能。

If everything works you can now Debug your Javascript in Visual Studio and use all Chrome features as well.


请注意当你附加到这个过程,你不能停止
调试而不终止chrome.exe。但是你可以通过点击Debug - >Detach all来获取

Note that when you have attached to the process you can't just stop debugging without terminating chrome.exe. However you can get around this by clicking "Debug" -> "Detach all".

这篇关于在Chrome或Firefox上使用Visual Studio 2015调试Java脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆