diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2026-09-21 23:18:15 -0500 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2026-09-21 23:18:15 -0500 |
| commit | b88ff9fe8e80cc4d8aa0db2a3595ab10f40f4439 (patch) | |
| tree | 234e442aaaff83d1a50fb15998690dc4f0bfe6c6 /scripts/youtube-disable-mini-player.user.js | |
| parent | 531a76993e2babcecc69be7b5333729078c8dd9b (diff) | |
| download | userscripts-b88ff9fe8e80cc4d8aa0db2a3595ab10f40f4439.tar.xz userscripts-b88ff9fe8e80cc4d8aa0db2a3595ab10f40f4439.zip | |
move all scripts to scripts dir
Diffstat (limited to 'scripts/youtube-disable-mini-player.user.js')
| -rw-r--r-- | scripts/youtube-disable-mini-player.user.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/youtube-disable-mini-player.user.js b/scripts/youtube-disable-mini-player.user.js new file mode 100644 index 0000000..1b02a24 --- /dev/null +++ b/scripts/youtube-disable-mini-player.user.js @@ -0,0 +1,35 @@ +// ==UserScript== +// @name Disable YouTube Miniplayer +// @author tjkeller.xyz +// @include *youtube.com* +// @grant GM_addStyle +// @homepageURL https://git.tjkeller.xyz/userscripts/about +// @downloadURL https://git.tjkeller.xyz/userscripts/plain/scripts/youtube-disable-mini-player.user.js +// @version 1.1 +// @author tjkeller.xyz +// ==/UserScript== + +// Remove home and shorts button +GM_addStyle(` + 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() +}) + +// 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 +}) |
