I have revived the famous Firebug extension - restored the Console functionality, and added multiplatform support. But during this I discovered that for different browsers different style sheets should be used. So I can not hardcode them in the .XUL files, but have to add programmatically - by a window script. But I can't find a way to do this.
For example:
Code: Select all
const WinUtils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils);
WinUtils.loadSheetUsingURIString("chrome://browser/content/browser.css", WinUtils.AUTHOR_SHEET);
But execution of loadSheetUsingURIString() ones more results in the error message in the console, whereas execution of removeSheet(); loadSheetUsingURIString() finishes without error messages.
Obviously, loadSheetUsingURIString() does something, but this "something" does not add the style sheet to the window.
Can anybody explain, what I am missing here. What should I do to achieve the goal?