How to open .java file as text in firefox instead of downloading it?
I trying to view file content in http://jogamp.org/jogl-demos/src/jbullet/src/javabullet/dynamics/ page Which mime type i should write in mimeTypes.rdf to open file internally in firefox instead of downloading it? I've tried those lines, but it does not work:
<RDF:Description RDF:about="urn:mimetype:handler:text/plain" NC:fileExtensions="java" NC:handleInternal="true" NC:description="исходный код Java"/>
Firefox version 39.0, OS Ubuntu 14.04.02
All Replies (6)
Try this extension:
- Open in Browser: https://addons.mozilla.org/firefox/addon/open-in-browser/
Extension is perfect, thank you. But is there way to do such things by editing mimeTypes.rdf or another way without extensions?
You can open a file in a Firefox tab via the location/address bar by prefixing the link with the view-source: protocol. So you would have to right-click and use "Copy Link Location" instead of left-clicking the link to copy the link to the clipboard.
Yes, but question is how to make Firefox open text/x-java or another specified mime type internally as plain text.
That is not possible in case the server is sending the file with a MIME type that makes Firefox showing the open with dialog. If you get the dialog then the only way to open the file in Firefox is an extension or using the view-source: protocol. If Firefox was able to open the file then you wouldn't get the open with dialog.
So, mime types 'text/plain' and 'text/html' is hardcoded and I can't tell Firefox to open 'text/x-java' as text? mimeTypes.rdf does not provide that functionality?