I am super new to Chrome Extensions but I am trying to make my own with some simple js and json. I currently have a script that finds all instances of the word “cave” on a page and replaces it with “cheeseburger”… don’t ask. It works fine when I search on Google for caves, all the instances of caves change to cheeseburgers. I now want it to work in google docs though. For instance, if I open a Google doc that has the word cave in it it should show up as cheeseburger. For some reason while the extension is running and working elsewhere when I open a Google doc with Word, I get this page.
Funny enough when I was trying to load the image I could click the image icon when posting the image on this answer to browse my files until I turned my extension off.
Code:
manifest.json:
{
"name": "Cave to Cheeseburger",
"version": "1.0",
"description": "Replaces the word 'cave' or 'Cave' with 'Cheeseburger' on any webpage.",
"manifest_version": 2,
"permissions": ["activeTab"],
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content.js"]
}
]
}
content.js:
document.body.innerHTML = document.body.innerHTML.replace(/cave/gi, "Cheeseburger");
Thanks in Advance!!