title: How to read the Clipboard text in google chrome extension
body: <p>I am trying to read clipboard text in Google chrome extension. As of now I have tried with tis code and it is returning me undefined.  Please help me on this.  </p>
  
  <p>In background.html my code is  </p>
  
  <pre><code>chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
   if (request.method == "getClipData")
     sendResponse({data: document.execCommand('paste')});
   else
     sendResponse({}); // snub them.
   });
  </code></pre>
  
  <p>In My content script my code is  </p>
  
  <pre><code>chrome.extension.sendRequest({method: "getClipData"}, function(response) {
     alert(response.data);
  });
  </code></pre>