How can I debug calls to window.open?

Viewed 349

I have some React app here that has a malfunction that causes the page to open a new tab with itself. Recursive. and that is rather annoying as the number of tabs runs quickly into an out of memory situation. I want to debug the code to see the stack when the window.open call happens. I do not know where in the application the call happens and so wonder if there is a way to trigger Chrome to jump into script debug mode when something wants to open a window/tab?

1 Answers

So you can use the debugger of chrome, and then add some breakpoint to exactly decide when the code should stop, and then you use the control to jump to the next execution and decide when to go a step back and forth.

it's available for free, all you need to do is to inspect your React app and then visit the Sources tab, there you will see the code in javascript and you can start adding breakpoint and so.

You can also add mouse event listener , like click , dbclick... You can also trigger and debug how a specific function si running.

enter image description here

Related