I am building out my first Google Chrome Extension and want to create something that can read and write to the system clipboard. I am currently putting all the js in a script imported by the popup.html for the extension.
I also have permissions declared in the manifest.json for clipboard-read and clipboard-write.
I was able to write data into the clipboard, but I am unable to read from it.
I have a button on the popup.html that has an id and in the js I am getting element by id and adding a eventlistener for click that fires a function called paste which in turn invokes navigator.clipboard.readText(). From my understanding, that is supposed to prompt for permission, but it is not doing anything.
Do you know if it's okay to invoke readText from the popup.html?
If so, how would get the prompt to show up?
Thanks in advance!