-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
34 lines (28 loc) · 1.11 KB
/
main.js
File metadata and controls
34 lines (28 loc) · 1.11 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
let url = window.location.href;
if (url.match("/shorts/")) {
url = url.replace("shorts/", "watch?v=");
window.location.replace(url);
}
const injectedStyleId = "normal-player-shorts-hide-style";
function injectHideShortsStyle() {
if (document.getElementById(injectedStyleId)) {
return;
}
const style = document.createElement("style");
style.id = injectedStyleId;
style.textContent = `
ytd-guide-entry-renderer[is-primary]:has(a[title="Shorts"]),
ytd-mini-guide-entry-renderer:has(a[title="Shorts"]),
ytd-reel-shelf-renderer,
ytd-reel-item-renderer,
ytd-rich-section-renderer:has([is-shorts]),
ytd-rich-item-renderer:has([is-shorts], ytd-shorts-lockup-view-model, a[href*="/shorts/"]),
ytd-grid-video-renderer:has([is-shorts], ytd-shorts-lockup-view-model, a[href*="/shorts/"]),
ytd-video-renderer:has([is-shorts], ytd-shorts-lockup-view-model, a[href*="/shorts/"]),
ytd-compact-video-renderer:has([is-shorts], ytd-shorts-lockup-view-model, a[href*="/shorts/"]) {
display: none !important;
}
`;
document.documentElement.append(style);
}
injectHideShortsStyle();