Reputation: 2531
I have a link that opens in a new tab, in the new tab's header it has javascript like this which redirects it to a different page:
window.location.href = "{a different URL}";
I need to debug the new tab before it redirects in an incognito window. What can I do in chrome to stop the new tab from redirecting so that I can debug it? I can't take the redirect out because I need to debug it in a live environment to replicate an issue.
Upvotes: 2
Views: 2671
Reputation: 5671
You can set a breakpoint for beforeunload
in the source panel of the Chrome debugger:
This will fire when window.location
changes
Upvotes: 2