Retry Failed Requests

Hellooo,

I would like to retry failed requests (status 5XX for example) in the very low network level until the response is 2XX.

I’m open to use/write an extension or even touch source of Firefox.

In case of extension, I’m not sure if it is possible or not, if so, it would be helpful if you can lead me to the documentation of it?

In case of Firefox’s source code, I’m sure it’s possible, but anyway I cannot spot the place I need to touch. I appreciate your help to find the place I must change?

I’m also open to do so in Chrome(ium).

Best,
Omid

You might be able to do it from an extension, checking the statusCode in one of the webRequest listeners, such as onResponseStarted: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onResponseStarted#statuscode

Thanks @zombie

I think finding the status is fine, retrying the request is the trickiest part for me. Do you know any way of retrying/resending the request?