Introduction
Firefox is a popular web browser used by millions of people worldwide. When starting a URL or clicking on a link, the operating system decides which application to use to open that link. By default, Firefox may not always be the preferred choice for handling these URLs, especially when another browser is set as the default one. This article discusses changing the default application in Firefox without using command-line parameters by modifying the application.ini file.
Understanding the Problem
When Firefox is started with a parameter, it may become the default browser by overriding the system settings. However, sometimes, users might prefer to use a different browser as the default, but still, be able to open links in Firefox. Unfortunately, Firefox doesn't provide a simple user interface for this. The solution is to modify the application.ini file located within the Firefox installation directory.
What is application.ini?
The application.ini file is a Mozilla application-specific preferences file that contains various settings for configuring the application's behavior. When the Firefox profile preferences are not enough, modifications can be applied to the application.ini file.
Changing Default Application
By default, Firefox does not include any settings specifically for setting its default behavior. However, by adding a custom pref entry in the application.ini file, it is possible to change the default handling of external links.
Modifying application.ini
To modify the application.ini file, follow these steps:
- Navigate to the Firefox installation directory.
- Find the
application.inifile and open it with a text editor. - Add the following line at the end of the existing file:
Pref(@MOZILLA_APP_STARTUPDIR@/galeon.desktop);Note: In the above code block, galeon.desktop refers to the application's desktop entry file name, and you can replace it with another browser's desktop entry file.
Customizing the Desktop Entry File
After modifying the application.ini file, you need to customize the desktop entry file according to your preferred browser. The desktop entry file is typically located in the /usr/share/applications/ directory. Perform the following steps:
- Take a backup of the desktop entry file for your preferred browser.
- Open the desktop entry file, for example,
chromium.desktop, with a text editor. - Find the line starting with
Exec=and modify it to include the following:Exec="%u" Note: Replace
path_to_browser_executablewith the actual path of the browser's executable.
- The
application.iniis an application-specific preferences file used for configuring Firefox. - By adding a custom pref entry in the
application.inifile, it is possible to change the default handling of external links. - Desktop entry files need to be customized according to the user's preferred browser after modifying the
application.inifile.