Unable to load page in asset pack
Categories
(GeckoView :: General, defect)
Tracking
(Not tracked)
People
(Reporter: thebigboss94ita, Unassigned)
Details
Attachments
(1 file)
1019 bytes,
text/plain
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0
Steps to reproduce:
android studio, geckoview-omni:105.0.20221003135607
calling "session.loadUri("resource://android/assets/index.html")" to open index.html located in an asset pack.
Actual results:
GeckoView is unable to find index.html
Expected results:
GeckoView should've found and opened index.html. I contacted the developers on Matrix and they suggested me to rise a ticket here. Here's an extract of the chat:
johndoom
:) Hello there. I'm working on a html5 game on Android. I can't figure out how to access the index page with GeckoView, since the page is in an asset pack, can anyone give me some hints? The asset pack is set to be installed with the app and indeed it worked with WebViewer. I'm using "resource://android/assets/index.html" as uri, but no good. This is the script I'm using:
nalexander:
I strongly suspect that this is a detail of the Android asset pack process. The existing resource://android URL remapping is using an old Android technique to "map the APK". Other parts of the Android ecosystem won't be remapped, and I'm not aware of any way to tell GV about the location of such assets. If you, on the Android side, can get to a file:// URL, you should be able to at least get GV to see the assets... but you then may have origin issues because file:// URLs are special. To really solve this will require a BZ ticket and some thought about GV APIs that would allow the App to register additional known locations with GV.
Comment 1•3 years ago
|
||
The severity field is not set for this bug.
:cpeterson, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 2•3 years ago
|
||
(In reply to thebigboss94ita from comment #0)
calling "session.loadUri("resource://android/assets/index.html")" to open index.html located in an asset pack.
Actual results:
GeckoView is unable to find index.html
Does GeckoView return an error message with any more details?
Fenix's Android-Components library successfully loads HTML files (for network error pages) from resource://android/assets/
. Those URIs are created here:
And then loaded here:
Comment 3•3 years ago
|
||
(In reply to thebigboss94ita from comment #0)
I tried your code in a new project in Android Studio, and it works as expected. I even used the same GV version you posted here.
Can you re-check if you correctly added the html file in the location you provided in the code?
Also, can you attach the webpage you are trying to open?
Comment 4•2 years ago
|
||
thebigboss94ita, if you can still reproduce this problem in the latest version of GV, we can reopen this bug.
Description
•