title: chrome.storage.local.get and set
body: <p>I'm trying to use <code>chrome.storage.local</code> in my extension, and it doesn't seem to work. I used <code>localStorage</code> but realized that I can't use it in content scripts over multiple pages.</p>
  
  <p>So, this is what I've come up with:</p>
  
  <pre><code>function save()
  {
      var channels = $("#channels").val();
      var keywords = $("#keywords").val();
  
      chrome.storage.local.set({'channels': channels});
      chrome.storage.local.set({'keywords': keywords});
  }
  </code></pre>
  
  <p>I do believe I'm doing the <code>save()</code> right, but the problem comes up in <code>load()</code>:</p>
  
  <pre><code>function load()
  {
      var channels = "";
      chrome.storage.local.get('channels', function(result){
          channels = result;
          alert(result);
      });
  
      var keywords = "";
      chrome.storage.local.get('keywords', function(result){
          keywords = result;
          alert(result);
      });
  
      $("#channels").val(channels);
      $("#keywords").val(keywords);
  }
  </code></pre>
  
  <p>When the alerts trigger, it prints out <code>[object Object]</code>. Why is that? What am I doing wrong? I looked at the documentation/examples, but I can't seem to pinpoint the problem.</p>