GM_addStyle不起作用

时间:2009-09-01 01:52:47

标签: css greasemonkey

我正在尝试制作这个非常简单的脚本来替换google上的标题:

// ==UserScript==
// @name           Hell yeah
// @description    HELL YEAH
// @include        http://www.google.*
// ==/UserScript==
GM_addStyle("div #logo {background-image: url('http://img220.imageshack.us/img220/5676/1251559315224.jpg') !important}");

但是当我尝试使用它时没有任何反应。我做错了什么?

2 个答案:

答案 0 :(得分:12)

我认为你应该加上这个:

 // @grant    GM_addStyle

答案 1 :(得分:-5)

这就是我需要的:

document.getElementById('logo').src = 'http://img220.imageshack.us/img220/5676/1251559315224.jpg';

虽然谷歌上出现了一些奇怪的图像

相关问题