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 2021/12/08 03:50:29 UTC

[GitHub] [cordova-plugin-wkwebview-engine] myarth commented on issue #147: Tel or mailto links not working on WKWebview

myarth commented on issue #147:
URL: https://github.com/apache/cordova-plugin-wkwebview-engine/issues/147#issuecomment-988473483


   > Adding this was sufficient for me to get `tel:` links working:
   > 
   > ```js
   > document.addEventListener("deviceready", function () {
   >     if (device.platform == 'iOS') {
   >         $(document).on('click', 'a[href^=mailto], a[href^=tel]', function (e) {
   >             e.preventDefault();
   >             var href = $(this).attr('href').replaceAll(' ', ''); // It doesn't like spaces in the phone number
   >             cordova.InAppBrowser.open(href, '_system');
   >         });
   >     }
   > }, false);
   > ```
   
   encodeURIComponent($(this).attr('href'))


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

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