Skip to content

Instantly share code, notes, and snippets.

Created April 21, 2019 05:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Youtube To Embed userscript. Use with plugins like tampermonkey to automatically redirect to youtube embed for distraction free view.
// ==UserScript==
// @name Youtube Redirect To Embed
// @namespace
// @version 0.1
// @description youtube to embed
// @author Shubham Kamthania
// @match*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var goTOEmbed= function(){
var parameters = new URLSearchParams(;
var videoCode = parameters.get('v');
if(videoCode) {
location.replace ("" + videoCode);
window.document.body.addEventListener("yt-navigate-finish", function(event) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment