title: Get page source chrome extension
body: <p>I am currently developing a Chrome extension in which I have to get the HTML source of a page. I currently use Chrome Messaging. Here is my source code :</p>
  
  <p><strong>background.js</strong></p>
  
  <pre><code>chrome.webNavigation.onComplete.addListener(function(e) {
          chrome.tabs.sendRequest(e.tabId, {
              action: 'getSource'
          }, function(r) {
              console.log(r);
          });
  });
  </code></pre>
  
  <p><strong>contentscript.js</strong></p>
  
  <pre><code>chrome.extension.onRequest.addListener(function(request, sender, callback) {
      if (request.action == 'getSource')
          callback(document.documentElement.outerHTML);
  });
  </code></pre>
  
  <p>It's pretty slow because I have to wait that every data (like image, javascript, etc.) in the page have been downloaded to get the source of the page.</p>
  
  <p>Is it another way to make something like that ? Thank you.</p>