An extension for Chromium-based browsers that disables autoplay of HTML5 audio and video
JavaScript HTML
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
images
LICENSE
README.md
TODO
background.js
content_script.js
manifest.json
popup.html
popup.js

README.md

Disable HTML5 Autoplay

An extension for Chromium-based browsers that disables autoplay of all HTML5 audio and video

This extension disables HTML5 media autoplay on all websites. It requires little to no user interaction and should work on all websites without breaking functionality.

Here are some of its features with some technical details:

  • Stops media with the autoplay attribute
  • Works on dynamically-inserted elements and all iframes
  • Toggle autoplay on second-level domains (will be saved across browser sessions in the future)
  • Media player-specific code to prevent the controls from breaking
  • Prevents unauthorized invocations of the play() function via detecting user input events (for media without special code)
    • Fires play, playing, and pause events manually during an unauthorized invocation

To see a list of features to be implemented, check out the TODO file in the repository.

Using this extension

After installation, the extension will function on all new tabs.

This extension creates an icon next to the address bar (which is called a Browser Action.) The icon properties have tab-specific meanings:

  • When the icon has color, this means that autoplay is disabled.
  • When the icon is a light grey, this means that autoplay is enabled.
  • The number that appears over the icon is the number of autoplay attempts.

When the Browser Action is clicked, a popup will appear with the following:

  • A checkbox to toggle autoplay for the current page's second-level domain. When unchecked, autoplay is disabled. When checked, autoplay is enabled.
  • A section displaying the total number of autoplay attempts and the total number of media elements
  • A section with the number of media elements and the number of autoplay attempts for each media player type.

Installation

Currently, only Chrome/Chromium and Opera are supported. Firefox will be supported when WebExtensions has matured enough to support all the features necessary.

Install from Chrome Webstore

Install from Opera Addons

Install from source

  1. Download and unpack the source code:
  1. In chrome://extensions/, enable Developer mode
  2. Use "Load unpacked extension..." and select the folder containing the extension source code