cordova-plugin-inappbrowser: A HREF's are being ignored using WKWebView on iOS
Bug Report
Problem
What is expected to happen?
You should be able to click on an href and have it open in a new window.
What does actually happen?
Nothing. No errors but the a href link is completely ignored
Information
Using WKWebView. In config.xml I’ve added as much “allow-navigation”, “access” and “allow-intent” links as possible:
<allow-navigation href="*" /> <access origin="*" /> <access origin="//*"/> <access origin="tel:*" launch-external="yes"/> <access origin="mailto:*" launch-external="yes"/> <access origin="skype:*" launch-external="yes"/> <allow-navigation href="*" /> <allow-intent href="http://*/*" /> <allow-intent href="https://*/*" /> <allow-intent href="tel:*" /> <allow-intent href="sms:*" /> <allow-intent href="mailto:*" /> <allow-intent href="geo:*" /> <allow-intent href="skype:*" />
I force WKWebView like this:
<feature name="CDVWKWebViewEngine"> <param name="ios-package" value="CDVWKWebViewEngine" /> </feature> <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" /> <preference name="AllowBackForwardNavigationGestures" value="false" /> <preference name="Allow3DTouchLinkPreview" value="false" /> <preference name="WKWebViewOnly" value="true" /> <preference name="UseSwiftLanguageVersion" value="4" /> <preference name="SwiftVersion" value="4.2" />
Command or Code
Just build and test the app
Environment, Platform, Device
all ios devices
Version information
Cordova: Cordova Xcode 11
Checklist
- I searched for existing GitHub issues
- I updated all Cordova tooling to most recent version
- I included all the necessary information above
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 5
- Comments: 16
Commits related to this issue
- Allowing opening of certain URL schemes Source: https://github.com/apache/cordova-plugin-inappbrowser/issues/592#issuecomment-644512070 — committed to hvaughan3/cordova-plugin-inappbrowser by deleted user 4 years ago
@jtibbles @netomarchiori @RichardBoyder @harnemo After research and read blogs and all I found a solution for tel: sms: mailto: geo: links after a day like change some code in plugins/cordova-plugin-inappbrowser/src/ios/CDVWKInAppBrowser.m file.
Existing
if ([[ url scheme] isEqualToString:@"itms-appss"] || [[ url scheme] isEqualToString:@"itms-apps"]) {
Replaced with
if ([[ url scheme] isEqualToString:@"itms-appss"] || [[ url scheme] isEqualToString:@"itms-apps"] || [[ url scheme] isEqualToString:@"tel"] || [[ url scheme] isEqualToString:@"sms"] || [[ url scheme] isEqualToString:@"mailto"] || [[ url scheme] isEqualToString:@"geo"]) {
And its working 🤪 🤨 🧐 boom 😛
When will this be fixed in this repo? It looks like a viable fix was produced and incorporated into subinkrishna’s repo above, but for various reasons, it would be great if the official plugin repo could have this fix applied?
I did something similar to get it working. Your solution is probably better though 😃
Wonderful, Thank you!
Kind regards,
Carl Zetterberg
Den ons 9 dec. 2020 kl 19:50 skrev Fernando Ghisi <notifications@github.com
yes, you can algo add “whatsapp” as well as a couple other known URL schemes.