Why does WhatsApp Web need a click from me for updating

whatsapp

Sometimes, roughly every 2-3 months, WhatsApp Web (web.whatsapp.com), that I access through Chrome or Chromium, displays a green banner at the top of the left column:

Update available - Click to update Whatsapp

"Update available. Click to update WhatsApp"

Clicking triggers a page refresh, then WhatsApp operates normally (it doesn't require a new pairing with the device). Actually, it is operative while the banner is displayed too, i.e. before accepting the update, too.

This usually appears at the start of a session (right when I visit the page), but it has also happened mid-session.

I'm confused by this request: the page has already the permission to set (and, I believe, update) its cookies, and it doesn't run any additional software on my computer. I wouldn't think it needs to do anything client side. So what is it updating and why would it need my click?


Edit: some recent update events: 16 October 2018, 5 April 2019, 24 September 2019, 11 October 2019.

Best Answer

WhatsApp uses a service worker that cache some scripts, but the browser see the necessary scripts update only loaded the the page, because, he search for code change in the service worker. For this, WhatsApp hint you about it. It could also reload the page after the service worker update, but it also want that the user view the update and decides when it's opportune to reload the page.