aboutsummaryrefslogtreecommitdiff
path: root/youtube/remove-home-shorts.js
diff options
context:
space:
mode:
Diffstat (limited to 'youtube/remove-home-shorts.js')
-rw-r--r--youtube/remove-home-shorts.js44
1 files changed, 22 insertions, 22 deletions
diff --git a/youtube/remove-home-shorts.js b/youtube/remove-home-shorts.js
index a5e3634..42ea0d0 100644
--- a/youtube/remove-home-shorts.js
+++ b/youtube/remove-home-shorts.js
@@ -12,13 +12,13 @@
// Remove home and shorts button
GM_addStyle(`
- tp-yt-app-drawer a[title=Home],
- tp-yt-app-drawer a[title=Shorts],
- ytd-mini-guide-renderer a[title=Home],
- ytd-mini-guide-renderer a[title=Shorts]
- {
- display: none !important; /* Needs !important flag */
- }
+ tp-yt-app-drawer a[title=Home],
+ tp-yt-app-drawer a[title=Shorts],
+ ytd-mini-guide-renderer a[title=Home],
+ ytd-mini-guide-renderer a[title=Shorts]
+ {
+ display: none !important; /* Needs !important flag */
+ }
`)
@@ -26,19 +26,19 @@ GM_addStyle(`
const subscriptionsPath = "/feed/subscriptions"
function redirectToSubscriptions() {
- // Invoke clicking the subscriptions button to use youtube's hot page reloading if possible instead of reloading the whole page
- const subscriptionsButton = document.querySelector("tp-yt-app-drawer a[title=Subscriptions]")
- if (subscriptionsButton)
- subscriptionsButton.click()
- else
- window.location.replace(subscriptionsPath)
+ // Invoke clicking the subscriptions button to use youtube's hot page reloading if possible instead of reloading the whole page
+ const subscriptionsButton = document.querySelector("tp-yt-app-drawer a[title=Subscriptions]")
+ if (subscriptionsButton)
+ subscriptionsButton.click()
+ else
+ window.location.replace(subscriptionsPath)
}
// Redirect to new homepage
function redirectIfHome() {
- if (window.location.pathname === "/")
- redirectToSubscriptions()
+ if (window.location.pathname === "/")
+ redirectToSubscriptions()
}
redirectIfHome()
@@ -52,11 +52,11 @@ window.addEventListener("popstate", redirectIfHome)
const logo = document.querySelector("#logo a")
if (logo) {
- logo.href = subscriptionsPath
- logo.addEventListener("click", e => {
- // Seems there is an event listener that forces redirect to site root, so stop that first
- e.stopPropagation()
- e.preventDefault()
- redirectToSubscriptions()
- })
+ logo.href = subscriptionsPath
+ logo.addEventListener("click", e => {
+ // Seems there is an event listener that forces redirect to site root, so stop that first
+ e.stopPropagation()
+ e.preventDefault()
+ redirectToSubscriptions()
+ })
}