Say, I'm on desktop, or on Android which has no Viber application. I press it and nothing happens. A notice message ought to be shown, like "Install the Viber application!" or something like that. All I have is this:
<a href="viber://forward?text=text">Click here to share!</a>
I tried these:
<a href="whatsapp://send/?phone=62812345678&text=test" id="openWA">Send to WhatsApp</a>
<br>
<a href="viber://forward?text=paff" id="openV">Send to Viber</a>
<!-- Auto open on WebView and Firefox -->
<script>
document.querySelector('#openWA').addEventListener('click', function() {
var f = Date.now(),
j = setTimeout(function() {
if (Date.now() - f > 1250)
return;
alert('WA not installed')
}, 1e3);
});
document.querySelector('#openV').addEventListener('click', function() {
var f = Date.now(),
j = setTimeout(function() {
if (Date.now() - f > 1250)
return;
alert('VIBER not installed')
}, 1e3);
});
</script>
but it say "not installed", either it is or not.