I've noted that the expected way of injecting CSS into a third-party page does not seem to be working appropriately.
Relevant manifest.json portions:
"content_scripts": [
{
"matches": ["*://*.youtube.com/watch?v*"],
"css": ["css/youTubeInject.css"],
"all_frames": true,
"js": ["js/thirdParty/underscore.js", "js/thirdParty/jquery.js", "js/youTubeInject.js"]
}
]
Here I declare that I would like to inject some CSS and some JavaScript into pages which match the YouTube regex.
My JavaScript all injects fine. My CSS is not injected at all. I have triple-checked the file location and names.
The top of youTubeInject.js contains:
$(function () {
var style = document.createElement('link');
style.rel = 'stylesheet';
style.type = 'text/css';
style.href = chrome.extension.getURL('css/youTubeInject.css');
document.head.appendChild(style);
This causes my CSS to load properly and is a valid workaround for the issue.
Does anyone have any suggestions, or a bug I can track, for this issue? It'd be appreciated!