title: Chrome extension: Access to variables of a background.js from a popup.js
body: <p>If I'm using <a href="https://developer.chrome.com/extensions/extension.html#method-getBackgroundPage" rel="noreferrer">chrome.extension.getBackgroundPage()</a>, I can access variables of the background.js like this:</p>
  
  <p>background.js:</p>
  
  <pre><code>var transfer = 'some text';
  </code></pre>
  
  <p>popup.js:</p>
  
  <pre><code>chrome.extension.getBackgroundPage().transfer
  </code></pre>
  
  <p>But <a href="https://developer.chrome.com/extensions/extension.html#method-getBackgroundPage" rel="noreferrer">this</a> says I get only a window object (but maybe 'JavaScript' before 'window' means something...). How can I access background variables?</p>