Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Chrome Extension get Selection

chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
  if (request.method == "getSelection")
    sendResponse({data: window.getSelection().toString()});
  else
    sendResponse({}); // snub them.
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Chrome #Extension #Selection
ADD COMMENT
Topic
Name
7+8 =