Dave Aaron Smith
Dave Aaron Smith

Reputation: 4567

Debug which Javascript is causing a redirect

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.

Upvotes: 19

Views: 7144

Answers (2)

Daniel
Daniel

Reputation: 1799

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

Upvotes: 3

Alex Turpin
Alex Turpin

Reputation: 47776

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.

Upvotes: 2

Related Questions