Firefox determines which program to use to open a download based on the download's MIME type. More information on that can be found in Mozilla's online documentation.
It seems to me that when Firefox encounters a MIME type it has no configuration for, it prompts the user to open it in Gedit. Why Gedit? How can I change the default for unrecognised MIME types to gnome-open
?