How can a Firefox extension inject a local css file into a webpage? -
i'm writing firefox extension needs inject css file webpages. css file bundled extension, can access using chrome url
chrome://extensionid/content/skin/style.css
i'm trying inject css when page loaded:
var fileref = document.createelement("link"); fileref.setattribute("rel", "stylesheet"); fileref.setattribute("type", "text/css"); fileref.setattribute("href", "chrome://extensionid/content/skin/style.css"); document.getelementsbytagname("head")[0].appendchild(fileref);
however, css isn't loaded , firebug shows 'filtered chrome url' message instead of file content, when inspect link
element created. if try load css file external server, everything's fine.
is there way load css file bundled extension?
use resource:
instead of chrome:
?
Comments
Post a Comment