Last active
September 2, 2023 03:04
-
-
Save ElGatoSaez/e412a7d007947f55015f66793b8098a5 to your computer and use it in GitHub Desktop.
userscript to remove curved borders on youtube
This file contains 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 YouTube Border Radius Remover | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Removes border-radius from the YouTube player element | |
// @author ElGatoSaez | |
// @match https://www.youtube.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Function to remove the border-radius | |
function removeBorderRadius() { | |
const playerElement = document.querySelector('ytd-watch-flexy[rounded-player-large][default-layout] #ytd-player.ytd-watch-flexy'); | |
if (playerElement) { | |
playerElement.style.borderRadius = '0'; | |
} | |
} | |
// Create a MutationObserver to listen for changes in the DOM | |
const observer = new MutationObserver(() => { | |
removeBorderRadius(); | |
}); | |
// Observe changes to the body's child nodes and subtree | |
observer.observe(document.body, { childList: true, subtree: true }); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment