Load service worker on Apple platforms again (PR #7792)

Service workers were disabled on Apple platforms just under a year ago in commit Disable service worker on Apple devices for now. · discourse/discourse@6d0732f · GitHub because no features on Apple platforms required it and there were vague “issues” stemming from use of service workers on at least iOS (see linked commit for a GitHub linkback to a 404 post on the meta forums).

We need to re-enable the service worker again so that Push Notifications begin working on Mac.

I chronicled my journey to get to this point on the meta forum.

GitHub

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/discourse-push-notifications-for-desktop/86941/52

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/disable-service-worker-initializer/116392/14

I’m happy to redo this PR to specifically disable all Apple platforms except non-Safari browsers on Mac if that’s required. Just let me know!

Closing this PR as work is already underway in the offline branch. More info

Thanks for contributing this pull request! Could you please sign our CLA so we can review it? http://www.discourse.org/cla

Hey @robbiet480, the PR was merged, but we had to drop Apple support shortly after because another bug was found :frowning:

1 Like

@xfalcox Any update on when SW will get enabled?

@robbiet480 we recently enabled it on MacOS when running non-Safari browsers.

I also created a small theme component GitHub - discourse/discourse-enable-service-worker-on-apple-devices which enables a per user opt-in into Service workers on Safari.

We will only enable SW on Safari once Apple fixes 200345 – SameSite cookies missing after Safari Tab recovery

2 Likes