Skip to content

Instantly share code, notes, and snippets.

@barraIhsan
Last active August 16, 2024 05:46
Show Gist options
  • Save barraIhsan/4ffe1590bcfa161fbab08aa18257fbaa to your computer and use it in GitHub Desktop.
Save barraIhsan/4ffe1590bcfa161fbab08aa18257fbaa to your computer and use it in GitHub Desktop.
YouTube Notification Count Remover

YouTube Notification Count Remover

Description

The YouTube Notification Count Remover is a user script that removes the notification count from the title bar on YouTube, resulting in improved visibility of video titles.

Before:

Before

After:

After

Installation

To install the script, click the following link: Install the script

Please note that you will need a browser extension like Greasemonkey or Tampermonkey to run the user script.

// ==UserScript==
// @name YouTube Notification Count Remover
// @version 1.2
// @description Removes the notification count on YouTube, improving visibility of video titles in the title bar.
// @author barraIhsan
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?domain=youtube.com
// @updateURL https://gist.github.com/barraIhsan/4ffe1590bcfa161fbab08aa18257fbaa/raw/ytRemoveNotifCount.user.js
// @downloadURL https://gist.github.com/barraIhsan/4ffe1590bcfa161fbab08aa18257fbaa/raw/ytRemoveNotifCount.user.js
// ==/UserScript==
(function() {
'use strict';
let previousTitle = document.title;
// Function to handle the title change
function handleTitleChange() {
const currentTitle = document.title;
if (currentTitle !== previousTitle) {
// Title has changed, check for parentheses content at the beginning
const updatedTitle = currentTitle.replace(/^\(\d+\)\s*/, '');
// Update the title if parentheses content is found and removed
if (currentTitle !== updatedTitle) {
document.title = updatedTitle;
}
// Update the previous title
previousTitle = currentTitle;
}
}
// Observe title changes with MutationObserver
new MutationObserver(handleTitleChange).observe(document.querySelector('title'), {childList: true});
})();
@D3SOX
Copy link

D3SOX commented Jun 28, 2024

Thanks a lot for providing this simple script, works great!

@barraIhsan
Copy link
Author

Thanks a lot for providing this simple script, works great!

your welcome, im very glad that you like one of my script!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment