title: How do I view file:// images from http://localhost served pages in Firefox 11?
body: <p>I've got a server running on my localhost machine (port 8080) that is trying to create IMG tags to local files.  But, the files do not appear in Firefox 11.</p>
  
  <p>I was originally create the image tag using Javascript, but since that failed I fell back to HTML to experiment with various ways of directly referencing the file.  None of the following work:</p>
  
  <pre><code>&lt;img src="file:///localhost:8080/C://Users/me/IMG_1000.JPG"&gt;
  &lt;img src="file:///localhost/C://Users/me//IMG_1000.JPG"&gt;
  &lt;img src="file:///C://Users/me/IMG_1000.JPG"&gt;
  </code></pre>
  
  <p>If I paste the last URL directly into the address bar, the image opens fine.</p>
  
  <p>I have followed the directions here:</p>
  
  <p><a href="http://kb.mozillazine.org/Firefox_:_Issues_:_Links_to_Local_Pages_Don%27t_Work" rel="nofollow">http://kb.mozillazine.org/Firefox_:_Issues_:_Links_to_Local_Pages_Don%27t_Work</a></p>
  
  <p>I have tried modifying both user.js, and prefs.js, both directly and via the about:config viewer. </p>
  
  <p>I got the correct path to the profile directory from Help -> Troubleshooting Information -> Profile Directory -> Open Containing Folder.</p>
  
  <p>The relevant lines added are:</p>
  
  <pre><code>user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
  user_pref("capability.policy.localfilelinks.sites", "localhost:8080");
  user_pref("capability.policy.policynames", "localfilelinks");
  </code></pre>
  
  <p>I originally put http:// in from of "localhost:8080", but Firefox removed that.  I also tried just "http://localhost" and "http://127.0.0.1", but those did not work either.</p>
  
  <p>BUT... strangely enough, even though I entered them from about:config and can see them in prefs.js, I cannot see them from about:config!  This makes me think that perhaps the information at mozillazine is out of date, after all it says the info is for "Firefox 1.5 and above" and I am using Firefox 11!</p>
  
  <p>Note: the reason I want to use file:// access is that I don't want to allow arbitrary access to the files on my machine.  To explain a bit more: I've got an interface to a database, and all that is required to access the database is a password.  That's fine because I want to allow database access outside my machine to anyone with the password, but the image files exist outside the database.  In order to server up the files through the server (because the files that exist are dynamic) I would need to create a new CGI that takes some kind of identifier in the database, but since the user can access the DB they could inject any filename they wanted.</p>
  
  <p>Edit: Also, I can't window.open() the file URL either.  What possible security benefit could that have?</p>