title: chrome.storage between popup and browser action window
body: <p>I'm writing a chrome extension and I want to manage all of the data/variables with chrome storage. From what I understand, I should be able to use chrome.storage across my extension. </p>
  
  <p>I want to set something in browser_action script and then access it in the window created by the background script. The HTML and JS files all have corresponding names.</p>
  
  <p>This is what I have tried with no luck:</p>
  
  <p>//manifest.json</p>
  
  <pre><code>{
    "manifest_version": 2,
  
    "name": "extension",
    "description": "my extension",
    "version": "0.1",
  
   "permissions": [
            "tabs",
            "storage"
          ],  
  
    "background": {
      "scripts": ["background.js"],
      "persistent": false
    },  
  
    "browser_action": {
      "default_icon": {
        "38": "images/icon38.png"
      },  
      "default_popup": "settings.html"
    }
  
  }
  </code></pre>
  
  <p>//background.js</p>
  
  <pre><code>chrome.windows.create({'url': chrome.extension.getURL("newPage.html"),'type': "detached_panel",'focused': true}, function(){
      //created newPage.html which has newPage.js
  }); 
  </code></pre>
  
  <p>//setting.js</p>
  
  <pre><code>document.addEventListener('DOMContentLoaded', function(){
    chrome.storage.local.set({'enabled': 'TRUE'});
  });
  </code></pre>
  
  <p>//newPage.js</p>
  
  <pre><code>chrome.storage.local.get('enabled', function(result){
    document.getElementById("myId").innerHTML += "&lt;br&gt;script loaded... and status: " + result.enabled;
  });
  </code></pre>
  
  <p>When I do this, newPage.html displays "script loaded... and status: undefined".</p>
  
  <p>Even with it being asyncronous, the storage value should be populated on running the script a second time, right?</p>
  
  <p>I may just be using this incorrectly. If that's the case, what's the correct way to set something with chrome storage to access in my new window?</p>
  
  <p>Any help would be appreciated!</p>