This is a Chrome & Firefox extension that pauses Youtube videos when losing the tab/window focus by sending events to the player. Resumes the playback once the Youtube tab/window is back in focus.
Also listens for computer lock events and when the video goes out of viewport (for example when reading comments below the video).
Features some useful keyboard shortcuts to control videos in the window.
From web store
Chrome: https://chrome.google.com/webstore/detail/pbehcnkdmffkllmlfjpblpjhflnafioo/ Firefox: https://addons.mozilla.org/en-US/firefox/addon/youtube-auto-pause/
From releases
There are pre-packaged releases available for both Chrome and Firefox. Download the latest release from the releases page and install it manually to your browser.
Manually (Chrome)
- Clone the repository
- Start chrome
- Go to
chrome://extensions
- Enable developer mode
- Click on "Load unpacked"
- Select the
chrome
directory in the repository
Manually (Firefox)
- Clone the repository
- Start firefox
- Go to
about:debugging
- Click on "This Firefox"
- Click on "Load Temporary Add-on"
- Select the
firefox
directory in the repository
- Youtube (obviously)
- Youtube Kids
- Vimeo
- Netflix
- Prime Video
- Max
- Disney+
- Twitch
- Udacity
Please feel free to contribute with pull requests or by creating issues. In case the extension does not work, please also list all other extensions you have enabled as this might conflict with other extensions.
To run the extension, either use npm run start:chrome
or npm run start:firefox
to start
specific browser. This will open a new browser window with the extension enabled.
If you want to debug the extension further, use npm run debug:chrome
and npm run debug:firefox
respectively. This will open the browser's developer tools that you can use to debug the extension.
Run npm install
to fetch necessary dependencies. Then run npm run build
to build
the extension packages under web-ext-artifacts
.