title: Writing to a Google Sheet from a Google Chrome (content) extension
body: <p>I would like to write a Chrome extension that utilises a <a href="https://developer.chrome.com/extensions/content_scripts" rel="nofollow">content script</a> that injects some JavaScript into a specific webpage, scrapes some data using CSS selectors, and finally, stores the data in a Google Sheet.</p>
  
  <p>I've written a Chrome extension (<a href="https://developer.chrome.com/extensions/content_scripts" rel="nofollow">content script</a>) that scrapes the HTML page, the area I'm unclear on is how best to insert the data to a Google Sheet. </p>
  
  <p>I started reading around the subject and pretty quickly become overwhelmed by the options available and require some clarification and guidance. </p>
  
  <p>I have identified three options. Presented at the highest level, they are:</p>
  
  <ol>
  <li>Do everything within the Chrome extension by scraping data with a content script and using an API in the background script. </li>
  <li>Perform a HTTP POST to a custom server which writes
  to the Google Sheet.</li>
  <li>Publish the sheet as a
  web-app with a Google Apps Script 'backend' and HTTP POST to that from the Chrome extension.</li>
  </ol>
  
  <p>I favour option 1, since it's self-contained. My questions are:</p>
  
  <ul>
  <li>Have exhausted the solution domain? </li>
  <li>I favour option 1, since it's
  self-contained, is there any good reason to favour options 2 or 3?</li>
  <li>Can the Google Spreadsheet API be used directly from a Chrome
  background script?</li>
  </ul>