Skip to content

makaroni4/focused_youtube

Repository files navigation

Focused YouTube Add to Chrome

πŸ” Focused YouTube (FY) is a browser extension that helps you stay focused by blocking recommendations and other elements on YouTube.

πŸ’» Focused YouTube is available for

πŸͺ FY does not track any user data. It's a simple Vanilla JS application made with only one purpose – to help you avoid YouTube's rabbit hole.

Table of Contents

Features

🏠 Distraction-free YouTube homepage

home_page

πŸ” Clean search page

search_page

πŸ“Ί Noise-free video page

video_page

🌚 Dark mode (depends of your system settings)

search_page

Big shout out to @jakubkloc for introducing Dark Mode! πŸ™Œ

Make sure to enable Dark Mode in your browser before testing it:

https://support.google.com/chrome/answer/9275525?hl=en&co=GENIE.Platform%3DDesktop

πŸ’¬ Options to show/hide comments/description

search_page

Big thank you to @KParthSingh and @Ohnoimded for adding an option to temporarily disable the extension! πŸ™Œ

πŸ”— Hover over YouTube logo to see the navigation menu

search_page

πŸ“± Works in mobile browser as well

mobile_version

Big shout out to @fauzanabrar for making Focused Youtube work in mobile browsers! πŸ™Œ

Development

Clone FY's repo to your computer.

You need to have nvm installed in order to have a correct Node version for this project.

Install dependencies and run a command to re-build the extension (update files in the dist_chrome or dist_firefox folder) on any file change:

# 1. Install the correct node version.
nvm install

# 2. Install dependencies.
npm install

# 3. Monitor file changes to re-build the extension during development.
npm run dev --mode=chrome|firefox|edge

How to load the extension locally

The npm run dev command will generate a build folder: dist_chrome, dist_firefox or dist_edge. Browser differ slightly in how they load local extensions.

Chrome

For Chrome, load the dist_chrome folder as a local extension at chrome://extensions/ via "Load unpacked":

update_extension

⚠️ Note, that you'll need to update the extension (by clicking on the update icon) ☝️ every time you want to test the latest version.

Firefox

In Firefox, head over to about:debugging#/runtime/this-firefox and click on the "Load Temporary Add-on..." button on top of the page. ⚠️ For Firefox, you'll need to select the focused-youtube-firefox.zip file instead of the dist_firefox folder.

Edge

With Edge, open the edge://extensions/ page and click on the "Load unpacked" button on top of the page. ⚠️ Select the dist_edge folder instead.

Debugging storage API

Focused Youtube extension uses Storage API (see Storage API for Chrome or Storage API for Firefox) for keeping track of user settings and some additional data (installation timestamp, etc).

For Chromium browsers (Chrome, Edge, Brave)

To check out current storage data, right click on the extension icon and select "Inspect pop-up". In the dev console run:

chrome.storage.local.get(console.log)

To clear storage run the following code in the dev console:

chrome.storage.local.clear(() => {
  console.log("Cleared!")
})

For Firefox

Head over to the about:debugging#/runtime/this-firefox page and click on the "Inspect" button next to the "Focused for YouTube" extension.

browser.storage.local.get(console.log)

To clear storage run the following code in the dev console:

browser.storage.local.clear(() => {
  console.log("Cleared!")
})

Releasing

  1. Bump version in package.json.

  2. Build extension for all browser platforms:

npm run build:all
  1. Upload zip files to all stores:
bin/publish

Contributing

You're more than welcome to contribute. In fact, I'm really looking forward to it! πŸš€

Just make sure to check out the contribution guidelines. πŸ™

Credits

The info icon was created by @Remartwork and was taken from SVG Repo.