aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/disable-mini-player.user.js
diff options
context:
space:
mode:
Diffstat (limited to 'youtube/disable-mini-player.user.js')
-rw-r--r--youtube/disable-mini-player.user.js35
1 files changed, 0 insertions, 35 deletions
diff --git a/youtube/disable-mini-player.user.js b/youtube/disable-mini-player.user.js
deleted file mode 100644
index fea5f1f..0000000
--- a/youtube/disable-mini-player.user.js
+++ /dev/null
@@ -1,35 +0,0 @@
-// ==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/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
-})