How to scrap Flash, get HTML5 video in Safari on your Mac

With the rise of HTML5 vying for video supremacy on the Web, workarounds for disabling Flash Player continue to pop up, allowing users to get a smoother, faster video-viewing experience online.

With the rise of HTML5 vying for video supremacy on the Web, workarounds for disabling Flash Player continue to pop up, allowing users to get a smoother, faster video-viewing experience online.

John Gruber (Daring Fireball) provides a great tip for disabling Flash Player in Safari (edited by crarko on macosxhints.com), which forces Web sites to serve HTML5 videos (when available). Keep in mind that not all sites that serve videos have an HTML5 version. If you apply this hack, you may lose some functionality.

Another possible side effect of this process is sites that think your browser is Mobile Safari. That could cause the site to redirect to their mobile version, as if you were using an iPad.

Set your Mac to browse like an iPad. Apple

To disable Flash in Safari and browse using the iPad version of Mobile Safari, follow these directions:

  1. You can check how a site may render using the Develop menu and choosing a User Agent Profile for Mobile Safari. To activate the Develop menu in Safari, navigate to the Safari menu bar, click Safari > Preferences, and choose the Advanced tab. Check the box to enable the Develop menu.

  2. Click on the new Develop menu in the Safari menu bar and select User Agent > Mobile Safari 3.2.2 - iPad. This will cause your current session to render just as it would on an iPad (running iOS 3.2.2).

  3. If you would like the User Agent Profile to remain consistent, open Terminal and enter the following command:

    defaults write com.apple.Safari CustomUserAgent "'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10'"

You should now be served HTML5 videos on sites that have that option. If you still need to use Flash for any reason, Gruber recommends using Google's Chrome for those sites. Some people may think that a Safari extension such as ClickToPlugin (like ClickToFlash) would be an easier solution. Though this prevents Flash videos from loading and slowing your system, it still tells the page that you have Flash installed, and you get the Flash version of that video.

This hint allows you to browse as an iPad so that sites with browser detection will serve you the video pages in HTML5. To disable this hint and return to normal browsing, open Terminal and enter the following:

defaults delete com.apple.safari CustomUserAgent

Are you ready to be rid of Flash? Let me know in the comments!


Be sure to follow MacFixIt on Twitter and contribute to the CNET Mac forums.

About the author

    Joe is a seasoned Mac veteran with years of experience on the platform. He reports on Macs, iPods, iPhones and anything else Apple sells. He even has worked in Apple retail stores. He's also a creative professional who knows how to use a Mac to get the job done.

     

    Join the discussion

    Conversation powered by Livefyre

    Don't Miss
    Hot Products
    Trending on CNET

    HOT ON CNET

    Delete your photos by mistake?

    Whether you've deleted everything on your memory card or there's been a data corruption, here's a way to recover those photos.