13

Is there any way to force Firefox to use system-wide defaults, i.e. xdg-open for opening all types of files?

1

Open the Firefox menu (Click 3 horizontal bars in the Firefox menu), then click the Preferences icon. In the sidebar that appears on the left, select Applications.

If the file you are trying to open is listed there, select Always ask from the drop-down to the right of the file type. The next time you try to open the file you will be prompted for how you want the file handled. Select the correct application to use, then select Always use this program to force it in the future. If you accidentally select an application that doesn't work for the file, repeat these steps until you select a program that works with your file.

Remember, Linux uses magic numbers to determine the file type while Windows uses the file's extension. If the extension or magic number can not be used to determine the file type, you will be asked each time you attempt to open the file since Firefox will be unable to determine the correct file type.

  • 1
    Linux actually uses all three methods. XDG-compliant desktop environments associate files with MIME types and use XDG configuration to associate MIME types with how to treat them. Most file managers also use extensions to present files to the user. Magic numbers are used as last resort. – Deuxis Jun 22 '18 at 11:20
  • Thanks for the clarification - I wasn't specific about the sequence of file checking. – RdGreenlaw Jun 23 '18 at 23:42
  • The sequence itself for xdg-open and DE stuff is extension (assuming related MIME) -> MIME -> maybe magic number. I assume it's because it's faster to check the name than to request some MIME metadata, they do that only when extension is unknown or non-existent. And of course when a program designed to work on some format (like GIMP) loads a file it doesn't bother parsing the name or requesting MIME type, it checks the magic number straight away. – Deuxis Jun 25 '18 at 19:33
  • 1
    What if the application isn't in the Applications list ? – Muhammad Gelbana Jul 25 '18 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.