I read the threads:
inserting-css-with-a-firefox-extension
inserting-local-css-file-with-firefox-extension
I did exacly as in:
how-can-a-firefox-extension-inject-a-local-css-file-into-a-webpage
but still I can't inject a local css file into the webpage.
my js code is:
var fileref = gBrowser.contentDocument.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", "resource://myExtension/skin/sty.css");
gBrowser.contentDocument.getElementsByTagName("head")[0].appendChild(fileref);
when I'm typing "chrome://myExtension/skin/sty.css" in the location bar in my browser I can see my css file which is quite simple:
* {color:red !important;}
but for some reason the text in the page is not turning red.
I have looked in firebug in the webpage and I saw in the head tag this:
+ <link rel="stylesheet" type="text/css" href="resource://myExtension/skin/sty.css">
but pressing on the '+' sign is not opening the css file content.
What am I missing?
Thanks!