Comment 55 for bug 133133

Revision history for this message
Daniel Hahler (blueyed) wrote :

I've tried adding the stanza for "file" proposed by Kokoko3k in comment #17:
  <RDF:Description RDF:about="urn:scheme:externalApplication:file"
      NC:prettyName="xdg-open"
      NC:path="/usr/bin/xdg-open" />
to mimeTypes.rdf in the new test user profile, without any luck.

Also, "file" does not appear in the list of applications, as mentioned in the same comment (for the new profile). It appears in my regular users profile however (but seems to apply to unknown files also).

After all, it should boil down to make Firefox call xdg-open when opening files, and folders.
I've not found the place to patch this though, but the path goes via mozilla/toolkit/mozapps/downloads/content/downloads.js:
f.reveal() gets called to show the folder, but I could not find where "reveal" is defined, nor if it goes via the catch block.
Here's the related code from the firefox source:
function showDownload(aDownload)
{
  var f = getLocalFileFromNativePathOrUrl(aDownload.getAttribute("file"));

  try {
    // Show the directory containing the file and select the file
    f.reveal();
  } catch (e) {
    // If reveal fails for some reason (e.g., it's not implemented on unix or
    // the file doesn't exist), try using the parent if we have it.
    let parent = f.parent.QueryInterface(Ci.nsILocalFile);
    if (!parent)
      return;

    try {
      // "Double click" the parent directory to show where the file should be
      parent.launch();
    } catch (e) {
      // If launch also fails (probably because it's not implemented), let the
      // OS handler try to open the parent
      openExternal(parent);
    }
  }
}