16 January 2009

Opening Python files (and other source files) "in-browser" in Firefox 3.0+

If Firefox keeps annoying you with a Download dialog box, when you drag/drop Python source files into the browser window, do the following: go to your Firefox profiles directory (for Mac OS X, it is under ~/Library/Application Support/Firefox/Profiles/xyz.default), open up the mimeTypes.rdf file and (carefully) delete all references to "x-python". After a restart, things should work fine! Sample junk found in mimeTypes.rdf (there were several of these):
  <RDF:Description RDF:about="urn:mimetype:text/x-python"
                   NC:fileExtensions="py"
                   NC:description=""
                   NC:value="text/x-python"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:text/x-python"/>
  </RDF:Description>