I just made an extension that does exactly this. I found that after
the user right clicks in a textarea, document.activeElement will point
to that textarea. So you just need a content script injected into all
relevant pages containing something along the lines of:
chrome.extension.onRequest.addListener(function(request) {
if (request.text)
document.activeElement.value += request.text;
});
Of course, if you want to get fancy you can use node.selectionStart
and node.selectionEnd to insert the text at the cursor, but you get
the idea.