Firefox does not trigger the request everytime the user leaves the page. Plus the request is not intercepted by the service worker. So we prevent the default behavior to have the popup asking the user if he wants to leave the page, by adding the popup, we let the time to the request to be sent, and intercepted by the service worker (for the offline part). We also add a toast to inform the user that the document has been saved, it will make it more obvious that the document has been saved if a firefox user come back from the popup to the page.