Removable background image not showing when using GreaseMonkey

I am trying to use GreaseMonkey to replace the background image of a DIV on bing.com. This is a pretty simple call to GM_addstyle:

GM_addStyle(".sw_logo "
+"{background:url('http://www.kpao.org/blog/kpao-bing-logo-inverse.png') "
+"no-repeat 21px 7px transparent}");

      

However, the image is not displayed. It is clearly visible in Firebug, and when I mess with CSS in Firebug I can get it to appear. But he doesn't stay. Any thoughts on why? Maybe it's a mistake, but then maybe I'm missing something obvious. Thank you!

+2


a source to share


2 answers


I ended up working around this using the binary to base64 tool to get the ASCII stream of my image and insert it directly into the script. http://www.greywyvern.com/code/php/binary2base64



+1


a source


Something seems to override this ... maybe some JS, I don't know. I see the same problem as her classy classy.

Use this:



GM_addStyle(".sw_logo "
+"{background:url('http://www.kpao.org/blog/kpao-bing-logo-inverse.png') "
+"no-repeat 21px 7px transparent ! important;}");

      

But be aware that usage is ! important

usually not what you want, even if it works: http://www.w3.org/TR/CSS2/cascade.html#important-rules

0


a source







All Articles