I have strange problem on Chrome for Android with local website.
It works perfect on Firefox for Andorid, but not for Chrome.
On my site here: https://passcombo.com there is download link with a zip file.
What I do is:
- download file to local file system (not SSD! – external storage makes
- I unzip the package and go to the site in local storage using File Commander
- I open the html file with Chrome – only HTML loads, no CSS, no JS, no images, no fonts.
Looks like there is path problem with relative paths?
But firefox works!
Working alternative is Firefox, but there you need to write correct strange path: “file:///storage/emulated/0/…./…html”
Currently Chrome is mostly used on Andorid so it’s bad local sites not working :/
It doesn’t work opening with file explorer, you have to write the path in the address bar
file:///sdcard/Download... or wherever.
JS works with
Chrome on local
html file in my
The only solution I found is to:
- use firefox
- copy folder with my html/css/js to local storage
- open the site in firefox with path like: file:///storage/emulated/0/myfolder/index.html
where ‘file:///storage/emulated/0/’ is the main path to local storage, and if you copied your folder somehwre deeper then you need to change the ‘myfolder’ to /somefolder1/somesubfolder/…/ sth
Shame it’s the only way to create a web browser app for adroid.
file://localhost/sdcard/, then navigating to the file location. In spite of mention
sdcard in the address, it opens an internal storage (and my device has actual removable sdcard as well).
It is possible using a HTTP server app on your phone.
For example the SimpleHttpServer.
Set the “Document Root” in the settings of that app to the folder in which your html files reside. Start the server and you will see a local link.
Click on that link and choose the html file you want to show.
If you declared your assets relatively those assets will loaded, too.