Is there a way to stop Microsoft Lync from detecting phone numbers in a web page, and adding its click to call icon to that phone number in Internet Explorer?
Obviously the client can disable this functionality in Internet Explorer, however I would like to disable this for all who visit a particular website, as it is not playing nicely with embedded fonts in use on the website.
To do this for Skype I would add the following meta tag into my web page's header:
<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" />
Thanks,
Peter
I was unable to get Option 2 to work. I think this is because the add-on is triggered after the page is loaded. So that got me to thinking... If I trigger this after 5 seconds of the page loading, then hide the elements. This theory proved successfull, but it hid the phone number too.
I took it a step further and rebuilt the element for the Lync Click to Call class after stripping out the phone number. My steps may be crude, but effective.
I found a useful snippet to remove the Lync Call sign here. It replaces the hyphen in the phone number with a similar looking character, and it is no longer identified as a phone number.
I have suggested an edit to option #2, but until it is approved, I'll go ahead and drop this here. The reason for user2200197's problem is that the !important tag needs to be specified because the anchor tag specifies a display value that overrides it otherwise.
I've found a few options, but none are as simple or clean as adding a META tag to the page (which Microsoft absolutely should give us as an option).
Option #1: Insert markup into your phone number
Adding something like a blank
SPAN
into the middle of a phone number is sufficient to throw off Lync's detection. This is a highly manual option, as it requires you to edit every phone number on a page. But it could be handy for disabling one or two numbers on a page, while allowing any others to be detected.Option #2: Script away the additional markup
Lync appears to format phone numbers in a very predictable way. It wraps a
SPAN
around the number using a (as far as I can tell) consistent class name, then appends anA
anchor which contains the dialing icon.Given that very unique Guid used for the classname, you can target that with your own client script and hide it or do whatever. A jQuery approach to hide all Lync icons might look like:
UPDATE! Option #2a: Style away the additional markup
Using the same technique as the script example above, you can simply style away the offending anchor tag using CSS. This should be preferable to a script-based solution.
Option #3: Use a
TEL
anchor as a preemptive strikeThere is a standardized way to markup a phone number for compatibility with VOIP/dialing programs. It uses a standard
A
anchor with atel:
protocol. This has the dual effect of not only disabling Lync's intrusive markup, but also providing better support for anything that knows how to dial a number (Skype) and mobile devices (both iOS and Android).Now Lync users can still click the link, which will prompt them to "open" it with Lync, regardless of the browser they use (I've confirmed compatibility with IE9, Firefox and Chrome). This strikes me as the best of both worlds: compatibility with users' telephony application, without trouncing all over your markup and layout.
Until Microsoft comes up with a META tag to solve these issues, we've opted for #3.
UPDATE: Incorporated the suggestion from @marsman57 for improvement to CSS option #2
I've found the following regular expressions (on this blog) which the Lync plugin seems to use:
So using
or‐
should prevent Lync from detecting the numbers.