title: Accessing global variables in Firefox extensions
body: <p>I'm writing a Firefox extension which takes a custom switch from the command line and sets a variable inside my <code>cmdline.js</code> in the <code>components</code> directory, we'll call the variable <code>switchDetected</code> which is a boolean. Now based upon this variable I want actions to be carried out in my <code>overlay.js</code> file in the <code>chrome/content</code> directory.
  The problem I'm having is I can't seem to be able to access the variable <code>switchDetected</code> that is declared in <code>components/cmdline.js</code> from within <code>chrome/contents/overlay.js</code>.</p>
  
  <p>I've tried numerous ways of doing this but nothing seems to work. So I'm just wondering if anyone knows how this can be achieved.</p>