1

最初のmousemove-eventで特定のクラスのすべての画像を削除する必要があるUserScriptがあります。

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;

ご協力いただきありがとうございます!

4

1 に答える 1

1

試すaddEventListener

window.addEventListener('mousemove',removeTags,false);
于 2010-03-03T10:19:14.380 に答える