-
Notifications
You must be signed in to change notification settings - Fork 69
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
Links are not intercepted with target="_blank" on iOS #221
Comments
@adamkobor Thank you for your feedback! The reason I only intercept the mainFrame is that the |
@KevinnZou I'm a little bit confused, because the Android implementation works already differently. For example, it doesn't do the same check in advance: Line 126 in 985beb5
Android: Line 341 in ef0694c
I think the reason is that the interception works basically in a different way on Android an iOS, and none of them is actually a request interception, rather a navigation interception, XHR/image/etc requests are actually not "caught" on any platform. Based on my thorough debugging, the library will intercept requests/navigation actions in the following cases: iOS
Android
According to this, I would say that implementing the |
@KevinnZou I've updated my comment above (and also created a PR), because I found out that removing that check won't be the right solution, however handling null values there is the correct approach IMO |
@adamkobor Thanks for your contribution! I will review and release it next week! |
The problem: on iOS, if you have a link with
target="_blank"
inside your webview, it won't open by clicking on it (you have to hold your thumb on the link, then a popup will appear, where you can choose to open it), which is the default behaviour of the webview on iOS, AFAIK.That wouldn't be necessarily a problem, because it could be at least worked around by intercepting the request, and opening it in a browser, programatically, however those requests are not even intercepted on iOS (they're on Android), because of this condition:
compose-webview-multiplatform/webview/src/iosMain/kotlin/com/multiplatform/webview/web/WKNavigationDelegate.kt
Line 126 in 985beb5
I just wanted to ask if there is a reason behind this, or if it could be removed, or at least making it conditional (depending on some property from iOSWebsettings, for example)?
I would be glad to open a PR, my original idea was to introduce something like
allowNonMainFrameInterceptions
which would befalse
by default, and if it's true, then the aforementioned condition in that if could be bypassed.WDYT @KevinnZou ?
The text was updated successfully, but these errors were encountered: