From: Jason Woofenden Date: Sat, 19 May 2012 20:33:50 +0000 (-0400) Subject: youtube: catch another syntax for embedding X-Git-Url: https://jasonwoof.com/gitweb/?p=userscripts.git;a=commitdiff_plain;h=06671dcd183f90d57fb3a08d0fe1d7366da59e92 youtube: catch another syntax for embedding --- diff --git a/youtube-html5-hider/script.js b/youtube-html5-hider/script.js index ea43d9b..631f86d 100644 --- a/youtube-html5-hider/script.js +++ b/youtube-html5-hider/script.js @@ -29,10 +29,10 @@ var objects = document.getElementsByTagName('object'); for (var i = objects.length - 1; i >= 0; --i) { var object = objects[i]; - var match = object.data.match(/^http:\/\/www.youtube(-nocookie)?.com\/embed\/([^?]*)/) + var match = object.data.match(/^http:\/\/www.youtube(-nocookie)?.com\/(embed|v)\/([^?]*)/) if (match) { var div = document.createElement('div'); - div.innerHTML = 'YouTube: ' + match[2] + ''; + div.innerHTML = 'YouTube: ' + match[3] + ''; replace(object, div); } }