title: chrome extension: Share constant variables between content.js and popup.js
body: <p>I'm using several constants that are shared between my content.js and popup.js. How can I put them in one file and share them between both? </p>
  
  <p>This does not work, global.js contains the constants</p>
  
  <pre><code>{
      "manifest_version": 2,
      "name":    "Test Extension",
      "version": "0.0",
  
      "background": {
          "persistent": false,
          "scripts": ["global.js", "background.js"]
      },
      "content_scripts": [{
          "matches": ["http://*/*", "https://*/*"],
          "js":      ["global.js", "content.js"],
          "run_at": "document_end"
      }],
      "browser_action": {
          "default_title": "Test Extension",
          "default_popup": "popup.html"
      },
      "permissions": [
        "activeTab"
      ]
  }
  </code></pre>
  
  <p>global.js</p>
  
  <pre><code>var TEST = "test"
  </code></pre>
  
  <p>content.js/popup.js:</p>
  
  <pre><code>console.log(TEST)
  </code></pre>
  
  <p>in popup.js it prints <code>TEST is not defined</code></p>