diff options
author | Tim Keller <tjkeller.xyz> | 2024-11-17 20:53:58 -0600 |
---|---|---|
committer | Tim Keller <tjkeller.xyz> | 2024-11-17 20:53:58 -0600 |
commit | 0ee3d4f4cd9674fbd9398615d8054de0ebd9c130 (patch) | |
tree | 2030f59f5e86aa3e1b4d5129b6c301252fc4c5b0 /youtube/disable-mini-player.js | |
parent | 5dd17fe3c88d8543cbff634116d76f1fb1692faf (diff) | |
download | userscripts-0ee3d4f4cd9674fbd9398615d8054de0ebd9c130.tar.xz userscripts-0ee3d4f4cd9674fbd9398615d8054de0ebd9c130.zip |
replace spaces with tabs
Diffstat (limited to 'youtube/disable-mini-player.js')
-rw-r--r-- | youtube/disable-mini-player.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/youtube/disable-mini-player.js b/youtube/disable-mini-player.js index da8349c..126a6a7 100644 --- a/youtube/disable-mini-player.js +++ b/youtube/disable-mini-player.js @@ -7,25 +7,25 @@ // Remove home and shorts button GM_addStyle(` - ytd-miniplayer, - .ytp-miniplayer-button - { - display: none !important; /* Needs !important flag */ - } + ytd-miniplayer, + .ytp-miniplayer-button + { + display: none !important; /* Needs !important flag */ + } `) // Pause video before navigating document.body.addEventListener("yt-navigate-start", () => { - if (window.location.pathname == "/watch") - document.querySelector("ytd-player video").pause() + if (window.location.pathname == "/watch") + document.querySelector("ytd-player video").pause() }) // Close miniplayer by clicking close button in code document.body.addEventListener("yt-navigate-finish", () => { - setTimeout(() => { - const miniplayerCloseButton = document.querySelector("button.ytp-miniplayer-close-button") - if (miniplayerCloseButton) - miniplayerCloseButton.click() - }, 500) // Wait 500ms to close consistantly since miniplayer loads a little after this event + setTimeout(() => { + const miniplayerCloseButton = document.querySelector("button.ytp-miniplayer-close-button") + if (miniplayerCloseButton) + miniplayerCloseButton.click() + }, 500) // Wait 500ms to close consistantly since miniplayer loads a little after this event }) |