I am trying to copy an extension that fixes spelling errors in 1 forum.
I am trying to access the <p> with the contents of a script, but it does not change anything (using the code below):
document.addEventListener("DOMContentLoaded", function() { document.getElementsByTagName("P")[4].innerHTML = "correct_word"; });
This does not change anything when added as an extension, apparently, if I wget page and there is a script, everything works. Any thoughts?
My manifest.json file:
{ "manifest_version": 2, "name": "Extension", "description": "Description", "version": "1.0", "content_scripts": [{ "run_at": "document_end", "matches": ["http://example.com/"], "js": ["script.js"] }], "web_accessible_resources": ["Filedeleted(really).html"] }
I know that content scripts and WWW pages have different sandboxes, maybe the content script cannot access the page (and tag)?
source share