-
-
Save atonn/551d2846ee0055c3b7c45a001d2376b5 to your computer and use it in GitHub Desktop.
YouTube / HookTube RegEx based URL conversion.
This file contains hidden or 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 URL Conversion | YouTube - HookTube | |
// @namespace Tazeki | |
// @description The smallest, possibly most useful YouTube-HookTube conversion script. RegEx based. Report bugs to [email protected]. Sends any /www.youtube.com/ sites to HookTube before page load. Does not affect /other.youtube.com/, (gaming.youtube.com, creatoracademy.youtube.com, etc.). | |
// @include *youtube* | |
// @version 1 | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== | |
var url = window.location.toString(); | |
if (url.indexOf('www.youtube.com') !== - 1) { | |
window.location = url.replace(/youtube.com/, 'hooktube.com'); | |
} else if (url.indexOf('www.youtu.be') !== - 1) { | |
window.location = url.replace(/youtu.be/, 'hooktube.com'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment