Comment 78 for bug 133133

Currently Firefox 33 is using org.freedesktop.FileManager1 to open a filemanager. Sadly, only Nautilus implements this interface. It's not just opening a filemanager but also bidirectional communication with the caller.

https://bugzilla.opensuse.org/show_bug.cgi?id=904229#c2

Is Firefox using this bidirectional communication feature or something else, special from org.freedesktop.FileManager1 ?

If Firefox isn't using the special features of org.freedesktop.FileManager1, just change Firefox to use "xdg-open $DIRECTORY" to open a filemanager or to look up the default filemanager in:
~/.local/share/applications/mimeapps.list (has priority)
/usr/share/applications/mimeinfo.cache

If Firefox uses special features from org.freedesktop.FileManager1:
In a perfect world, Firefox should check if Nautilus is set as the default filemanager. E.g. running "xdg-mime query default inode/directory" which checks the files:
~/.local/share/applications/mimeapps.list (has priority)
/usr/share/applications/mimeinfo.cache

Alternatively, Firefox could check if DESKTOP_SESSION is set to "gnome".
I wouldn't suggest to check for DESKTOP_SESSION=KDE, because there are a lot of other desktop environments which also use other filemanagers then Nautilus.

If the results is negative (depended on which strategy was chosen), Firefox should use the default filemanager (either the on set by the system or set by the user). This can be done by running "xdg-open $DIRECTORY" or looking up the default filemanager in:
~/.local/share/applications/mimeapps.list (has priority)
/usr/share/applications/mimeinfo.cache