Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding root cause of redirect with Chrome Developer Tools

I am trying to debug a webpage with chrome developer tools and the page redirects to a pdf file after it loads. I checked JavaScript files and there is not any place that we redirect the page. I cannot find any related message in developer tool console or network tab.

I activated event Listener Breakpoints -> beforeunload but it stops at an external js file (Placeholders.js) which is not related to redirecting.

Also, preserving Logs in network tab does not help me on finding root cause of redirect.

I am wondering how can I find the source of this redirect?


UPDATE: There is not any "refresh" meta tag in the html code.

like image 978
Arashsoft Avatar asked May 10 '16 16:05

Arashsoft


People also ask

How do you tell what is causing a redirect?

Look at the developer tab in your browser of choice. It will show you the redirection together with it's reason.


1 Answers

There are a couple of things you can do. You can use the Event Listener Breakpoint -> Load - unload and then when it breaks in the 3rd party library, right click and select Blackbox Script. The next time you play through the code, it should only break in your own code (assuming there are no other 3rd party libraries to blackbox).

Another option is to go to the Network tab and check the Preserve Log checkbox. This will persist all requests between page loads/navigation, so that you will be able to find the network request that returned the PDF response.

Network tab

like image 115
Gideon Pyzer Avatar answered Sep 21 '22 01:09

Gideon Pyzer