简体   繁体   中英

In Visual Studio 2015 is there a way to debug Javascript using a browser other than Internet Explorer?

The question is almost all in the title: Today I was trying the new functionalities of VS2015. I focused on debugging Javascript direclty from VS and I started to put some breakpoints in my angular code.

If I start debugging with Firefox (the same happen with Chrome) they become empty circles and if I move the mouse on the message is that the symbols are not loaded. The only way I found debugging to work is using Internet Explorer.

Is there a way to bind Firefox (or Chrome) process to allow debugging?

I'm not sure if VS 2015 still has the browser link technology, but in theory that should allow you to debug for other browsers. See Using Browser Link in Visual Studio 2013 for some hopefully helpful tips.

I know you can do it in Chrome so it should be possible in other browsers as well if they support remote debugging. Here is how you do it in Chrome. 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.

在此处输入图片说明

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

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

在此处输入图片说明

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

在此处输入图片说明

Yes, you can debug js code using some browser specific addons . FOr chrome, you can take an eye at https://developer.chrome.com/devtools/docs/javascript-debugging

您可以在Visual Studio 2015中尝试一个Apache Cordova项目,并且应该按照https://youtu.be/Fr9qRNzBYZc进行chrome调试

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM