Last active
March 11, 2024 10:53
-
-
Save AgentLoneStar007/0a862844cbd2860bfa7cb5c30cbe5bcd to your computer and use it in GitHub Desktop.
Gigatube.js: A userscript that removes the Youtube doodle and replaces it with something way better.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Gigatube (Youtube Doodle Remover) | |
// @version 1.1 | |
// @description Replaces the Youtube logo and any Youtube/Google doodles with a different image. | |
// @author AgentLoneStar007, with a ton of help from u/FlowerForWar. | |
// @match *://www.youtube.com/* | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== | |
const newImage = 'https://i.imgur.com/YVxABmv.png'; | |
function callback(_, observer) { | |
const yoodle = document.querySelector('.ytd-yoodle-renderer'); | |
if (yoodle) { | |
console.log(yoodle); | |
yoodle.outerHTML = `<img src="${newImage}">`; | |
observer.disconnect(); | |
} | |
const logo = document.querySelector('.ytd-logo'); | |
if (logo) { | |
console.log(logo); | |
logo.outerHTML = `<img src="${newImage}">`; | |
observer.disconnect(); | |
} | |
} | |
new MutationObserver(callback).observe(document, { | |
childList: !0, | |
subtree: !0, | |
}); |
Updated script to fix an issue where the new logo wouldn't appear if there was a Youtube doodle.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gid:pr6UZ9MUuLu67VvRjzodkR