[Project_owners] CSS and browser windows

HJ bugs4hj at netscape.net
Wed Jan 18 14:52:43 EST 2006


Adam Judson wrote:
> I have a few browser (content) windows in my extension's xul window.
> 
> Does anyone know how to override styles picked up from
> resource://gre/res/html.css?

I think that you can use something like this:

var _nsIStyleSheetService = 
Components.classes["@mozilla.org/content/style-sheet-service;1"].getService(Components.interfaces.nsIStyleSheetService);
var _nsIIOService = 
Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
var htmlCSS = 
_nsIIOService.newURI("chrome://[chrome-name]/content/html.css", null, null);
_nsIStyleSheetService.loadAndRegisterSheet(htmlCSS, 
_nsIStyleSheetService.USER_SHEET);


More information about the Project_owners mailing list