req=ReadFile(“myfile.txt”) used to work (Offlineapp.manifest) before going to PWAs with the ServiceWorker. With extraFiles containing the name of the text file upon a full deploy to the server this file can be seen in the Application/Cache Storage when running Chrome on a PC. It’s there along with all of the other picture files used by the app and those work properly when offline. Is there some other method to use for reading these cached files?
where hw is the name of the app deployed to the server.
Testing with AS sample HelloWorld with Button1 modified and property Make PWA? = True:
'MsgBox "Thanks for clicking!"
C = "version.txt"
If req.status = 200 Or req.status = 0 Then
C = req.responseText
alert("got version.txt: " & req.status & ":" & C)
alert("unable to get file")
where version.txt is in extraFiles.
Deploy to server, run the app and the correct number in version.txt is returned with Button1_onclick.
From Chrome go to consol (F12) and select Application/Cache Storage and all of the cached files are there, including version.txt.
Select Network/offline. Press Button1_onclick and req.status is 0, not 200, and req.responsText is undefined.