Skip to content

Instantly share code, notes, and snippets.

@ElGatoSaez
Last active September 2, 2023 03:04
Show Gist options
  • Save ElGatoSaez/e412a7d007947f55015f66793b8098a5 to your computer and use it in GitHub Desktop.
Save ElGatoSaez/e412a7d007947f55015f66793b8098a5 to your computer and use it in GitHub Desktop.
userscript to remove curved borders on youtube
// ==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