--- /dev/null
+{
+ "content_scripts": [ {
+ "exclude_globs": [ "http://youtube.com/*", "http://www.youtube.com/*" ],
+ "include_globs": [ "*" ],
+ "js": [ "script.js" ],
+ "matches": [ "http://*/*", "https://*/*" ],
+ "run_at": "document_idle"
+ } ],
+ "description": "Replace YouTube's html5 \"embedded\" videos into links",
+ "name": "YouTube html5 unembedder",
+ "version": "1.0"
+}
--- /dev/null
+// ==UserScript==
+// @name YouTube html5 unembedder
+// @namespace http://jasonwoof.com/
+// @description Replace YouTube html5 embedds with links
+// @include *
+// @exclude http://youtube.com/*
+// @exclude http://www.youtube.com/*
+// ==/UserScript==
+
+// Copyright Jason Woofenden 2012. Use as you wish (CC0)
+
+(function() {
+ var replace = function(old, replacement) {
+ old.parentNode.appendChild(replacement);
+ old.parentNode.removeChild(old);
+ }
+
+ var iframes = document.getElementsByTagName('iframe');
+ for (var i = iframes.length - 1; i >= 0; --i) {
+ var iframe = iframes[i];
+ var match = iframe.src.match(/^http:\/\/www.youtube.com\/embed\/([^?]*)/)
+ if (match) {
+ var div = document.createElement('div');
+ div.innerHTML = '<a href="http://www.youtube.com/watch?v=' + match[1] + '" style="display: block; width: 200px; height: 20px; padding: 20px; margin: 0; border: 2px dotted #f00; background: #fdd !important; text-align: center; font-size: 16px; font-weight: bold; color: #000">YouTube: ' + match[1] + '</a>';
+ replace(iframe, div);
+ }
+ }
+}());
+