19

We have mountains of Javascript. Somewhere in there, a redirect is happening that we don't want. How can you generically debug which code caused a redirect? A stack trace would be perfect.

Dave Aaron Smith
  • 4,517
  • 32
  • 37
  • you can use a packet sniffer such as fiddler2 to detect the redirect, and then step through your code line by line while watching for the redirect. – jbabey Apr 18 '12 at 16:55

2 Answers2

3

Another person asked a similar question. Someone gave a helpful option in chrome debugging tools that you could try out. See link below.

Break javascript before an inline javascript redirect in Chrome

Community
  • 1
  • 1
Daniel
  • 1,789
  • 17
  • 15
2

There's no easy way. You could do a mass search in your files for some words like "redirect", "window.location", "location" and the like.

Alex Turpin
  • 46,743
  • 23
  • 113
  • 145