Apple’s attack on service workers

Apple aren’t the best at developer relations. But, bad as their communications can be, I’m willing to cut them some slack. After all, they’re not used to talking with the developer community.

John Wilander wrote a blog post that starts with some excellent news: Full Third-Party Cookie Blocking and More. Safari is catching up to Firefox and disabling third-party cookies by default. Wonderful! I’ve had third-party cookies disabled for a few years now, and while something occassionally breaks, it’s honestly a pretty great experience all around. Denying companies the ability to track users across sites is A Good Thing.

In the same blog post, John said that client-side cookies will be capped to a seven-day lifespan, as previously announced. Just to be clear, this only applies to client-side cookies. If you’re setting a cookie on the server, using PHP or some other server-side language, it won’t be affected. So persistent logins are still doable.

Then, in an audacious example of burying the lede, towards the end of the blog post, John announces that a whole bunch of other client-side storage technologies will also be capped to seven days. Most of the technologies are APIs that, like cookies, can be used to store data: Indexed DB, Local Storage, and Session Storage (though there’s no mention of the Cache API). At the bottom of the list is this:

Service Worker registrations

Okay, let’s clear up a few things here (because they have been so poorly communicated in the blog post)…

The seven day timer refers to seven days of Safari usage, not seven calendar days (although, given how often most people use their phones, the two are probably interchangable). So if someone returns to your site within a seven day period of using Safari, the timer resets to zero, and your service worker gets a stay of execution. Lucky you.

This only applies to Safari. So if your site has been added to the home screen and your web app manifest has a value for the “display” property like “standalone” or “full screen”, the seven day timer doesn’t apply.

That piece of information was missing from the initial blog post. Since the blog post was updated to include this clarification, some people have taken this to mean that progressive web apps aren’t affected by the upcoming change. Not true. Only progressive web apps that have been added to the home screen (and that have an appropriate “display” value) will be spared. That’s a vanishingly small percentage of progressive web apps, especially on iOS. To add a site to the home screen on iOS, you need to dig and scroll through the share menu to find the right option. And you need to do this unprompted. There is no ambient badging in Safari to indicate that a site is installable. Chrome’s install banner isn’t perfect, but it’s better than nothing.

Just a reminder: a progressive web app is a website that

  • runs on HTTPS,
  • has a service worker,
  • and a web manifest.

Adding to the home screen is something you can do with a progressive web app (or any other website). It is not what defines progressive web apps.

In any case, this move to delete service workers after seven days of using Safari is very odd, and I’m struggling to find the connection to the rest of the blog post, which is about technologies that can store data.

As I understand it, with the crackdown on setting third-party cookies, trackers are moving to first-party technologies. So whereas in the past, a tracking company could tell its customers “Add this script element to your pages”, now they have to say “Add this script element and this script file to your pages.” That JavaScript file can then store a unique idenitifer on the client. This could be done with a cookie, with Local Storage, or with Indexed DB, for example. But I’m struggling to understand how a service worker script could be used in this way. I’d really like to see some examples of this actually happening.

The best explanation I can come up with for this move by Apple is that it feels like the neatest solution. That’s neat as in tidy, not as in nifty. It is definitely not a nifty solution.

If some technologies set by a specific domain are being purged after seven days, then the tidy thing to do is purge all technologies from that domain. Service workers are getting included in that dragnet.

Now, to be fair, browsers and operating systems are free to clean up storage space as they see fit. Caches, Local Storage, Indexed DB—all of those are subject to eventually getting cleaned up.

So I was curious. Wanting to give Apple the benefit of the doubt, I set about trying to find out how long service worker registrations currently last before getting deleted. Maybe this announcement of a seven day time limit would turn out to be not such a big change from current behaviour. Maybe currently service workers last for 90 days, or 60, or just 30.

Nope:

There was no time limit previously.

This is not a minor change. This is a crippling attack on service workers, a technology specifically designed to improve the user experience for return visits, whether it’s through improved performance or offline access.

I wouldn’t be so stunned had this announcement come with an accompanying feature that would allow Safari users to know when a website is a progressive web app that can be added to the home screen. But Safari continues to ignore the existence of progressive web apps. And now it will actively discourage people from using service workers.

If you’d like to give feedback on this ludicrous development, you can file a bug (down in the cellar in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying “Beware of the Leopard”).

No doubt there will still be plenty of Apple apologists telling us why it’s good that Safari has wished service workers into the cornfield. But make no mistake. This is a terrible move by Apple.

I will say this though: given The Situation we’re all living in right now, some good ol’ fashioned Hot Drama by a browser vendor behaving badly feels almost comforting.

Have you published a response to this? :

Responses

вкαя∂εℓℓ

Is your understanding that other browsers don’t have a two tiered premise like this? My understanding is that they do as well. Is it that the ones in the browser (all) can’t get cleaned up if unused? My understanding is they can/do as well.

Hiku

“Apple aren’t the best at developer relations. But, bad as their communications can be, I’m willing to cut them some slack. After all, they’re not used to talking with the developer community.” adactio.com/journal/16619

# Posted by Hiku on Friday, March 27th, 2020 at 4:52am

Hiku

“Only progressive web apps that have been added to the home screen (and that have an appropriate “display” value) will be spared. That’s a vanishingly small percentage of progressive web apps, especially on iOS.” adactio.com/journal/16619

# Posted by Hiku on Friday, March 27th, 2020 at 4:54am

Hiku

“There is no ambient badging in Safari to indicate that a site is installable. Chrome’s install banner isn’t perfect, but it’s better than nothing.” adactio.com/journal/16619

# Posted by Hiku on Friday, March 27th, 2020 at 4:54am

Hiku

“In any case, this move to delete service workers after seven days of using Safari is very odd, and I’m struggling to find the connection to the rest of the blog post, which is about technologies that can store data.” adactio.com/journal/16619

# Posted by Hiku on Friday, March 27th, 2020 at 4:55am

Hiku

“The best explanation I can come up with for this move by Apple is that it feels like the neatest solution. That’s neat as in tidy, not as in nifty. It is definitely not a nifty solution.” adactio.com/journal/16619

# Posted by Hiku on Friday, March 27th, 2020 at 4:56am

Hiku

“If some technologies set by a specific domain are being purged after seven days, then the tidy thing to do is purge all technologies from that domain. Service workers are getting included in that dragnet.” adactio.com/journal/16619

# Posted by Hiku on Friday, March 27th, 2020 at 4:56am

Hiku

“This is not a minor change. This is a crippling attack on service workers, a technology specifically designed to improve the user experience for return visits, whether it’s through improved performance or offline access.” adactio.com/journal/16619

# Posted by Hiku on Friday, March 27th, 2020 at 4:58am

Hiku

“No doubt there will still be plenty of Apple apologists telling us why it’s good that Safari has wished service workers into the cornfield. But make no mistake. This is a terrible move by Apple” adactio.com/journal/16619

# Posted by Hiku on Friday, March 27th, 2020 at 4:58am

Gary Green

This change by Safari actually makes a lot of sense. Sites atm can “implicitly” install themselves forever. Even ones you casually only browse to once. With the proposed change, they can still do this but they only persist if they were explictly installed e.g. to Homescreen.

# Posted by Gary Green on Friday, March 27th, 2020 at 2:23pm

Sven Kaemper

»This is a crippling attack on service workers, a technology specifically designed to improve the user experience for return visits, whether it’s through improved performance or offline access.« ⁦@Apple#fail adactio.com/journal/16619

Scott O'Hara

You mention “added to home screen AND web app manifest has a value for the ‘display’ property like ‘standalone’ or ‘full screen’”. I thought on iOS home screen apps don’t need a manifest, they use <meta name=”apple-mobile-web-app-capable”>. Does this mean we now NEED a manifest?

St�phanie W.

Apple’s attack on service workers: “Safari continues to ignore the existence of progressive web apps. And now it will actively discourage people from using service workers.” What we can do about this? Fill a bug :/ by @adactio adactio.com/journal/16619

Julien

Always the right words from @adactio: “I will say this though: given The Situation we’re all living in right now, some good ol’ fashioned Hot Drama by a browser vendor behaving badly feels almost comforting.” All in this is true: adactio.com/journal/16619

# Posted by Julien on Monday, March 30th, 2020 at 9:29am

Morgan Roderick

I thought anything with a url could be added to the home screen? My blog can, and doesn’t use service workers or a web manifest. How would a PWA be any different?

David

Aunque siga siendo malo, no entiendo por qué es una sorpresa que Apple no quiera permitir NADA más allá de la App Store. Y eso incluye las PWAs.

# Posted by David on Thursday, April 2nd, 2020 at 7:58pm

12 Shares

# Shared by Pelle Wessman on Thursday, March 26th, 2020 at 3:00pm

# Shared by Paul Robert Lloyd on Thursday, March 26th, 2020 at 3:04pm

# Shared by Abbas Arezoo on Thursday, March 26th, 2020 at 3:39pm

# Shared by Bruce Lawson. At home. on Thursday, March 26th, 2020 at 3:45pm

# Shared by Kevin Marks on Thursday, March 26th, 2020 at 3:48pm

# Shared by 🔥🌏Ollie Boermans on Thursday, March 26th, 2020 at 9:14pm

# Shared by Dan Johnson on Thursday, March 26th, 2020 at 9:47pm

# Shared by Marc Friederich on Friday, March 27th, 2020 at 2:06pm

# Shared by Oliver Ash on Friday, March 27th, 2020 at 8:24pm

# Shared by Robert Novak on Sunday, March 29th, 2020 at 1:57am

# Shared by Fynn Becker on Sunday, March 29th, 2020 at 6:43pm

# Shared by minkiu on Thursday, April 2nd, 2020 at 7:38pm

22 Likes

# Liked by Chris Smith on Thursday, March 26th, 2020 at 3:17pm

# Liked by Pelle Wessman on Thursday, March 26th, 2020 at 3:17pm

# Liked by Jazz DiMauro on Thursday, March 26th, 2020 at 3:18pm

# Liked by Steve Ganz on Thursday, March 26th, 2020 at 3:18pm

# Liked by Tom on Thursday, March 26th, 2020 at 3:19pm

# Liked by Darcy Clarke (he/him) on Thursday, March 26th, 2020 at 3:20pm

# Liked by Tajinder Birdi on Thursday, March 26th, 2020 at 4:30pm

# Liked by Amber Wilson on Thursday, March 26th, 2020 at 4:30pm

# Liked by Spawn Design on Thursday, March 26th, 2020 at 4:30pm

# Liked by Jason Godesky on Thursday, March 26th, 2020 at 4:35pm

# Liked by Abbas Arezoo on Thursday, March 26th, 2020 at 4:35pm

# Liked by neuroplastic on Thursday, March 26th, 2020 at 7:19pm

# Liked by Rhy Moore on Thursday, March 26th, 2020 at 8:02pm

# Liked by Jeremy Tyarks on Thursday, March 26th, 2020 at 8:33pm

# Liked by Anna Fuster on Thursday, March 26th, 2020 at 8:34pm

# Liked by F. van Hofen on Thursday, March 26th, 2020 at 10:17pm

# Liked by Oliver Ash on Friday, March 27th, 2020 at 9:59pm

# Liked by Ajwad on Saturday, March 28th, 2020 at 5:09pm

# Liked by Fynn Becker on Sunday, March 29th, 2020 at 8:03pm

# Liked by Marc Fabre on Monday, March 30th, 2020 at 10:40am

# Liked by minkiu on Friday, April 3rd, 2020 at 11:07am

# Liked by Future Sync Conf on Thursday, April 16th, 2020 at 12:12pm

Previously on this day

5 years ago I wrote 100 words 004

Day four.

11 years ago I wrote Boarding

I’m mobile. Fly me.

14 years ago I wrote Darwinian webolution

Websites aren’t built; they’re grown.

18 years ago I wrote New Arrival

Jessica’s iMac arrived yesterday.