How to access files via localhost in firefox browser I'm looking for a way to access my devices files in Firefox. The reason for this is I want to use an extension to read *.md file.
I know that I can use file:/// to access files, but the extension can't use this way. The only way is to use localhost. I have searched around but have only found talk about accessing the PC via localhost. I want to access the local android files.
Here is the link to the extension I want to use: Markdown Viewer
If you need localhost, than run a web server on your Android and bind it to loopback address. There are many apps on Play Store that can run a web server. I just tested out HTTP Server powered by Apache and it works fine. 

Instructions:


Install and launch it.
Grant Storage permission/access.
Download an Apache version. The latest version comes with the app and would be marked with X sign next to it. Tap on that entry once to install that version.
Afterwards, go to the section Server address &amp; port &rarr; Change:


Server Address: 127.0.0.1
Server Port: 8080 (or anything above 1024)
Fallback action: Stop

Start Server. The server's home directory is /sdcard/htdocs/public/, so move your directories under public directory. 
Setup your addon in Firefox and add http://127.0.0.1 under Allowed Origins as mentioned here.
Load your file in Firefox by using the address `http://127.0.0.1:PORT/PATH. The extension should work now.


Replace PORT with the port you used for the server. Replace PATH with the path of your directory/file relative to public directory. So, if  file is under /sdcard/htdocs/public/testing/readme.md, the PATH should be testing/readme.md.

Note: for some reason the addon sometimes load, other times it just shows a blank page when trying to load README.md.