I am injecting some html + css into every page from my firefox plugin. But this styles is sometimes getting overridden by the style sheet. I want to stop this behavior.
I know this can be solved by some css tricks. Adding !important for instance. But is there a way available in firefox or xul to do this easily?
Using
!importantalone is not enough, the webpage could do the same and still override your styls. You can use the Stylesheet Service to register a user stylesheet. If you then use!importantthen web pages will no longer be able to override your styles.Note that user stylesheets are always global and apply to all webpages as well as browser’s own XUL documents. You can restrict them to particular webpages using @-moz-document.