Skip to content

Instantly share code, notes, and snippets.

@pundoo
Last active March 11, 2024 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pundoo/7b429b4f299f40584ceea000ad5ece1a to your computer and use it in GitHub Desktop.
Save pundoo/7b429b4f299f40584ceea000ad5ece1a to your computer and use it in GitHub Desktop.
/// youtube-shorts-redirect.js
document.addEventListener('yt-navigate-finish', e => {
const pathName = window.location.pathname;
if (!/^\/shorts/.test(pathName)) return;
window.location.replace(`https://www.youtube.com/watch/?v=${pathName.match(/shorts\/(\w+)/)[1]}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment