Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make JavaScript break into IE built-in debugger (F12) rather than Visual Studio debugger?

I often use this to debug JavaScript in IE (fiddle):

if (confirm("Debug from here?"))
    debugger;

If I choose "yes", I see the prompt to start Visual Studio just-in-time debugger, which I proceed with to debug the script in Visual Studio.

Now I want to use IE built-in debugger instead of Visual Studio. I use this workaround:

if (confirm("Debug from here?"))
    throw "debug";

It works, but I have to check "Continue after exception" in IE built-in debugger every time I hit throw. Also, throw is different from debugger (which just continues execution if debugging is disabled in IE options).

Is there a way to make debugger keyword to break into into IE built-in debugger (F12) rather than Visual Studio debugger?

Setting breakpoints in IE F12 tools, then refreshing the page with F5 is not an option, because the page is a postback.

EDITED. Chrome browser actually gives me the desired behavior. To see what I mean, open Chrome, hit F12 to open Dev tools, then navigate to http://jsfiddle.net/jTwsh. Click [OK] upon confirm and you should get into debugger right on the debugger line.

like image 655
avo Avatar asked Oct 03 '22 16:10

avo


2 Answers

Suggest to disable the Just-In-Time debugger for Script; if you do not want to use it for.

See the below reference on how to enable/disable JIT Debugger:

Enable/Disable Just-In-Time Debugging

I am using IE8, there i need to start the script debugging by pressing 'Start Debugging' button or F5 under 'Script' tab in Developer Tools.

See the attached screenshot:

Developer Tools Screenshot

like image 131
Ahsan Shah Avatar answered Oct 23 '22 18:10

Ahsan Shah


Don't run the website in debug. It is possible to run website in 'normal' runtime:

Right-Click on any page => View in browser

or ctrl+f5

like image 1
Justin Lessard Avatar answered Oct 23 '22 16:10

Justin Lessard