我有一个用户脚本,它应该在第一个 mousemove-event 上删除某个类的所有图像。
在编写 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;
谢谢你的帮助!