Skip to content

Instantly share code, notes, and snippets.

@ayosec
Created July 2, 2011 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayosec/1060792 to your computer and use it in GitHub Desktop.
Save ayosec/1060792 to your computer and use it in GitHub Desktop.
Create a button to pop-up the youtube video
/*
* Copy this in ~/.js/youtube.com.js
* Tested with dotjs for Firefox: https://addons.mozilla.org/en-US/firefox/addon/dotjs/
*/
if(m = /v=(\w+)/.exec(location.href)) {
$("<button>").
text("Open").
css("position", "fixed").
css("top", "1em").
css("left", "1em").
css("padding", "0.5em").
css("border-radius", "0.5em").
css("border", "1px outset #333").
css("font-size", "200%").
css("background", "-moz-linear-gradient(top, #777, #ccc)").
click(function() { window.open("http://www.youtube.com/embed/" + m[1], "_blank", "menubar=no"); }).
appendTo(document.body);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment