Fix YouTube Embeds bookmarklet
A bookmarklet replacing oldschool Flash YouTube embeds with new iframe/HTML5-based ones. Useful if you have an HTML5 compliant browser, but no Flash. and encounter a site that is using Flash to embed YouTube.
by marcoos
HTML
<h1>Fix YouTube Embeds bookmarklet</h1>
<p>Drag this to your bookmark toolbar: <a href="javascript:(function(){var%20i,videoId,frame;embeds=document.querySelectorAll(%22embed[src^='http://www.youtube.com/v/']%22);for(i=0;i<embeds.length;i++){try{videoId=(/youtube.com\/v\/([a-zA-Z0-9]+)/).exec(embeds[i].src)[1];frame=document.createElement(%22iframe%22);frame.width=640;frame.height=385;frame.style.border=0;frame.src=%22http://www.youtube.com/embed/%22+videoId;embeds[i].parentNode.replaceChild(frame,embeds[i]);}catch(e){}}}());">FixYTembed</a></p>
<p>Source: <a target="_blank" href="https://gist.github.com/2039390">gist 2039390</a></p>
CSS
body { font-family: helvetica, arial, sans-serif; font-size: 12px; padding: 10px; }
h1 { font-size: 15px; margin-bottom: 0.5em; }