Skip to content

Commit 31ac229

Browse files
authored
Redirecting short videos
1 parent 61d6159 commit 31ac229

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

content.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
subtree: true
2222
});
2323
removeYt();
24+
if (location.pathname.includes("/shorts")) {
25+
path_array = location.pathname.split("/")
26+
const video_id = path_array[path_array.indexOf("shorts") + 1]
27+
if (video_id != null) {
28+
location.replace(location.protocol + "//" + location.host + "/watch?v=" + video_id)
29+
} else {
30+
location.replace(location.protocol + "//" + location.host)
31+
}
32+
}
2433
}
2534

2635
// Snapchat vertical and his placeholder
@@ -69,4 +78,4 @@
6978
});
7079
obsSnap();
7180
}
72-
})();
81+
})();

0 commit comments

Comments
 (0)