Created
October 4, 2018 13:22
-
-
Save cagartner/19fa6d39adeadc5b1b6a9159e7ea3531 to your computer and use it in GitHub Desktop.
Workaround form Problem WhatsApp Click to Chat Firefox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$whatsDefaultText = urlencode($this->__('Hello, I need help for...')); | |
$sendTo = '5547992027755'; | |
$apiUrl = 'https://web.whatsapp.com/send?phone=' . $sendTo . '&text=' . $whatsDefaultText; | |
if(preg_match('/(Chrome|CriOS)\//i',$_SERVER['HTTP_USER_AGENT']) | |
&& !preg_match('/(Aviator|ChromePlus|coc_|Dragon|Edge|Flock|Iron|Kinza|Maxthon|MxNitro|Nichrome|OPR|Perk|Rockmelt|Seznam|Sleipnir|Spark|UBrowser|Vivaldi|WebExplorer|YaBrowser)/i',$_SERVER['HTTP_USER_AGENT'])){ | |
// Browser might be Google Chrome | |
$apiUrl = 'https://wa.me/' . $sendTo . '?text=' . $whatsDefaultText; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment