title: JSON.parse returning string instead of Array
body: <p>I have a javascript Array which I am stringifying in order to store it in localstorage</p>
  
  <pre><code>console.log(request.keywords.length);
  localStorage.keywords = JSON.stringify(request.keywords);
  </code></pre>
  
  <p>where keywords is javascript array. Here <code>request.keywords.length</code> returns 12 which is number of elements in array.</p>
  
  <p>After retrieving it and parsing it back to JSON</p>
  
  <pre><code> var keywords = chrome.extension.getBackgroundPage().getItem("keywords");
      var kjos=JSON.parse(keywords);
      console.log(kjos.length);
  </code></pre>
  
  <p>The length returned is 342 which is the length of whole string. I tried getting type of object via constructor.name property, it gives me <code>string</code> instead of <code>Array</code>.</p>
  
  <p>Any ideas what is going wrong ?</p>
  
  <p><code>Snippets:
  Background.html</code></p>
  
  <pre><code> function getItem(key) {
      var value;
      log('Get Item:' + key);
      try {
        value = window.localStorage.getItem(key);
      }catch(e) {
        log("Error inside getItem() for key:" + key);
        log(e);
        value = "null";
      }
      log("Returning value: " + value);
      return value;
    }
  </code></pre>
  
  <p>/////</p>
  
  <pre><code>chrome.extension.onRequest.addListener(
    function(request, sender, sendResponse) {
  localStorage.keywords = JSON.stringify(request.keywords);
  }
  );
  </code></pre>
  
  <p>////////////
  <code>Popup.js</code></p>
  
  <pre><code>var keywords = chrome.extension.getBackgroundPage().getItem("keywords");
  
      var kjos=JSON.parse(keywords); //kjos is a string variable
  </code></pre>
  
  <p>/////
  <code>keywords.js</code></p>
  
  <pre><code>//keywordsArray is an Array object
      // Message passing to background page
          chrome.extension.sendRequest({message: "setKeywords", keywords: keywordsArray}, function() 
          {
              console.log(keywordsArray);
              console.log("message sent");
            // The data has been sent, we can close the window now.
            //window.close();
          });
  </code></pre>