Question

Did some homework on this. I saw one can set breakpoints using debugger in JavaScript source code. However, I am wondering if I could set a breakpoint in IE extension programmatically. Say, once IE discovers JavaScript source code on some callback function, I could set breakpoints via its PC or line#.

Was it helpful?

Solution

No, there's no JavaScript mechanism that allows you to set breakpoints programmatically other than the debugger statement. Your best option would be to express 'decision' and result in an if (something) { debugger; } style statement.

That said, the IE dev tools, like other browsers, allow you to set breakpoints conditionallyconditional break point dialog. All you need to do is to to right-click when you add the breakpoint and then select that it's conditional. In the condition you can enter anything that'll return a true result.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top