You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/12/09 18:51:14 UTC

[GitHub] [cordova-plugin-inappbrowser] fernandoghisi edited a comment on issue #592: A HREF's are being ignored using WKWebView on iOS

fernandoghisi edited a comment on issue #592:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/592#issuecomment-741975596


   You can just use the last version of InAppBrowser (4.1.0 for now), and open the external link* using "cordova.InAppBrowser.open" instead of "window.open". Also, include the "hidden=yes", like this (it fixed some problems in iOS):
   
   `cordova.InAppBrowser.open('https://www.google.com/', '_system', 'hidden=yes,location=yes');`
   
   *It also works with "mailto", "tel", "whatsapp"... for Android, you just have to allow the intent and give permissions in config.xml file, like this:
   
   ```
   <access launch-external="yes" origin="tel:*" />
   <access launch-external="yes" origin="mailto:*" />
   <allow-intent href="tel:*" />
   <allow-intent href="sms:*" />
   ```
   
   Finally, if you want all page loads in your app to go through the InAppBrowser, you can simply hook "window.open" during initialization:
   
    ```
   $ionicPlatform.ready(function () {
     if (ionic.Platform.isWebView()) {
       window.open = cordova.InAppBrowser.open;
     }
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org