intercept request "replace a network request with a local file from apk"
Categories
(GeckoView :: General, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: ardemiranda, Unassigned)
Details
Attachments
(1 file)
14.01 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0
Steps to reproduce:
I'm trying to load something from the apk with a resource address from a server. For example a request to the address https://example.com/app/index.html is intercepted to get it from an index.html file in the apk and the request to the server is not made.
Actual results:
The issue is that I need to keep the domain "https://example.com" I can't change this address to resource://, moz-extension://, data:text/html,<data> because I'm going to fall into some block when using other features such as service-worker.
Expected results:
It is possible to perform this type of intercept request using android webview.
Two examples where this type of intercept request can be found:
https://github.com/google/webview-local-server
https://developer.android.com/reference/androidx/webkit/WebViewAssetLoader
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Comment 1•3 years ago
|
||
This feature is used by the capacitorjs project.
https://github.com/ionic-team/capacitor/blob/6a7c4e3b3a250270ac5c4b0f09da2a613ef2cf17/android/capacitor/src/main/java/com/getcapacitor/Bridge.java#L237
Updated•3 years ago
|
Description
•