I'm using js with react hooks and aws datastore, I need my browser to be completely offline until the user press a specific button. If the browser is not offline, datastore will try to send request when the device if connected to a wifi without internet (a printer) and it will generate errors and corrupted data.
I can do it from the developers tools : enter image description here
But how can I trigger this action directly from my application ? The browser is edge.
I already tried to use addons to put me offline, but it's not working as expected, some are just blocking the requests, and other are not working directly when the browser starts(I need to stop and start it again)
I tried to manage it in the app with navigator.onLine(), but datastore is just pushing when he believe that there is a signal.