In your content script, do the following:
On your background page, do the following:
// step 3: set up your background page HTML // and <html> <head> <script type="text/javascript"> chrome.extension.onRequest.addListener(function (msg, sender, sendResponse) { var textarea = document.getElementById("tmp-clipboard"); </script> </head> <body> <textarea id="tmp-clipboard"></textarea> </body> </html>
source share