37

I am working on a progressive web app and it has a file input button to choose a file from the device storage. It works fine offline on chrome desktop version but the android version disables the button. I have no idea how to fix this. There are no css in the project for now just the html and the javascript code for the service worker.

Bupathi Sangeeth
  • 425
  • 3
  • 11
  • In Android browser, is the input enabled when online? – Patrick Moore Apr 19 '18 at 15:56
  • yes it is enabled – Bupathi Sangeeth Apr 19 '18 at 16:15
  • And i tried remote debugging the android browser and basically ran "document.getElementById("fileinput").disabled" and it returned false. but it is clearly disabled. No sign of disabled property in the markup either. – Bupathi Sangeeth Apr 19 '18 at 16:17
  • 7
    A sample page showing the issue would be needed for the same. @mostruash – Tarun Lalwani Apr 22 '18 at 09:57
  • I've heard about this bug (?) from multiple sources, but I did not reproduce it myself. I added the bounty so that this gets clarified. Apparently it affects ` – mostruash Apr 24 '18 at 12:12
  • Well, it has alot of upvotes. But I myself can't reproduce this problem. You really should setup a demo page / fiddle where we can try / test / reproduce it. – Red Apr 25 '18 at 21:03
  • 3
    You can try this one: https://justinwoo.github.io/purescript-web-audio-player-demo/index.html I also have this problem and now this app that I've been using for almost 1.5 years can't be used offline on my flights. If you manage to get it actually working offline, could you tell me how? I've been using normal Android 8.1.0 and this is the first version that's done this to me. – kakigoori Apr 26 '18 at 11:47
  • @kakigoori I tried your web app on chrome in android in offline mode and it works fine..!The input option is running fine. – Shobhit Apr 28 '18 at 16:41
  • Are creating an Android App in Webviews? or its just not working on Chrome for Mobiles? Please add form code – UsamaAmjad Apr 28 '18 at 23:05
  • can you check on below url if at your end its still disabled? http://html5-demos.appspot.com/static/dnd/all_types_of_import.html – mdeora Apr 29 '18 at 16:50

2 Answers2

4

I figured out what was going on with my own page -- somehow every time I hit the app in the home screen, it would go to the saved offline page from Chrome instead of trying to actually use my PWA, and those saved offline pages have their inputs disabled.

I had to go delete the saved web page from Chrome to get mine to work again.

I only noticed because I changed some text around and nothing was correctly updated.

kakigoori
  • 1,218
  • 10
  • 20
2

Your seems code is ok. So it might be the set up of the sys.

check the google tutorial https://developers.google.com/web/fundamentals/codelabs/your-first-pwapp/?hl=en#download_the_code

srttowers
  • 73
  • 8
  • This is not an answer. – Ivan Jun 27 '18 at 10:35
  • When I said the sys I meant It. Browser & SO configuration, as the Link explains. I thought It could help, but maybe is far away of the problem. – srttowers Jun 30 '18 at 16:03
  • Please read [this](https://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers) – Ivan Jun 30 '18 at 16:10