Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing the web server by WebViewAssetLoader #34

Closed
mickael-menu opened this issue Mar 6, 2020 · 0 comments
Closed

Replacing the web server by WebViewAssetLoader #34

mickael-menu opened this issue Mar 6, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@mickael-menu
Copy link
Member

@twaddington wrote:

Another thing to be aware of is that the local web server makes all the content accessible to any application running on the device.

This would be a longer term project but, it should be possible to replace the local web server with a custom WebViewAssetLoader and WebViewClient without much difficulty.

This would sandbox all the content to the running app and you wouldn't have to worry about the system killing the web server due to memory pressure.

You should be able to handle range requests on Android as of Lollipop (API 21).

 public WebResourceResponse shouldInterceptRequest (WebView view, 
                WebResourceRequest request)

The WebResourceRequest includes the request headers which should allow you to determine what range is being requested and return the appropriate content. Previously this method only indicated what URL was being requested (not very helpful).

_Originally posted by @twaddington in #245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants