Firefox often overrides system-wide file associations by treating .webm as a web content type rather than a local media file. To force Firefox to use MPV, you must configure the browser’s internal handler preferences for the specific MIME type or disable automatic downloads for that format. This guide details how to resolve this conflict on Linux, Windows, and macOS.
Understanding the Conflict Between Firefox and MPV
The core issue arises because Firefox is designed to stream video directly from the web. When you encounter a .webm file, the browser checks its internal list of known content types. Since video/webm is a standard HTML5 video format, Firefox assumes it should play the file in its built-in player or prompt you to save it locally. Even if your operating system has correctly associated .webm files with MPV via the desktop environment’s settings (such as GNOME Tweaks on Linux or Default Apps on Windows), Firefox ignores these external configurations for security and consistency reasons.
This behavior is not a bug but a feature intended to provide a seamless web browsing experience. However, for users who prefer dedicated media players like MPV for better performance, subtitle support, or hardware acceleration, this default behavior is frustrating. The solution requires intervening at the application level within Firefox rather than trying to change global system defaults.
Configuring Internal Handlers in Firefox
The most reliable method to fix this issue is to modify Firefox’s internal action preferences for the video/webm MIME type. This forces the browser to delegate the file handling to an external program instead of attempting to render it internally.
- Open Firefox and navigate to the address bar.
- Type
about:configand press Enter. Accept the risk warning if prompted. - In the search bar at the top, type
pdfjs.disabledor simply search forhandler. - Look for the preference named
browser.helperApps.neverAsk.saveToDisk. - If this preference does not exist, right-click anywhere in the list, select New, then choose String.
- Name the new string
browser.helperApps.neverAsk.saveToDisk. - Enter the value
video/webm(or append it to existing values with a comma). This tells Firefox to never ask what to do with this MIME type and always save it immediately.
Once saved, Firefox will stop trying to play .webm files in the tab. Instead, it will download them to your designated download folder. From there, your operating system’s default association will kick in, launching MPV when you double-click the file.
Alternative: Using the Handler Preferences UI
If you prefer a graphical interface over editing configuration strings, you can use the Content Type settings. Go to Settings > General > Files and Applications. Under the Applications section, scroll down to find video/webm. If it is not listed, click Show all. Change the action from "Preview in Firefox" to "Save File" or "Use other application." If you choose "Use other application," you may need to manually browse to the MPV executable.
Platform-Specific Considerations
While the Firefox configuration steps above are universal, the way your operating system handles the downloaded file varies slightly across platforms.
Linux Users
On Linux distributions using desktop environments like GNOME, KDE, or XFCE, file associations are managed by the FreeDesktop.org specification. After configuring Firefox to save the file, ensure that MPV is set as the default viewer for video/webm in your system settings. You can often do this by right-clicking a .webm file in your file manager, selecting Properties, and choosing MPV from the Open With tab. Additionally, check if xdg-mime query default video/webm returns the correct .desktop file for MPV in your terminal.
Windows Users
Windows 10 and 11 manage associations through the Settings app. Navigate to Settings > Apps > Default apps. Scroll down to Choose default apps by file type and locate .webm. Select MPV as the default. Note that some versions of Windows may group video types together; ensure that any related extensions like .mp4 or .mkv are also checked if you wish to use MPV for all media.
macOS Users
macOS uses the Finder to manage file associations. Right-click a .webm file, select Get Info, and under the Open with: section, select MPV from the dropdown menu. Click Change All... to apply this setting to all similar files. Firefox’s "Save File" action will place the file in your Downloads folder, where it will open with MPV upon double-clicking.
Verifying the Fix
To confirm that the issue is resolved, attempt to load a .webm URL in Firefox. If configured correctly, the browser should initiate a download rather than opening a video player. Once the file is saved, double-click it in your file manager. It should launch MPV immediately. If Firefox still attempts to preview the file, clear your cache and restart the browser to ensure the about:config changes have taken effect.
For more troubleshooting tips on browser-specific issues, you might find our guide on Firefox: Retry failed downloads automatically helpful for managing download errors.
Frequently Asked Questions
Why does Firefox ignore my OS file associations?
Firefox prioritizes web standards and security by handling known web content types internally. It does not query the operating system’s default applications for MIME types like video or audio to prevent potential security risks or inconsistent user experiences across different platforms.
Can I make Firefox play .webm files in MPV without downloading first?
No, Firefox cannot stream directly to an external desktop application like MPV due to sandboxing limitations. The only workaround is to let Firefox download the file and then rely on your OS to open it, or use a specialized add-on that intercepts the stream, though these are rare and often unstable.
What if I want MPV to handle all video formats?
You can add multiple MIME types to the browser.helperApps.neverAsk.saveToDisk preference in about:config. Separate each type with a comma, such as video/webm,video/mp4,video/x-matroska, to ensure Firefox saves all common video formats for external playback.
Does this affect streaming sites like YouTube?
No, this setting only applies to direct file downloads or embedded videos that trigger a download event. Streaming services like YouTube use dynamic JavaScript players that bypass the standard MIME type handler, so they will continue to play normally in the browser.
How do I revert these changes if I made a mistake?
To revert, go back to about:config and delete the custom string you created for browser.helperApps.neverAsk.saveToDisk, or remove video/webm from its value. Firefox will then return to its default behavior of prompting you or playing the file internally.