// Watch for `main.mjs` failing to load and re-injects it with jittered // exponential backoff. // // Without this any failures loading `main.mjs` leaves the challenge page // sitting on the "Loading..." message forever with no error messaging // outside of the browser console, which is unavailable on mobile browsers. // // This is the worst way for Anubis to fail because it requires the user // to manually reload the webpage, which fails the main design goal of // the proof of work challenges: no user interaction is required to pass // challenges. Paradoxically, this would increase the level of load to // an already overwhelmed server, making the problem much worse. // // This is injected into the page as a raw constant embedded from this // file instead of loaded dynamically so that things are more reliable. // // A few notes on the implementation of this and why it makes some weird // assumptions about the browser environment: // // - Loading a module script uses a slightly different internal fetch path // than loading it as a normal javascript script. As such, if you try to // re-load _the exact same_ URL you end up getting a cached fetch // failure, which then amplifies the problem and makes the logic _never_ // load. This is bad, so we have to inject extra URL parameters to the // Anubis server. // - The canonical way to solve this in a `