mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Use <meta> refresh instead of elinks.location method.
Instead of assigning the URI for the video to elinks.location, instead create a <meta> tag to automatically load the video. This way, the video will still be automatically loaded when the document is loaded from cache.
This commit is contained in:
parent
8391080201
commit
4fda3ba828
@ -4,10 +4,13 @@
|
|||||||
function load_google_video(cached) {
|
function load_google_video(cached) {
|
||||||
if (!cached.uri.match(/^http:\/\/video.google.com\/videoplay/))
|
if (!cached.uri.match(/^http:\/\/video.google.com\/videoplay/))
|
||||||
return true;
|
return true;
|
||||||
var re = /(<object data="\/googleplayer.swf\?videoUrl=)(.*?)(\&)/;
|
|
||||||
var uri = cached.content.match(re)[2];
|
|
||||||
|
|
||||||
if (uri) elinks.location = unescape(uri);
|
var re = /(<object data="\/googleplayer.swf\?videoUrl=)(.*?)(\&.*?<\/object>)/;
|
||||||
|
var match = cached.content.match(re);
|
||||||
|
var url = unescape(match[2]);
|
||||||
|
var meta = '<meta http-equiv="refresh" content="1; url=' + url + '" />';
|
||||||
|
|
||||||
|
cached.content = cached.content.replace(/<head>/, "<head>" + meta);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user