Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable the javascript debugger in the Page Inspector

Visual Studio 2012 comes with the very nice Page Inspector. I like it! Problem though, I haven't found how (if?) I can turn on JavaScript debugging. Could someone point me in the right direction?

like image 871
Martijn Avatar asked Aug 30 '12 12:08

Martijn


People also ask

How do I enable JavaScript debugging in Chrome?

Press the F12 function key in the Chrome browser to launch the JavaScript debugger and then click "Scripts". Choose the JavaScript file on top and place the breakpoint to the debugger for the JavaScript code.

How do I debug JavaScript in HTML?

Start debugging Open the HTML file that references the JavaScript to debug or select the HTML file in the Project tool window. From the context menu of the editor or the selection, choose Debug <HTML_file_name>.


1 Answers

  1. In IE9 (only one time): Tools > Internet Options > Advanced tab > In Browsing category > Clear "Disable script debugging" check boxes (both) > restart IE.

  2. In VS 2012: Run the Page Inspector ( when javascript error box opens, click No ! )

  3. Choose from VS menu: DEBUG > Attach to process...

  4. Select "WebBrowserServer.exe" and click Attach

  5. In Page Inspector window click the Refresh icon.

Debugging works pretty well, but it's one condition. Don't insert any breakpoints in your code (or clear them before - DEBUG > Delete All Breakpoints). There can cause a lot of problems - from hanging and frozing to entirely crashing your VS.

like image 85
Mariusz Avatar answered Sep 18 '22 16:09

Mariusz