Skip to content

Instantly share code, notes, and snippets.

@14mRh4X0r
Last active June 18, 2022 18:02
Show Gist options
  • Save 14mRh4X0r/4483416 to your computer and use it in GitHub Desktop.
Save 14mRh4X0r/4483416 to your computer and use it in GitHub Desktop.
Script to replace a youtube.com video with the embed version. Useful when youtube.com complains about the lack of Flash, to get it in HTML5 anyway (hence "watch_anyway.js")
/*
* Copyright © 2013 Willem Mulder
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://www.wtfpl.net/ for more details.
*/
(function() {
var opts = {};
var tokens = location.search.substr(1).split("&");
for (var i = 0; i < tokens.length; i++) {
var kvTup = tokens[i].split("=");
opts[kvTup[0]] = kvTup[1];
}
document.getElementById("watch7-player").innerHTML='<iframe style="width:100%;height:100%;" allowfullscreen src="/embed/' + opts['v'] + '"></iframe>';
})()
/*
Or as bookmarklet:
javascript:(function(){var%20o={};var%20t=location.search.substr(1).split("&");for(var%20i=0;i<t.length;i++){var%20v=t[i].split("=");o[v[0]]=v[1];}document.getElementById("watch7-player").innerHTML='<iframe%20style="width:100%;height:100%;"%20allowfullscreen%20src="/embed/'+o['v']+'"></iframe>';})()
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment