编写脚本在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);
// --------------------------------------------------------------------
//
// 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);
相关文章推荐
- 烦人琐事--编写兼容IE和FireFox的脚本
- .NET应用架构设计―表模块模式与事务脚本模式的代码编写
- Flash:Flash Player 安全性·全屏模式安全性(闷)
- Ubuntu下编写脚本开启和关闭触摸板
- OpenWrt下编写AdHoc模式系统自启动脚本
- loadrunner http协议put模式脚本编写
- .NET应用架构设计—表模块模式与事务脚本模式的代码编写
- IE和Firefox在脚本编写上的异同
- 编写兼容IE和FireFox的脚本
- chrom和firefox全屏脚本
- rc脚本的编写,普通和daemon模式启动
- LVS集群的基本原理、LVS/NAT模式的配置、LVS/DR模式的配置、编写自动脚本检查LVS上realserver健康性
- Flash:无用户交互的Flash Player全屏模式[Good]
- 网络访问之开启经典模式(脚本)
- js 开启video全屏模式
- JavaScript开启浏览器全屏模式
- 编写Javascript脚本,不要忽视了对Firefox的兼容性
- Android 编写开启自启动的脚本服务
- Flash Player无法在Chrome42及以上版本开启Debug模式的解决办法