Here is the situation. A popup window contains the javascript I need to debug. It also contains a re-direct that happens so fast I can't open the Inspector fast enough to have the breakpoints fire. I start with the Inspector open and click a link which closes the Inspector and opens the popup window which contains the javascript. But the logic happens and the re-direct fires so fast I can't open the Inspector before Chrome is already off the popup with the script I need to debug.
I've read the Google documentation and setting breakpoints works great but the breakpoints only fire if the Inspector is open.
I tried using debugger;
which I found from this SA answer but once again, it only fires if the Inspector is open.
Just to debug it, I also tried setting a "sleep" function (which chews up processor, is bad etc) like this:
function sleep(milliSeconds){
var startTime = new Date().getTime(); // get the current time
while (new Date().getTime() < startTime + milliSeconds); // hog cpu
}
sleep(5000);
That didn't work either.
Is there a way to get the Inspector to pop open via code? If not, what is the best way to debug this? Thanks.