title: bug in chrome.storage.local that seems to affect extensions only on Mac OS X?
body: <p>I am trying to set, and later request the data stored locally in an extension</p>
  
  <p>The way I am doing this is sending a request from the content script as follows</p>
  
  <pre><code>chrome.runtime.sendMessage({method: "fetchData"}, doSomething)
  </code></pre>
  
  <p>On the background page, the message is received and parsed by:</p>
  
  <pre><code>chrome.runtime.onMessage.addListener(getData);
  </code></pre>
  
  <p>where getData is a function as follows:</p>
  
  <pre><code>var getData = function(message, sender, sendResponse) {
      if (message.method == "fetchData"){
          chrome.storage.local.get('myinfo',function(items){
              console.log(items);
              if (items.myinfo){
                  sendResponse({status: items.myinfo});
              } else {
                  sendResponse({status: items.myinfo});
              }
          }); //storage.local.get
      }
      return true;
  }
  </code></pre>
  
  <p>Now the first time this is run, storage is empty, so items is an empty object {}</p>
  
  <p>Therefore, items.myinfo is undefined </p>
  
  <p>This is indeed the case when I test on my chrome installation on Linux.</p>
  
  <p>However, when running the extension on chrome on a Mac ( OS X 10.9.2 header below)...</p>
  
  <pre><code>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36 module=default version=1
  </code></pre>
  
  <p>...the background page spits up the following error:</p>
  
  <pre><code>Error in response to storage.get: TypeError: Cannot read property 'myinfo' of undefined
  </code></pre>
  
  <p>It turns out that in this instance items is undefined, not an empty object.  </p>
  
  <p>I am trying to figure out if checking for an undefined items, and then populating chrome.storage.local with some data... </p>
  
  <pre><code>storage.set({'myinfo': message.key}, function() {
      });
  </code></pre>
  
  <p>... helps resolve the issue, or if it continues to persist.</p>
  
  <p>Why is this behavior of chrome.local.storage.get different on different OS's. Am I missing something obvious?</p>