之前了解过Chrome浏览器自定义插件,那Firefox浏览器中怎么定义插件呢?
搜索到了greasemonkey-泥猴子
试着写一个HelloWorld遇到了以下两个问题
1、JQuery的使用
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
网上搜索的方式大多是这种,可是还是不好用,还是提示“$”符不识别
最后搜索到解决方案,加入以下代码
var $ = unsafeWindow.jQuery;
这样就可以使用$("#id")的方式来使用JQuery了!
2、setTimeout不识别
greasemonkey中需要以下面的方式才能使用setTimeout
window.reloadPage=function(){ window.location.reload(); } var ints=setTimeout(reloadPage,500);
附上greasemonkey的官网地址: