codemancers / interceptor

A browser extension to mock AJAX requests at the browser level
MIT License
208 stars 25 forks source link

Responses are not intercepted on page reload #161

Open churixho opened 6 years ago

churixho commented 6 years ago

My SPA site is built using ReactJS + Redux + react router. Let's say we have page A whichs load a.json and page B which loads b.json

Case 1: Go to page A; intercept a.json; then refresh the page Results: a.json is not intercepted

Case 2: Go to page A; intercept b.json; then go to page B Results: b.json is intercepted successfully

Expected behaviour: Response could be intercepted upon page refresh

revathskumar commented 6 years ago

@churixho Chrome/Firefox?

churixho commented 6 years ago

Problem occured in both Firefox and Chrome

churixho commented 6 years ago

It appears to me that the this is due to race condition. When I delay the axios in my site (i.e. the loading of a.json in the example) for 2 seconds, the result could be interruped.

amitmbee commented 6 years ago

@churixho Yes, the issue here is that the the web page gets the data from axios before Interceptor can inject a script. We are working towards a fix for this.

therisingindian commented 5 years ago

I'm also waiting for the capability to intercept response on page reload.

quinncomendant commented 5 years ago

I'm using Interceptor to debug an angular page, and need to intercept XHR requests run during page load. I too notice that Interceptor can't intercept this when reload the page.