Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use VS2012 JavaScript debugging with Chrome (similar to IE)

With VS2012 and IE9 I can use the VS2012 JavaScript debugger from within VS2012 (similar to C#, ..). When I switch the browser to Chrome, I loose the ability to do so. I could switch to the the Chrome intrinsic debugger.

Chrome as browser

But, is there a way to get debugging with Chrome working with VS2012 (similat to IE)?

Example: Breakpoint hit with IE, but not with Chrome as browser.

Breakpoint

Remark: No duplicate of Debugging Websites with Google Chrome which is about .net debugging. I am not using any ASP.net, only JavaScript

like image 929
Horst Walter Avatar asked Jan 02 '13 11:01

Horst Walter


People also ask

How do I debug Cshtml in Chrome?

Tips for debugging in the web browser You can debug in the browser by pressing F12 to open the Developer Tools. Unchecking the option allows to debug in JavaScript rather than C#.

How do I debug JavaScript in Visual Studio code and Chrome?

Pressing F5 (Start Debugging) Activating the debug icon in the menu bar and selecting "Run and debug" Opening the Visual Studio Code command palette and running the "Debug: Open Link command"

How do I debug JavaScript in ASPX in Chrome?

Setting and Debug In Google ChromeGo to "Tools" then click on "JavaScript console". Run the application and insert values into the input fields then click on the "Addition" button. The cursor will then reach the debugger in the source tab under the JavaScript console window.


2 Answers

No it's absolutely impossible to debug JS in Chrome from VS, because it's a completely different internal engine. May be somebody will write a plugin for VS, but right now it's not possible.

like image 66
Rachel Henderson Avatar answered Oct 14 '22 09:10

Rachel Henderson


inside a javascript place a "debugger;" command and refresh the page.

works in CHROME v30> and IE 10>

Example:

<script type='text/javascript'>
        function LoginEstabelecimento() {

            var form = $('form#formLoginEstabelecimento');

            debugger;

           ... SOME REST OF CODE ...

        };
</script>
like image 38
EBENEZER CURVELLO Avatar answered Oct 14 '22 07:10

EBENEZER CURVELLO