Created
February 24, 2017 14:17
-
-
Save AccaliaDeElementia/df36be28c0bcb9845bbdc7e4226101e3 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 YoutubeEmbedder | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Accalia <accalia@elementia.me> | |
// @match https://www.youtube.com/watch* | |
// @match http://www.youtube.com/watch* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var protocol = location.protocol; | |
var videoIdSearch = /v=([^&]+)(&|$)/.exec(location.search); | |
var videoId = (videoIdSearch || [])[1]; | |
if (!videoId) { | |
return; | |
} | |
var destination = `${protocol}//www.youtube.com/embed/${videoId}`; | |
location.replace(destination); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment