Get highlight text in current window and send it in a popup
问题 I would like to make a chrome extension that use a popup to do : select text click on the chrome extension icon get it in the popup (textarea, ...) This question was already asked here but Google did updates and the code I found is not working anymore ... selection.js chrome.extension.onRequest.addListener(function(request, sender, sendResponse) { if (request.method == "getSelection") sendResponse({data: window.getSelection().toString()}); else sendResponse({}); // snub them. }); popup.html <