Last active
October 6, 2022 15:06
-
-
Save Silveere/55d9f114e9eea259164881fdb6bda0e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name No YouTube Shorts | |
// @namespace https://gist.github.com/Silveere/55d9f114e9eea259164881fdb6bda0e7 | |
// @match *://www.youtube.com/* | |
// @grant none | |
// @version 1.0 | |
// @author NullBite | |
// @updateURL https://gist.github.com/Silveere/55d9f114e9eea259164881fdb6bda0e7/raw/noytshorts.user.js | |
// @downloadURL https://gist.github.com/Silveere/55d9f114e9eea259164881fdb6bda0e7/raw/noytshorts.user.js | |
// @description 3/21/2022, 8:25:41 AM | |
// ==/UserScript== | |
function main() { | |
if (window.location.href.match(/^https?:\/\/www\.youtube\.[a-z.]*\/shorts\//)) { | |
href="https://www.youtube.com/watch?v=" + window.location.href.match(/\/([A-Za-z0-9-_]*)$/)[1] | |
console.log("Short detected. Redirecting to " + href) | |
window.location.replace(href) | |
} | |
} | |
console.log("No YouTube Shorts loaded") | |
main() | |
last_href=window.location.href | |
setInterval(function() { | |
if (last_href != window.location.href) { | |
main() | |
} | |
last_href=window.location.href | |
}, 500) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment