I would like to have a Chrome Extension interact with the contents of a Google Doc - specifically to add text and ideally html to a document with the click of a button in the Extension popup.
I've read that a Google Extension can 'talk' to a Google Docs Script - to gain access to the script model and its commands.
Can you hand off a string from a Chrome Extension and have a Google Docs Script take that string and then insert it into the document (at the cursor location, for instance)?
Would the user have to manually approve the script each time it was called? Or just installed once and then the process runs in the background?
A commenter gave a very helpful link to a similar need and solution for Google Sheets. But that solution (see comments below) depends on Google Sheets APis and there does not seem to be an equivalent Google Docs API.