-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyt-prodboost.js
More file actions
40 lines (31 loc) · 1.02 KB
/
yt-prodboost.js
File metadata and controls
40 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// ==UserScript==
// @name YouTube Productivity Booster
// @version 7
// @description Hides suggested videos on YouTube's front page and video pages
// @author redbeam
// @match https://www.youtube.com/*
// @grant unsafeWindow
// @run-at document-start
// ==/UserScript==
"use strict";
function hideHome() {
if (document.location.pathname != "/") {
return;
}
let home = document.getElementById("primary");
home.style = "display: none";
document.getElementById("buttons").addEventListener("click", () => {home.style = ""});
}
function hideRelated() {
if ( ! document.location.pathname.includes("/watch")) {
return;
}
let panel = document.getElementById("related");
panel.style = "display: none";
document.getElementById("buttons").addEventListener("click", () => {panel.style = ""});
}
unsafeWindow.addEventListener("yt-navigate-finish", function() {
hideHome();
hideRelated();
});
console.log("Started YouTube Productivity Booster");