1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-17 01:16:16 -04:00
elinks/contrib/smjs/google_video.js
Miciah Dashiel Butler Masters 8a4a18796b Add a rewrite rule for video.google.com to automatically play videos
From the file:

   Play videos at video.google.com with minimal niggling. Just follow
   the link from the front page or the search page, and the video will
   automatically be loaded.
2006-01-25 15:36:31 +00:00

16 lines
509 B
JavaScript

/* Play videos at video.google.com with minimal niggling. Just follow the link
* from the front page or the search page, and the video will automatically
* be loaded. */
function load_google_video(cached) {
if (cached.uri.match(/^http:\/\/video.google.com\/videoplay/)) {
var re;
re = /(<object data="\/googleplayer.swf\?videoUrl=)(.*?)(\&)/;
var uri = cached.content.match(re)[2];
if (uri) elinks.location = unescape(uri);
}
return true;
}
elinks.preformat_html_hooks.push(load_google_video);