[Greasemonkey] how to reset style of elements inserted by greasemonkey scripts?

paolo massa massa at itc.it
Sat Sep 3 01:01:55 EDT 2005


I wrote a greasemonkey script that insert a box (a div) into social
sites (flickr, delicious, ...) with some links to the page of the same
user on the other sites, i.e. if you are on flickr.com/photos/zephoria
you get handy links to http://del.icio.us/zephoria,
http://technorati.com/profile/zephoria, etc.
The script, Identity Burro, is available at
http://moloko.itc.it/paoloblog/archives/2005/08/29/identity_burro_making_social_sites_more_social.html

My question is the following:
I would like the box to keep the same visual appearance across all
sites (for example if the social site in which it fires has a black
background for divs I don't want my div to have a black backgroud). Do
you know if there is a way to "reset" the style of inserted HTML
elements so that they don't inherit the styles of the page they
modify? Or maybe there is a list of default CSS values that could be
"forced" into the style? something like
var resetStyle="text-decoration:
none;font-weight:normal;background:none;border:0;padding:0;margin:0;text-align:left;";
html_element.setAttribute("style",resetStyle);

I apologize if this is more a CSS-experts question but I hope that
some of you writing GM scripts has already met and solved this
problem. If this is not the case, I'll ask the question to a
CSS-experts mailing list.
Thanks anyway!
Of course, feedback about the script itself is appreciated as well!

P.


More information about the Greasemonkey mailing list