您的位置:首页 > 其它

编写脚本在firefox里开启meitv中flash player的全屏模式

2007-11-22 20:52 375 查看
meitv.cn是我比较喜欢的一个在线视频网站。但我的 Ubuntu+firefox 里只能以标准窗口模式观看节目,flashplayer中的“全屏” 按钮完全不起作用。我很生气,于是写了我第一个Greasemonkey脚本,直接添加一个链接到flash资源文件。这样画面就可以撑足整个窗口,近似“全屏".


// --------------------------------------------------------------------


//


// This is a Greasemonkey user script.


//


// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/


// Then restart Firefox and revisit this script.


// Under Tools, there will be a new menu item to "Install User Script".


// Accept the default configuration and install.


//


// To uninstall, go to Tools/Manage User Scripts,


// select "googlecache", and click Uninstall.


//


// --------------------------------------------------------------------


//


// WHAT IT DOES:


// turn highlighted search terms into links to the next instance.


// --------------------------------------------------------------------


//


// ==UserScript==


// @name          FullScreenLink


// @namespace     http://diveintogreasemonkey.org/download/


// @description   add a 'fullscreen' link to meitv


// @include       http://www.meitv.cn/play*


// ==/UserScript==




var a,head;


var script;


var url,full_link;


var n1,n2;




head = document.getElementById('prayhead');




if(!head)...{


        return;


}




script = document.getElementsByTagName('script');




url = script[1].innerHTML;




n1 = url.indexOf('"',  0)+1;


n2 = url.indexOf('"', n1);




url = url.substring(n1, n2);




full_link = script[2].innerHTML;


n1 = full_link.indexOf("src="", 0)+5;


n2 = full_link.indexOf('"', n1);


full_link = full_link.substring(n1, n2);


full_link = eval("'"+full_link+"'");


//


a = document.createElement('a');


a.href = full_link;


a.innerHTML="全屏观赏";


//




head.appendChild(a);

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息