1
我有一個UserScript應該刪除第一個mousemove事件上的某個類的所有圖像。Greasemonkey onmousemove腳本
在寫作Greasemonkey腳本方面相當新穎,好吧,這是我的第一個腳本,我認爲這只是一些小小的缺失。
// ==UserScript==
// @name aname
// @namespace anamespace
// @description adescription
// @include http://www.google.com/search*
// @include http://www.google.com/webhp*
// @include http://www.google.com/#*
// @include http://www.google.com/
// ==/UserScript==
var removeTags = function() {
var allHTMLTags = window.document.getElementsByTagName("*");
for (i=0; i < allHTMLTags.length; i++) {
if (allHTMLTags[i].className == "l sb-l") {
allHTMLTags[i].style.display='none';
}
}
};
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = removeTags;
感謝您的幫助!
謝謝,這是快! – 2010-03-03 10:22:50
我很高興知道它的工作原理。 – YOU 2010-03-03 10:23:45