How to disable service workers in Safari 12.1? (Mac)

You can try to turn off the feature via the Debug menu. For me, using Safari 12.1.1, It is listed under

Debug -> WebKit Internal Features -> Service Workers

Note that I am referring to the internal Debug menu, and not the Developer menu. The Debug menu is activated by writing the key IncludeInternalDebugMenu into Safari preferences (e.g. defaults write com.apple.Safari IncludeInternalDebugMenu 1 -- under Mojave, you will have to grant Full Disk Access to Terminal.app first; otherwise the setting will not take.)

I'm not sure if this persists across browser restarts, though.


As I cannot add a comment, I must submit it as an answer.

@vykor answer is good.

There needs to be one more step at the end.

I had to restart the browser too for the Debug menu to appear.

It did not appear automatically as the Developer menu. I have Mojave + Safari 12.1.1