The Background Sync API lets you defer actions until the user has a stable connection. The browser retries the sync even if the user left the page!
Use case: A messaging app queues unsent messages and syncs them when connectivity returns.