Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clickable tel protocol a tag in firefox

Tags:

html

firefox

tel

I have a pretty standard a tag for a telephone number. It works in everything except Firefox. I thought the tel protocol was standard - is there a workaround I am unaware of?

<a class="tel" href="tel:8001234567">(800) 123-4567</a>

Firefox error message:

The address wasn't understood

Firefox doesn't know how to open this address, because the protocol (tel) isn't associated with any program.

You might need to install other software to open this address.

like image 666
snakesNbronies Avatar asked Jan 15 '13 15:01

snakesNbronies


2 Answers

Firefox doesn't know a program for every protocol. The user would need to specify a program in the settings in this case. There is no server-side workaround for this, except replacing it with the unofficial callto: introduced by Skype.

like image 135
looper Avatar answered Nov 03 '22 01:11

looper


I know this is an old question, but this might help if you need a workaround:

var isFirefox = (navigator.userAgent.toLowerCase().indexOf('firefox') > -1);
var isMobile = (typeof window.orientation !== "undefined") ||
               (navigator.userAgent.indexOf('IEMobile') !== -1);

if(isFirefox && !isMobile) {
    $('a[href^="tel:"]').click(function() { return false; });
}

NOTE:

As @Peter pointed out, this code definitely disables tel: links on Firefox. I added a detection for mobile device (found here) to limit side effects, but it still disables third-party applications that could handle it on desktop.

like image 42
Tip-Sy Avatar answered Nov 03 '22 00:11

Tip-Sy