title: Get HTML content from tabs
body: <p>I'm totally at a loss here. I want to get html content from tabs in Chrome.</p>
  
  <p>manifest.json</p>
  
  <pre><code>{
    "manifest_version": 2,
    "name": "Test",is a test.",
    "version": "1.0",
    "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
    "background": {
        "scripts": ["main.js"],
        "persistent": false
    },
    "permissions": [
    "tabs",
    "https://www.google.com"
    ]
  }
  </code></pre>
  
  <p>main.js</p>
  
  <pre><code>var timerObj = new Timer({'interval':5000});
  
  chrome.runtime.onStartup.addListener(timerObj.start(mainF));
  
  function mainF() {
      chrome.tabs.query( {} ,function (tabs) {
      for (var i = 0; i &lt; tabs.length; i++) {
          var url = tabs[i].url;
          if (url != null) {
               console.log(tabs[i].url);
               //I want to get html source here
          }
      }
    });
  };
  
  function Timer( obj ){
  </code></pre>
  
  <p>The last line <code>function Timer( obj ){</code> is truncated for brevity. <code>console.log(tabs[i].url);</code> is there for testing. For each tab, I wish to get the html source. With that source, I'll parse for tags and other content. I've seen other resources mentioning <code>sendMessage</code> and <code>onMessage</code>, but I'm not really getting it. Many other resources refer to the deprecated <code>sendRequest</code> and <code>onRequest</code>.</p>