Web page debugging redirected in browser

I am debugging a web application that redirects several times to page loading. Page Redirect to page B, which redirects to page C. I do not know what methodology is used (for example, JavaScript, HTTP redirect, etc.).

What I'm looking for is a debugger that needs to break before the page is redirected, so that I can accurately check which method is used to redirect and what data is sent to the next page in the redirect chain.

Is there an easy way to do this? I am debugging Windows, so Chrome, Firefox and IE are available.

UPDATE . Fiddler seems to be the best option. I marked @cgatian's answer as a solution, as his idea was Fiddler.

+7
javascript debugging browser
source share
3 answers

Good, so it seems like you want to look at the variables inside the browser before the redirection happens. One way I can think (without changing the source directly) is to use snippets of Google Chrome.

You can create your own fragment that binds to the onbeforeunload event.

Step-by-step instructions for creating a fragment

Fragment Code:

window.onbeforeunload = function(){ var debug; return; } 

Everything I do in the code above adds an event before the browser is redirected.

Visual of chrome

If you place a breakpoint inside your fragment, you can break and check the variables on the page. (Remember to right-click your snippet and select "Run") before debugging.

+5
source share

Chrome has Event Listener Breakpoints -> Sript -> Script First Statement :

Srcipt first breakpoint

Pressing the F8 button will stop at the first instruction of any script on the page, for example:

 <script type="text/javascript">document.location.href='http://www.example.com'</script> 

In addition, there is Event Listener Breakpoints -> Load -> beforeUnload , but it does not work in my case.

+11
source share

In chrome, in the debug window, at the very bottom, there is a series of buttons. Click the button, which is a dark black circle. It will save the log when navigating. I think this is what you want.

+3
source share

All Articles