-
Notifications
You must be signed in to change notification settings - Fork 4
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
Optional network interception capability in WebView #9
Comments
I really like the idea of having extra control over first party websites. It would require some cross-platform way of associating an origin with the native/host applications. |
I see the origin of WebView has been mentioned many times. Maybe we can start with discussing the issues behind it? |
I believe my particular use case I'm interested in would fall under this Issue, but I can open a separate issue if the group feels it's different enough: In a hybrid Native/Webview app, the native app and the webview may make the exact same HTTP calls to talk to an API. A way to share those HTTP requests/responses between Native & Webview would be useful. I think an ideal case is specifying specific URLs that can be shared (with flexibility similar to proxy software) and then when the webview or Native makes an HTTP request that matches one of those URL patterns, the response can be shared by Native and Webview if either makes a subsequent request that the HTTP caching rules would result in the cached version being returned. |
In limited business scenarios, We can try to share response data. For example, the client requests static resources from the backend. Request should be idempotent. It's possible to intercept those requests with java objective-c or swift code, send those request with business network library, perform optimization logic through the business network library. 中文对照: |
I think the use case you mentioned is kind of different. It is more about the responses can be shared by Native and WebView, while the network interception is about that Native handles the resource request on behalf of WebView and the corresponding response data returned to WebView can even be different with what is received by Native from the backend server. We can further discuss in next week teleconference |
Thanks for the reply. I won't be able to attend the upcoming teleconference and I'm in the US Eastern Time Zone. I'll open a separate issue for my topic so we can discuss in there and/or at a later teleconference at a different time. |
@Token-LiMing As discussed in CG meeting 2022-05-11, please add detailed use case on network interception by 3rd party. |
English description:
Chinese description:
|
I personally think these user scenarios make sense. |
Merge with #12 and close this issue. |
@muodov This issue was closed at the request of the proposer. I think it is ok to create a new one. |
Optional network interception capability in WebView
Submitter(s)
Jiasheng Wu
Motivation
It‘s common to use WebView in Native App development. For example, some app will load one party websites for internal business, and will load third party website for other business. Apps want to intercept some internal request in WebView, to load offline resource, or just want to send request with native network framework. At the same time, third party request use WebView's networking process.
But not all WebView provide develop with optional network interception capability (WKWebView), which means the all request in WebView must use WebView's networking process.
Stakeholders
Stakeholders include:
WebView provider: Apple, Google, deciders on how to enhance WebView's networking intercept capability
WebView user: Native Business rely on WebView to send internal request, or load offline resource
End user: users of the App indirectly using the Features implemented by WebView.
Analysis
shouldInterceptRequest in Android WebView provide develop with optional network interception capability.
Related W3C deliverables and/or work items
Perhaps the specification could mandate that all WebViews must provide develop with optional network interception capability.
The text was updated successfully, but these errors were encountered: