I have a website that I write code for just to try out new things I learn about in web dev. I also want to get into Firefox extension creation, which I've already somewhat started with.
I know that extensions (in MV2, which Firefox still supports) can get a permission to intercept requests (and AFAIK modify them?).
Can I (and if yes, how) use that to make an extension that provides an offline copy of my website on the original URL (i.e. transparent to the user) in case I lose internet connectivity or my server goes down for whatever reason?
Basically, I want my extension to be able to detect requests to my site failing and generating a response to the same request from within the extension's cache, which to the website looks as if it came from the server.
I could, with hours of online research, not find anything even close to what I want, as the search engine tries to find extensions that already do this instead of showing code that allows me to do that myself.