1

I'm trying to debug an issue on complex javascript page in Chrome, where ultimately clicking on a link ends up redirecting to another page.

I'd like to find out where the code is that's actually doing the redirect, but can't seem to spot it.

I can see in the Network tab of DevTools that the Initiator was a certain bit of javascript, but when I click on that link and view the javascript, I don't see any window.location... references of any sort, and have tried debugging through the code, but can't find it.

Is there an easy way to detect when window.location is being used to redirect the page, even if it's being used in some wrapper library?

EDIT: Note - I've tried setting a breakpoint for the window.unload event, as detailed here, but no luck.

Brad Parks
  • 66,836
  • 64
  • 257
  • 336
  • try listening to click handler via dev tools and see which code executes when – Danyal Imran Mar 08 '19 at 12:06
  • Possible duplicate of https://stackoverflow.com/questions/12360187/break-javascript-before-an-inline-javascript-redirect-in-chrome – 04FS Mar 08 '19 at 12:08

1 Answers1

2

This might help you, I have had this issue before:

  1. Open Developer Tools
  2. Go to Sources tab
  3. Look for Event Listener Breakpoints
  4. Expand Load option
  5. Here check unload option

Hope it helps! :)