Chrome on android - not loading local website javascript and css Chrome on android - not loading local website javascript and css google-chrome google-chrome

Chrome on android - not loading local website javascript and css


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 Galaxy S6.


The only solution I found is to:

  1. [update 2021] use Opera (Firefox did work before recent update!)
  2. copy folder with my html/css/js to local storage(somewhere)
  3. open the sitewith path like:[current Opera] file:///storage/0000-0000/MyFolder/index.html[old in firefox ] file:///storage/emulated/0/myfolder/index.html

where 'file:///storage/0000-0000/' OR '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.


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.