The Netflix Sleep Timer is a browser extension designed to automatically pause or close Netflix after a specified amount of time or at the end of an episode. This extension is perfect for those who like to watch Netflix before bed and don't want their device to keep playing all night.
- Pause after a set time: Automatically pause the video after a specified number of minutes.
- Close after a set time: Automatically close the browser tab after a specified number of minutes.
- Pause at the end of an episode: Automatically pause the video at the end of the current episode.
- Close at the end of an episode: Automatically close the browser tab at the end of the current episode.
- Browser notifications: Get notified when the timer is set.
- Clone or download this repository to your local machine.
bash git clone https://github.com/arttuheinila/netflix-timer.git
-
Open your browser and go to the extensions page:
- For Chrome:
chrome://extensions/ - For Firefox:
about:addons
- For Chrome:
-
Enable "Developer mode" (for Chrome) or "Debug mode" (for Firefox).
-
Click on "Load unpacked" (for Chrome) or "Load Temporary Add-on" (for Firefox).
-
Select the folder where you cloned/downloaded the repository.
-
Click on the Netflix Sleep Timer extension icon in your browser to open the popup.
-
Select an action from the dropdown menu:
- Wait Next Episode and Pause: Pause the video at the end of the current episode.
- Pause after X minutes: Pause the video after a specified number of minutes.
- Close after X minutes: Close the browser tab after a specified number of minutes.
-
If you selected "Pause after X minutes" or "Close after X minutes," enter the number of minutes in the input field that appears.
-
Click the "Start" button to set the timer.
-
A browser notification will confirm that the timer has been set.
- manifest.json: The manifest file that defines the extension's permissions and behavior.
- background.js: The background script that handles timers and notifications.
- content.js: The content script that interacts with the Netflix webpage.
- popup.html: The HTML file for the extension's popup interface.
- popup.js: The JavaScript file that handles user interactions in the popup.
- Make your changes in the relevant files.
- Reload the extension in your browser as described in the Installation section.
- Use the browser's developer tools to view console logs and debug issues.
- Ensure the extension has the necessary permissions in the manifest file.
- Check the browser's notification settings to ensure notifications are allowed for the extension.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes and commit them (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
This project is licensed under the MIT License