this post was submitted on 12 Jul 2025
31 points (100.0% liked)

Firefox

5578 readers
39 users here now

A community for discussion about Mozilla Firefox.

founded 2 years ago
MODERATORS
 

I've got an HTML file on my phone, and would like to view it. But Firefox on Android has neither a menu entry "Open File", nor does using the file:// method work, nor is any app associated with the .html file extension.

BTW, Chrome suffers from the same problem. And it is not an issue with the file, it works when opened via the https:// method from my home server.

Why, oh why, can't I open a local file on Android?

top 15 comments
sorted by: hot top controversial new old
[–] Quacksalber@sh.itjust.works 15 points 2 days ago

I think it's android that won't let Firefox access the local files. Doesn't work with Fennec either

[–] muntedcrocodile@hilariouschaos.com 7 points 2 days ago (1 children)

Android file permissions. Android grants access to a specific subdirectory for each app. So u need to go to file:///somedirpath/urfile.html

U might also be able to grant full file access to ff but I would say that's a huge security risk. Alternatively u could serve the file dir with python from termux.

[–] Treczoks@lemmy.world 5 points 2 days ago (1 children)

Of course I entered the full file path, not just the method. Firefox did not recognize "file" as a method, to start with.

[–] nebulaone@lemmy.world 3 points 2 days ago (1 children)
[–] Treczoks@lemmy.world 2 points 2 days ago

You are right, it was triple slash, but it does not work anyway, as it already balks at "file".

[–] mvirts@lemmy.world 4 points 2 days ago

The Android way to do this is to open the file from some sort of file browser app and select Firefox from the list of apps that registered for that file type. Unfortunately it looks like Firefox doesn't register itself for html files.

[–] tal@lemmy.today 4 points 2 days ago

I was pretty irritated when I noticed that myself. I'm guessing that there's some form of attack or class of attacks that this is designed to avoid (e.g. IIRC a webpage opened from a file:// URL can have Javascript access files via file:// as well, and I imagine theoretically could upload them somewhere or something), but it sure is goddamn obnoxious.

My guess is that you can probably fire up a local HTTP server on your phone and view it via that. I don't think that Android phones set up a firewall by default, so have it listen on a loopback address, like 127.0.0.1.

Based on this, you can use a file manager to share the HTML file with Firefox.

[–] Darkassassin07@lemmy.ca 3 points 2 days ago* (last edited 2 days ago) (1 children)

It's clunky, but I can open files in firefox by using a file browser app (I use x-plore), selecting 'open with', then selecting firefox. Sometimes it's not in the list, but there's a selector for what type of file (text, video, audio, '*'). '*' lists all the apps.

Sometimes stuff still refuses to open, but things like pdfs and html files usually work

[–] Treczoks@lemmy.world 1 points 2 days ago (3 children)

OK, my file browser does not offer this option.

[–] LifeInMultipleChoice@lemmy.world 2 points 2 days ago* (last edited 2 days ago)

In case you end up looking for other file explorers, this one has treated me well: https://github.com/Raival-e/File-Explorer-Compose?tab=readme-ov-file

(And has the ability to open with, then change from browsers to any app type so you can locate Firefox)

[–] SatyrSack 1 points 2 days ago* (last edited 2 days ago) (1 children)

I can do this with Amaze File Manager, just not with any of the various Firefox forks that I have installed, no matter which option I choose under "Open As". Vanadium (a Chrome fork) was an option when I tried to open as a text file. Using a file named test.html that is saved in my Download directory, this was the URL in Vanadium:

content://com.amaze.filemanager/storage_root/storage/emulated/0/Download/test.html

[–] Treczoks@lemmy.world 1 points 2 days ago

Yes, I am well aware that filenames under android are horribly convoluted. From a certain viewpoint, they probably make sense.

[–] DarkSirrush@lemmy.ca 1 points 2 days ago (1 children)

Try using the share option, and choose firefox?

[–] Treczoks@lemmy.world 1 points 2 days ago

Can't choose Firefox from share, sorry.

[–] SatoruToru@sh.itjust.works 2 points 2 days ago

I personaly use this extension if i need to open html