title: Detecting my own Firefox extension from a webpage
body: <p>I am trying to find an easy way to detect if my extension is installed in Firefox 3.6. This should be done from a webpage, probably using javascript.</p>
  
  <p>I've read a lot of blogs that says that I should try loading an image from my extension. Since I own the extension, and I can write the code, that seems like an unnecessary hack.</p>
  
  <p>I've also thought about setting a global variable to the web document, but I havn't been able to achieve this. I thought I would be able to write:</p>
  
  <p><code>top.window.content.document.hasMyPlugin = true</code></p>
  
  <p>but this is doesn't seem to work (hasMyPlugin is not defined). I only add this variable when visiting my domain (I have added a WebProgressListener and check the host property), so global namespace pollution shouldn't be a problem.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The way I try to access the variable is simply <code>if(hasMyPlugin)</code> or <code>if(document.hasMyPlugin)</code>... Perhaps I'm accessing it the wrong way?</p>