I'm admittedly a bit new to this; I know HTML/CSS more then I know Javascript. I know enough to code an extension, but I'm having problems that I believe may be specific to Chrome. I don't want to be too specific, but as part of my extension I'd like to remove styles from all webpages.
Here's what I have:
manifest.json
{
"manifest_version": 2,
"name": "[redacted]",
"description": "[redacted]",
"version": "1.0",
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["script.js"],
"run_at": "document_start"
}
]
}
script.js
function lolxd() {
var hs = document.getElementsByTagName('style');
for (var i=0, max = hs.length; i < max; i++) {
hs[i].parentNode.removeChild(hs[i]);
}
window.onload = lolxd();
I've tried multiple different scripts, none of which have worked. Strangely the extension loads fine, but the Javascript doesn't work and I can still see styles on all webpages. Any help?