17

I am looking for something like Debugger.Launch() in .NET, which breaks into the debugger programmatically.

I am not looking for a cross browser way to do it, just Google Chrome is good enough.

2
  • Possible duplicate of : stackoverflow.com/questions/66420/… Commented Feb 27, 2012 at 9:41
  • 2
    It is similar, but I am looking for a programmatic way, so that the browser stops there automatically without any actions from me. The answer to that question talks about an interactive way, although there is a response which answers my question exactly. Commented Feb 27, 2012 at 10:29

1 Answer 1

24

Yes, you need to use:

debugger;

The script will break exactly at line where you put debugger keyword.

To view it, you will first need to open Tools -> Developer tools (or pressing F12) and then by selecting your file from Scripts tab.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.