KevinnZou / compose-webview-multiplatform

WebView for JetBrains Compose Multiplatform
https://kevinnzou.github.io/compose-webview-multiplatform/
Apache License 2.0
305 stars 39 forks source link

Enhancement: More WebView & Native Code interactions. #139

Open grandleaf opened 4 weeks ago

grandleaf commented 4 weeks ago

Thank you for offering an exceptional all-in-one solution for one of the most intricate components: the WebView. I’m curious if it’s possible to incorporate the following interactions between the WebView and native code: When a user clicks a link in the WebView, a message is sent to the native code. The native code can then decide how to handle the new URL—for instance, either blocking it or taking context-specific actions. Perhaps this functionality could be added to the WebViewNavigator’s callbacks.

KevinnZou commented 3 weeks ago

@grandleaf TThank you for your suggestion! We have received a similar issue before and have already started to work on it. However, as we discussed in that issue, we encountered some strange issues and we are currently unable to solve them. I will devote more time to this issue next month, and you are also welcome to submit a PR for it. Thank you!

grandleaf commented 3 weeks ago

Thank you for your fast response. I currently found that by using a JS can workaround this issue so it should not be a blocker for me. However, a more natural implementation is always better. Thanks.