Can I inject a CSS file programmatically using a content script js file?
It is possible for me to inject the css when the js file is linked to my popup.html. The pro
It's to simple you could add to the manifest's permissions field : See web_accessible_resources
, "web_accessible_resources": [
"mystyle.css"
]
and also add this in content_scripts
"content_scripts": [
{
"matches": [""],
"css": ["mystyle.css"],
"js": ["jquery-1.10.2.min.js","content.js","my.min.js"]
}],
you also add same thing using Programmatic injection and insertCSS().
chrome.tabs.insertCSS(integer tabId, object details, function callback)