aboutsummaryrefslogtreecommitdiff
path: root/youtube/disable-mini-player.js
diff options
context:
space:
mode:
authorTim Keller <tjkeller.xyz>2024-11-17 20:53:58 -0600
committerTim Keller <tjkeller.xyz>2024-11-17 20:53:58 -0600
commit0ee3d4f4cd9674fbd9398615d8054de0ebd9c130 (patch)
tree2030f59f5e86aa3e1b4d5129b6c301252fc4c5b0 /youtube/disable-mini-player.js
parent5dd17fe3c88d8543cbff634116d76f1fb1692faf (diff)
downloaduserscripts-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.js24
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
})