Matteo Defanti
Matteo Defanti

Reputation: 212

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?

Upvotes: 8

Views: 13242

Answers (4)

Ogglas
Ogglas

Reputation: 69928

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.

enter image description here

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.

enter image description here

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

enter image description here

Upvotes: 2

toddmo
toddmo

Reputation: 22396

You can try an apache Cordova project in visual studio 2015 and it should have chrome debugging as per https://youtu.be/Fr9qRNzBYZc

Upvotes: -1

Jacob
Jacob

Reputation: 78850

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.

Upvotes: 2

George Lica
George Lica

Reputation: 1816

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

Upvotes: -1

Related Questions