- Wed 06 September 2017
- misc
I finally decided I'd had enough with autoplay videos, which are a preferred way of shoving advertising right up in your grill these days. They're completely annoying when going to cnn.com and several other sites. Increasing numbers of web properties have upped the ante in recent months by deploying these in conjunction with anti-ad-blocker technology (if they stuck to banner ads and didn't do movies, invasive javascript and random stuff-that-makes-the-cpu-fans spin we wouldn't be having this discussion).
Turns out to be fairly easy to disable autoplay for Safari on the Mac. First, enable the debug menu and restart Safari. I was able to skip this step since I'd already enabled debug ages ago - it's generically useful to have around.
{% raw %} defaults write com.apple.Safari IncludeInternalDebugMenu 1
Then, Debug > Media Flags > Video Needs User Action.
For good measure I also did: Debug > Media Flags > Disallow Inline Audio.
Some HOW-TO documents suggest selecting Debug > Media Flags > Disallow Inline Video. I tried this but it didn't seem to make a difference. I'm running Safari 10.1.2 on macOS Sierra 10.12.6.
That's pretty much it. Hugely different browsing experience, overall snappier and less resource use, especially with a couple of windows open (something inevitably slips through).
If you really want to turn off the debug menu you can do:
{% raw %} defaults write com.apple.Safari IncludeInternalDebugMenu 0
and restart Safari again. But why would you do that?