Automatically pauses YouTube videos when you switch tabs/windows and resumes playing when you return.
- Auto-pause YouTube videos when the tab is not active.
- Auto-resume YouTube videos when you return to the tab.
- Simple and easy to use.
- Google Chrome browser
- Basic knowledge of using the browser's Developer Mode
-
Clone the Repository
git clone https://github.com/ArcusTen/youtube-auto-play-pause.git cd youtube-auto-play-pause
-
Add the Extension to Chrome
- Open Chrome and navigate to
chrome://extensions/
. - Enable Developer mode by clicking the toggle switch in the top right corner.
- Click on the Load unpacked button and select the directory where you cloned the repository (
youtube-auto-play-pause
).
- Open Chrome and navigate to
- manifest.json: Configuration file for the Chrome extension.
- background.js: Handles tab activation and updating events.
- content.js: Contains the logic to pause and resume YouTube videos based on tab visibility.
- assets: Directory containing the icons for the extension.
- Once the extension is loaded, navigate to YouTube and play any video.
- Switch to a different tab and the video will automatically pause.
- Return to the YouTube tab and the video will automatically resume.
Contributions are welcome! Please fork the repository and submit a pull request for any improvements.