In true extensible web style, this is a low level feature that gives you the freedom to do what you need. The app doesn’t need to make such a big deal about the message sending, so it can add the message to the output straight away. Go back to your home screen (optionally close the tab/browser).īeing able to send in the background like this also yields a perceived performance improvement.Go offline (either using airplane-mode or visit your local Faraday cage).You can see it action by following the steps below: If the user tries to send a message when they have zero connectivity, then, thankfully, the message is sent in the background once they get connectivity.Īs of March 2016, Background sync is available in Chrome from version 49 and above. It uses push messages and notifications, and it uses background sync. The following video shows Emojoy, a simple emoji-only chat demo… thing. If the user has no connection we tell the user “Sorry, you must come back later and try again”. If they try to navigate away or close the tab, we use onbeforeunload to display a message like, “Nope, I need you to stare at this spinner some more. But what about when the page needs to send something to the server?Īt the moment, if the user hits "send" on a message they have to stare at a spinner until it completes. Service workers solve the page loading part by letting you serve content from a cache. By this point you want to give up, but you know the second you do so, is the second before everything would have loaded if only you’d waited. But why give up now? You’ve invested time already, so walking away with nothing would be a waste, so you carry on waiting. You’re staring at a white screen or a spinner, and you know you should just give up and get on with your life, but you give it another 10 seconds just in case. Unfortunately this experience is frequently broken by poor connectivity. The desired user experience is more like: Without wasting time on the internet, we wouldn’t know cats dislike flowers, chameleons love bubbles, or that our very own Eric Bidelman is a putt putt golfing hero of the late 90s.īut sometimes, just sometimes, we’re not looking to waste time. The internet is a great place to waste time. This is useful for ensuring that whatever the user wants to send, is actually sent. Background sync is a new web API that lets you defer actions until the user has stable connectivity.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |