Deze pagina is nog niet vertaald en wordt daarom in het Engels getoond.

How to open an HTML file in Firefox on a computer, Android, or iPhone

Quick answer

On a computer, open Firefox and press Ctrl + O (Cmd + O on a Mac), the shortcut for File > Open File, or run firefox page.html in a terminal. On Android and iPhone, Firefox has no sure way in from the Files app: open the file in an HTML viewer in Firefox, or put the page at a link.

Get a link for my HTML file

Free plan: no credit card, 1 published page.

On this page

You want an .html file to run in Firefox: a page ChatGPT or Claude made, a project you're building, or a file someone sent you. This guide covers the Firefox part: the menu, the shortcut, the command line, the default app, and what Firefox on Android or an iPhone can do. For everything else about one device, see the guides for Windows, Mac, Android, and iPhone. For other browsers, see Edge, Chrome, and Safari.

Sending a file you made? The upload box at the top of this page turns it into a preview link without an account. That preview runs no scripts, so a quiz or game won't respond there. Click Keep this page — free, no card and sign up, and the page moves into your account, where its scripts run and you can publish it.

Open an HTML file in Firefox on a computer in 3 steps

These steps come from Firefox's own files and from Microsoft's and Apple's help pages, read on November 5, 2026. We read the menu label and its shortcut in the files of Firefox 157, Playwright's test build, and ran the command line below with it. We didn't try the menu, Open with, or the default-app steps on a Windows PC, or with Firefox installed on a Mac.

1. Press Ctrl + O in Firefox

Open Firefox, press Ctrl + O, or Cmd + O on a Mac, and choose the file. In Firefox 157's own files, that shortcut belongs to File > Open File…. Firefox's source code sets the shortcut key to Command on a Mac and to Ctrl everywhere else. The page opens at an address that starts with file:///, the address of a file on your own disk.

2. Or choose Open with, then Firefox

  • Windows. Microsoft's steps: "Right-click the file and select Open with > Choose another app to see a list of apps on your computer." Pick Firefox.
  • Mac. Apple's steps: "Control-click the file, choose Open With, then choose an app." Pick Firefox. Apple also lists "Drag the file onto the app icon in the Finder or the Dock."

Pick it for this one file. Unless you tell your computer to always use Firefox, the next double-click still uses the app set for .html files.

3. Make Firefox the app for .html files

  • Windows. Open Settings, select Apps > Default apps, and, in Microsoft's words, "type the file extension or protocol you wish to change" in the search bar. Type .html, select the result, and choose Firefox. Do the same for .htm. The Windows guide has the rest of the Windows side.
  • Mac. Apple's steps: select the file, choose File > Get Info, and under Open with, "Click the pop-up menu, choose an app, then click Change All."

Firefox also offers to become your default browser. Firefox 157's files give its settings a Make default button and the line "Psst, Firefox isn't your default.", and on a Mac the Firefox menu has Set Firefox as Default Browser. We didn't test whether either one changes the app for .html files, so check that afterwards.

From the command line

Mozilla's documentation of Firefox's command line says a URL given on its own is opened as if with -url <url>: "This is the parameter implicitly used when a bare URL is passed on the command line." It also lists --new-tab <url> ("Open in a new tab"), --new-window <url>, and --private-window, and says firefox --help prints the current list.

Linux. In a terminal, in the file's folder:

firefox page.html
firefox --new-tab page.html

On November 5, 2026, we ran Firefox 157's own program, from Playwright's test build, on our Mac (macOS 27.2), from the folder of a test page, headless and with a throwaway profile. Both lines opened the page at its file:/// address, and the script inside it ran. This guide's test didn't run on Linux or Windows, or with Firefox installed from Mozilla. On Ubuntu 26.04.1, our Linux guide found that Firefox, a snap there, couldn't open a file in /tmp.

Mac. In Terminal, in the file's folder:

open -a Firefox page.html

macOS's manual for open says -a "Specifies the application to use for opening the file". We didn't test this line: Firefox isn't installed on our Mac.

Windows. In Command Prompt, in the file's folder:

start firefox page.html

Microsoft's page for start says it "searches for a specified executable file", and Mozilla's documentation names Firefox's program firefox.exe. We didn't test it on Windows.

On Android

Tapping an .html file in the Files app may not offer Firefox at all. Firefox for Android's app manifest, in Mozilla's source code, lists Firefox as an app for web pages only at http and https addresses. The one kind of file on the phone it lists itself for is a PDF. We didn't test Firefox for Android, on a phone or in an emulator.

In our Android 16 emulator test of October 21 and 22, 2026, the Files app's Open with listed Chrome and HTML Viewer, and Chrome ran the whole page. Firefox wasn't installed on that emulator. The Android guide has that test.

To run the page in Firefox anyway, open the free HTML viewer in Firefox and tap Choose an .html file. The file isn't uploaded. On November 5, 2026, the viewer ran a test page's script in Firefox 157 on a computer, and its button counted 3 clicks out of 3. We didn't test it in Firefox for Android: the Android guide tested it in Chrome. For a file you weren't expecting, ask the sender first, and turn off Run scripts before you choose it.

On an iPhone or iPad

Firefox on an iPhone or iPad doesn't run Mozilla's own engine. Mozilla's documentation says: "Firefox iOS is built natively for iOS, and doesn't use Gecko. Due to Apple's restrictions for browsers on iOS, WKWebKit is how users will interact with the web." Apple's App Review Guidelines say: "Apps that browse the web must use the appropriate WebKit framework and WebKit JavaScript", and offer entitlements for other engines in the EU and Japan.

The Files app may not hand the file to Firefox either. Firefox for iOS's Info.plist, in Mozilla's source code, declares no document types it opens, and the only web addresses it registers are http and https. Apple says: "If you haven't installed the app that created a file, a preview of the file opens in Quick Look." In our iOS 26.3 Simulator test of October 6, 2026, that preview ran no JavaScript, and in our iPadOS 26.5 test of October 24, Open With said "No Apps Available". Firefox wasn't installed on either simulator, and we didn't test Firefox for iOS.

Open the HTML viewer in Firefox and tap Choose an .html file, or open a link to the published page. We tested the viewer in Safari on an iPad Simulator, not in Firefox for iOS. The iPhone guide and the iPad guide have the full tests.

Works in Chrome, but not in Firefox?

A page opened from your disk has a file:/// address, and Firefox blocks some of what it loads there. On November 5, 2026, we opened a test page from disk in Firefox 157, Playwright's test build, headless, on a Mac with macOS 27.2. Playwright's build turns off a Firefox setting for local files, so we set it back to Firefox's own default for the first column. Then we served the same folder from the Mac.

In the test pageFirefox 157, from file:///The same, with that setting offSame page from a local server
A script written inside the fileRanRanRan
style.css and photo.png in the same folderLoadedLoadedLoaded
classic.js in the same folder, loaded with <script src="classic.js">RanRanRan
game.js in the same folder, loaded with <script type="module" src="./game.js">Didn't runRanRan
fetch("data.json"), or an XMLHttpRequest, for a file in the same folderFailed, with "TypeError: NetworkError when attempting to fetch resource."LoadedLoaded
fetch("sub/data.json") for a file in a subfolderFailedLoadedLoaded
A script reading frame.html from the same folder, shown in an <iframe>BlockedRead itRead it
A number saved with localStorage, then the page opened againKeptKeptKept

Firefox's console said why, for the module and each file:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///…/game.js. (Reason: CORS request not http).

In the same test, Chromium 156, the browser Chrome and Edge are built on, blocked the same 4 things, as the Edge guide shows. So if a page runs in Chrome and not in Firefox, look at the address bar first. A page at http://127.0.0.1:5500 or http://localhost was served, for example by VS Code's Live Server, and the same file opened in Firefox from file:/// wasn't. To read the error, open the Web Console: Mozilla lists Ctrl + Shift + K, or Cmd + Opt + K on a Mac.

Leave Firefox's file setting on

The setting is security.fileuri.strict_origin_policy. Firefox's source code turns it on by default and describes it as "Whether strict file origin policy is in effect." With it off, our test page read the files beside it and in its subfolder. MDN, Mozilla's reference for web developers, says some browsers "may treat files in the same directory or subdirectory as same-origin even though this has security implications". A page you downloaded could then read the other files in your Downloads folder.

Don't turn it off. Firefox's about:config page, where it lives, opens with "Proceed with Caution" and says: "Changing advanced configuration preferences can impact Firefox performance or security." It would change only your Firefox anyway, not the browser of anyone you send the file to. These fixes need no setting:

  • Ask the AI for one file. Ask the chat that made the page for one HTML file with the CSS, the JavaScript, and any data inside it.
  • Serve the folder. Run a local server in the page's folder and open http://localhost, as the Mac guide's local server fix shows. In our test, everything ran that way. For a page Codex or Claude Code made, see how to preview HTML from Codex or Claude Code.
  • Open it in the HTML viewer or publish it. The HTML viewer runs the page in a frame walled off from convika.com. Files the page points to with tags can't show there, and the viewer lists them under the page. A published page opens from an https:// address.

When Firefox won't open the file at all

  • Firefox shows the code as text. The name may really end in .txt, such as page.html.txt, with the extension hidden. The Windows guide shows how to check and rename it.
  • Ctrl + O does nothing, on a work or school computer. An administrator can turn file pickers off. Mozilla's list of Firefox policies has AllowFileSelectionDialogs: "Enable or disable file selection dialogs."
  • The page is blocked. Mozilla's WebsiteFilter policy blocks sites, and "As of Firefox 83 and Firefox ESR 78.5, file URLs are supported."

To see which policies apply, open about:policies in Firefox. In Firefox's own files, that page is titled "Enterprise Policies", and its Active tab lists the policies in effect. Don't try to get around your school's or company's settings: ask the IT team, or ask the sender for a link.

Ways to open it in Firefox, compared

Way to open itWhere it worksAddress in FirefoxModule scripts and data files beside itWho sees the page
Ctrl + O, or Cmd + O on a MacWindows, Mac, Linuxfile:///Blocked (our Firefox 157 test, with Firefox's default setting)Only you
Open with > FirefoxWindows, Macfile:///Blocked, as aboveOnly you
firefox page.htmlLinux; Firefox 157's program tested on a Macfile:///Blocked, as aboveOnly you
Tap the file in FilesAndroid, iPhone, iPadAndroid may not list Firefox; iOS opened a Quick Look preview in our test (Firefox not installed)Not loadedOnly you
HTML viewer, Choose an .html fileFirefox on a computer (tested) or a phone (not tested)A walled-off frame on the viewer's pageNot loaded; the viewer lists files named in tagsOnly you
A local serverA computer you can run one onhttp://localhostLoaded (our test)You, on that computer
A link to a published pageAny phone or computerhttps://One HTML file goes up, so fold them into the page firstEveryone with the link

A file you send arrives as a file, so the other person goes through the steps above, and on a phone, Firefox may not open it at all. A link opens the page from an https:// address in their browser, Firefox or not.

With Convika:

  1. Drop your file into the upload box at the top of this page, or paste the code. You get a preview link in seconds, without an account. It works for 3 minutes, with scripts and forms off.
  2. Click Keep this page — free, no card and sign up. The page moves into your account, and its scripts run in the dashboard preview.
  3. Click Publish page. Under Who can open this page?, choose Public and click Next. The first time, click Publish free.
  4. Copy the address under Live URL and paste it into the email or chat instead of the file.

On Free, the page is published as Public: anyone with the link can open it, and it may show up in search results and in Convika's gallery. To keep it out of both, choose Private link (Pro) under Who can open this page? when you publish. Anyone with a private link can still open it.

Convika hosts one HTML file per page, so fold any game.js or style.css into the page first. You can also start from the free HTML publishing tool, which has the same upload box. Working in VS Code? How to share an HTML file from VS Code covers the link from there.

Frequently asked questions

How do I open an HTML file in Firefox?

Open Firefox, press Ctrl + O (Cmd + O on a Mac), and choose the file: it's the shortcut for File > Open File…. Or right-click the file and choose Open with > Firefox on Windows, or Control-click it and choose Open With on a Mac. The page opens at a file:/// address.

How do I open an HTML file in Firefox from the command line?

Run firefox page.html in the file's folder, or firefox --new-tab page.html for a new tab. Mozilla's documentation says a bare URL on the command line is opened as if with -url. We tested both with Firefox 157's program on a Mac; on Linux and Windows we didn't. On a Mac with Firefox installed, open -a Firefox page.html does the same, per Apple's manual for open.

Can I open a local HTML file in Firefox on Android?

Not reliably from the Files app. Firefox for Android's manifest in Mozilla's source lists it for web pages at http and https addresses, not for .html files on the phone, so Android may not offer it. We didn't test Firefox for Android. Open an HTML viewer in Firefox and choose the file there, or open a link to the published page.

How do I open an HTML file in Firefox on iPhone?

Open an HTML viewer in Firefox and choose the file, or open a link to the published page. Tapping the file in the Files app opens a Quick Look preview, which ran no JavaScript in our iOS 26.3 test, and Firefox for iOS's Info.plist declares no document types for Files to hand it. Mozilla says Firefox for iOS uses Apple's WebKit, not Gecko. We tested the viewer in Safari, not in Firefox for iOS.

How do I make Firefox open HTML files by default?

On Windows, open Settings > Apps > Default apps, type .html in the search bar, select the result, and choose Firefox; do the same for .htm. On a Mac, select the file, choose File > Get Info, pick Firefox under Open with, and click Change All. Firefox's Make default button makes it your default browser, which we didn't test for .html files.

Why can't I open an HTML file in Firefox?

If it opens as code, the name may end in .txt. If Ctrl + O does nothing on a work computer, your organization may have turned off file pickers, and about:policies lists the policies that apply. If the page opens blank, it may load a module or a data file from its folder, which Firefox 157 blocked on a file:/// page in our test.

Why does my HTML file work in Chrome but not Firefox?

In our test, Firefox 157 and Chromium 156 blocked the same things on a page from disk: a module script, a fetch() of a file beside it, and reading a framed page. So check where each browser opened it: a page at http://localhost or http://127.0.0.1:5500 was served, and a file:/// page wasn't. Then read the error in Firefox's Web Console, Ctrl + Shift + K.

How do I let Firefox load local files?

Serve the folder and open it at http://localhost, or put everything in one HTML file. Don't turn off security.fileuri.strict_origin_policy: Firefox's about:config warns that "Changing advanced configuration preferences can impact Firefox performance or security", and in our test, with it off, a page from disk could read the files around it.

Sources

Next step

How to password protect an HTML page without code, on your own domain

JavaScript passwords sit in the page code. Put an HTML page from ChatGPT or Claude behind a server-checked password on your own domain.

Related articles

More ways to send your page

AI Skill Pod

Share AI skills with your team, the easy way

Everyone uses your team's skills in their own ChatGPT, Claude or Gemini, on any plan. Send one invite link. Free to start.

Start free on AI Skill Pod⁠

AI Skill Pod is made by the team behind Convika.

Share this article

Send a link that opens in any browser

Upload the HTML file once and publish it. The person you send it to opens the link in Firefox, or whatever browser their phone or computer uses, and the page runs with its scripts.

Get a link for my HTML file

Free plan: no credit card, 1 published page.