13

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.

PhoneixS
  • 10,574
  • 6
  • 57
  • 73
snakesNbronies
  • 3,619
  • 9
  • 44
  • 73
  • I'd check out this question and answers http://stackoverflow.com/questions/1164004/how-to-mark-up-phone-numbers – gotohales Jan 15 '13 at 15:27
  • Already did. Answers are old - from when (tel) wasn't as widely used supported vs (callto). The firefox-specific issue is what baffles me. Seems (tel) is very standard to me. – snakesNbronies Jan 15 '13 at 15:29
  • 1
    I wouldn't say there's anything baffling about this. Firefox simply has not implemented support for `tel`. – matthewpavkov Jan 15 '13 at 15:33
  • You don't seem to have read it very thoroughly, the question was last updated in April 2012. Why do you expect Firefox to understand the `tel:` protocol without further add-ons? – robertc Jan 15 '13 at 15:33
  • Did you see mordy's answer? It would take care of your situation and it isn't that old.. – gotohales Jan 15 '13 at 15:33
  • Yes - I saw that answer. Callto isn't the answer. Same error as tel – snakesNbronies Jan 15 '13 at 15:55

4 Answers4

7

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.

looper
  • 1,929
  • 23
  • 42
  • 1
    callto: is also giving the same error as tel: - not sure if this is specific to my version of firefox (18.0 on Ubuntu 12.10) – snakesNbronies Jan 15 '13 at 15:55
  • 1
    `tel` and `callto` simply do not work in Firefox (or any desktop browser). You have to have a third party extension/program installed to support this. Why would a desktop browser automatically have support for this anyhow? The browser cannot do anything with it unless there's software installed to handle a phone number/call. Mobile browsers are a different story. Also, Chrome doesn't do anything when I click a `tel` link (versus Firefox, which shows the page you stated in your question). – matthewpavkov Jan 15 '13 at 16:07
  • @mathewpavkov: In my version of firefox, the message differs: tel: "We don't know what that means (invalid url)" callto: "We don't know how to handle this (unknown protocol)". That's why I wrote callto:) – looper Jan 15 '13 at 16:37
2

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.

Tip-Sy
  • 810
  • 10
  • 18
  • 4
    This is a very bad suggestion, because it disables all tel: links, even when the user has an application installed that can handle those! On a desktop computer, you can use tel: links with a 3rd party application like Skype. Also, this code will disable tel: links on Firefox for phones... – Peter Feb 04 '15 at 10:22
  • You're right, it is not a good practice, just a workaround. I fixed it for Firefox on mobile phones (see my edited answer), but it still disables 3rd-party applications on desktop, indeed. – Tip-Sy Feb 16 '15 at 20:18
1

The phone link DOES work in firefox, and, if no phone app is installed, it informs you why it cannot call the number. It is not an error message, and as comments point out the "solutions" are not appropriate. I am using this hint for pc users in my responsive web site:

<a class="tel" href="tel:8001234567" 
    title="Clicking this link only works on a mobile phone">
  (800) 123-4567
</a>

While not the exact truth, it will explain to most pc users, who do not have a telephone application installed, that they should not utilize the phone number as a clickable link, while mobile users, who have no mouse, will never see the tooltip. Desktop users with a phone app will probably be used to click phone links, and also understand that the tooltip is meant for desktop users without phone app.

I did not uninstall my mail to test if the same message is shown on an anchor tag with href="mailto:...". The message is kind of general to handle any protocol that is not installed, so it sounds kind of cryptic to some users.

Roland
  • 4,619
  • 7
  • 49
  • 81
0

I hope my footnote is not outdated.

Current version of firefox copes pretty fine with the href="tel: (on Windows 10, which asks me to define the required application for the telephone call).

But:

It seems firefox has still problems with AJAX-calls following the onclick-event on the tel-link.

HTML:

<a href="tel:01234567" onclick="log_action(123,'phonecall')">anynumber</a>

Javascript (experimental):

function log_action(aid,action2){
$.getJSON('myscript_ajax.php', 
  {action: "log_action",
  actionid: aid,
  action2: action2
  })
  .done(function(data)
  {   
    console.log(data);
  })                
  .error(function(jqXHR, textStatus, errorThrown) {
    console.log("error " + textStatus);
    console.log("incoming Text " + jqXHR.responseText);
  });
}

While chrome logs the response from the php-script as expected, firefox displays the error-notice with empty text-status and response text.

Maybe the AJAX-request works fine in case a telephone IS installed, but i have none, and developing server-applications, I cannot know whether the client has, either.