Skip to content

Instantly share code, notes, and snippets.

@atonn atonn/Reghook.js forked from Tazeki/Reghook.js
Last active Jan 7, 2018

Embed
What would you like to do?
YouTube / HookTube RegEx based URL conversion.
// ==UserScript==
// @name URL Conversion | YouTube - HookTube
// @namespace Tazeki
// @description The smallest, possibly most useful YouTube-HookTube conversion script. RegEx based. Report bugs to tangentale@protonmail.com. 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
You can’t perform that action at this time.