May 27, 2007
Firfox中有一个具有非凡功能的插件 — greasemonkey, 这个插件可以帮你做到很多你想不到的事情, 可以让你的Firefox工作的更加得心应手。我今天用它写了很简单的脚本, 体会到了它的强大能力。
在冰鱼BT(bt icefish)下载东西,总是需要从目录开始点击两次, 第一次点击会打开一个下载页面, 然后还需要再点击下载链接才会开始下载, 这样对我这种大批量下载的用户实在是不方便, 所以我就写了一个greasemonkey的脚本, 让我点击一次自动打开下载页面并自动下载。 我第一次写greasemonkey比较弱智, 就这么一个脚本, 也是东看西看看来的。 不过还是成功了, 现在我的Firefox已经可以自动下载了, 再也不需要我去再点一次了。 方便了很多。
这个就是我写的greasemonkey脚本, 很简单的一个, 不要嘲笑小弟,:)
// ==UserScript==
// @name auto download in icefish
// @namespace http://diveintogreasemonkey.org/download/
// @description auto download bt from icefish
// @include http://bt.icefish.org/icefish/*
// ==/UserScript==(function(){
var allLinks = document.links;
if (allLinks != null){
for (i = 0; i <allLinks.length; ++i){
if (allLinks [i].href.indexOf (”/download.php?url=torrents/”) > 0){
window.location.href = allLinks [i].href;
}
}
}
}
)();
greasemonkey还有很多的好脚本以及各种教程, 这里有一部分地址:
http://wiki.woodpecker.org.cn/moin/Greasemonkey
http://dunck.us/collab/GreaseMonkeyUserScriptsGeneric
http://wiki.mozcn.org/index.php/Firefox:Dive_Into_Greasemonkey
http://forums.mozine.cn/index.php?showforum=50
您喜欢本文吗?即刻订阅"偶爱偶家",精彩文章不再错过!现在就给我们留个话吗?


One response to "感受强大的greasemonkey"
http://www.6inchboot.com/
UGG boots;cheap UGG;UGG classic
[Reply]