2008年4月6日星期日

firegestures:新的Friefox鼠标手势扩展

最近All-in-One gestures使用鼠标手势打开刚刚关闭的链接,无意中找到另外一款鼠标手势的扩展:firegestures这一款更加的轻便,而且可以自己定义脚本来扩展他的功能,使用起来和All-in-One gestures有很多相似之处,只是firegestures不能配合NextPlease工作,试了好几个脚本也没成功。google一下,发现好东西了:

方法一:
台湾的Firefox论坛有介绍:
下一页:


代码:
var browser = getBrowser();


var isLink=0;


for(i = 0; i < window._content.document.links.length; i++) {


var link = window._content.document.links[i].text.toLowerCase();


if (link.indexOf("next") > -1|| link.indexOf("下一页") > -1){


window._content.document.location = window._content.document.links[i].href;


i = window._content.document.links.length;


isLink=1;


}


}





if(isLink==0){


var w=window._content.location.href.split(new
RegExp('(\\d+)'));for(var i=w.length-1;i>=0;i--)if(w[i].match(new
RegExp('\\d+')))break;if(i>=0){var l=w[i].length;if(w[i].match(new
RegExp('^0')))w[i]=(+w[i]+1000000001).toString().substring(10-l);else
w[i]++;try{window._content.location=w.join('')}catch(ex){}}


}


isLink=0;






上一页:


代码:
var browser = getBrowser();


var isLink=0;


for(i = 0; i < window._content.document.links.length; i++) {


var link = window._content.document.links[i].text.toLowerCase();


if ((link.indexOf("previous") > -1) || (link.indexOf("prev") > -1) || (link.indexOf("上一页") > -1) )


{window._content.document.location = window._content.document.links[i].href


i = window._content.document.links.length


isLink=1}}








if(isLink==0){

var w=window._content.location.href.split(new
RegExp('(\\d+)'));for(var i=w.length-1;i>=0;i--)if(w[i].match(new
RegExp('\\d+')))break;if(i>=0){var l=w[i].length;if(w[i].match(new
RegExp('^0')))w[i]=(+w[i]+999999999).toString().substring(10-l);else
w[i]--;try{window._content.location=w.join('')}catch(ex){}}


}


isLink=0;
把这两个各自定义一个鼠标手势,基本上到所有的论坛都所向披靡了!
这儿有这款扩展的详细介绍。

-------------------方法分割线--------------------------
方法二:
有安装NextPlease!的人,不妨参考以下这篇:
Using NextPlease!

在FireGestures中自订下列Scripts:

//NextPlease
try{document.getElementById('nextPleasePopupMenu').doCommand();}catch(er){}

//PrevPlease
try{document.getElementById('prevPleasePopupMenu').doCommand();}catch(er){}

//FirstPlease
try{document.getElementById('firstPleasePopupMenu').doCommand();}catch(er){}

//LastPlease
try{document.getElementById('lastPleasePopupMenu').doCommand();}catch(er){}

-------------------------
这些可以是扔掉All-in-One gestures了!

0 评论: