Bug 765: use load_uri to load the old tab's document to avoid crash
[elinks/miciah.git] / contrib / smjs / google_video.js
blob047da3ad8150c85cb9e894bf0906b74b816bbb8a
1 /* Play videos at video.google.com with minimal niggling. Just follow the link
2  * from the front page or the search page, and the video will automatically
3  * be loaded. */
4 function load_google_video(cached, vs) {
5         if (!cached.uri.match(/^http:\/\/video.google.com\/videoplay/))
6                 return true;
8         var re = /(?:videoUrl(?:\\u003d|=))(.*?)\&/;
9         var match = cached.content.match(re);
10         var url = unescape(match[1]);
11         var meta = '<meta http-equiv="refresh" content="1; url=' + url + '" />';
13         cached.content = cached.content.replace(/<head>/, "<head>" + meta);
15         return true;
17 elinks.preformat_html_hooks.push(load_google_video);