Skip to content

Control inline video—and more—in Safari

This is another oldie but goodie from Mac OS X Hints, explaining how to enable the Debug menu in Safari. To do that, quit Safari, open Terminal, paste the following line, and press Return:

defaults write com.apple.Safari IncludeInternalDebugMenu 1

When you relaunch Safari, you'll have a (really long) Debug menu on the far right of Safari's menus. And just why might you want a Debug menu in Safari? Kirk McElhearn offers up one good reason:

Auto-play videos suck. They use bandwidth, and their annoying sounds get in the way when you’re listening to music and open a web page. …

But you can stop auto-play videos from playing on a Mac. If you use Chrome or Firefox, it’s pretty simple, and the plugins below work both on macOS and Windows; if you use Safari, it’s a bit more complex, but it’s not that hard.

In Safari, they key is the Debug menu, as Kirk points out. Go to Media Flags and select (activate) Disallow Inline Video, and that should be the end of auto-playing video. See Kirk's blog post for ways to do the same in Firefox and Chrome.

Beyond auto-play video, though, there's lots to geek out about in the Debug menu…

First up is this, the ultimate geeky overlay:

That's available via the Show Resource Usage Overlay, and it's a per-tab overlay—open a new tab, and the overlay statistics apply just to that tab. Most of what's there probably isn't of much general use, though it's interesting to see CPU usage on a per-tab basis—try it on a site with auto-playing video, and you'll see one reason why such things are universally hated. You can drag the overlay around, but it can't be positioned outside the window area.

There are some other potentially-interesting looking settings in the Debug menu, including the first two, which let you disable or cap the per-tab processes that Safari uses. (By default, each new tab in Safari is a new process.)

You can also reset or recompute the Top Sites page, which may be useful if you use that page; I don't. You can crash—or perhaps more usefully, pause—a web process (i.e. a tab doing something). You can even load a blank tab on a five-second delay.

There's a lot here you won't care about, too, or that when set, may cause issues rendering pages. And the Start Stress Test menu item appears to be strictly for use within Apple, based on the error message it displays when selected:

As with all things not enabled by default, be careful when playing around with the Debug menu. I suggest changing only one thing at a time if you're going to experiment, so you can easily revert.

3 thoughts on “Control inline video—and more—in Safari”

  1. Media Flags under Debug seems to be gone now, Safari 9.1.2. I've read this tip in many places, but I just don't have the Media Flags option. The menu skips from Drawing/Compositing Flags to Debug Overlays. And I've looked in all the submenus, too.

    1. It's still here in Safari 10.1 … what version of macOS/OS X are you on?

      -rob.

      1. Thank you for replying. On one system, 10.11.6, Safari 9.1.2. I've disabled and enabled Debug menu a couple of times. Also, the command-line equivalents that I found for for doing this in Terminal have no effect on autoplay. But I just tried on a system 10.12.3 and Safari 10, and media flags are there. I will try to disable autoplay there.

Comments are closed.