Skype Toolbar Markup Injection – How to block and prevent it

Skype is a service I have a special love for. However, like all technology, sometimes it can be a little too intrusive all in the name of simplifying things for users (And making money!)

One of which can impact on a developer’s (or designer’s) life. The automatic markup injection that the browser plugin performs on phone numbers displayed on websites, to give users a two click method of making a call using the Skype service.

Take the example injection that the toolbar performs over on Microsoft’s contact page:

Skype injection on Microsoft's contact page

Skype injection on Microsoft’s contact page

Put simply, Skype is injecting Javascript into the DOM of the page when it finds what it thinks is a phone number, which highlights the number, prepends a small Skype icon, and makes the whole kit and kaboodle a nice link that fires up the Skype interface and calls said number.

Handy feature for a heavy Skype user, and they are out there.

Problem

This is hardly ideal for developers however. Especially when we already have so many browser subtleties to test for so our beautiful designs don’t break. And in some cases, when your site has systems in place to block potentially nefarious injected JavaScript from running, break it does.

Take this example from one of my client’s websites:

Silverstripe Templating stripping Skype Javascript

Silverstripe Templating stripping injected Skype JavaScript and HTML.

In this case, the templating engine has escaped the injected code, thus rendering it’s elements for the world to see. Ugly to say the least. And a feature that the client does not require either, since the last Skype logo you see there is a direct link to their Corportate Skype profile. (Which does the same thing).

Solution:

There’s a few out there, but you probably want to get going so here’s the easiest across-the-board fix: Trick Skype into thinking these aren’t phone numbers by simply breaking the Skype’s number detection using a hidden underscore within the phone number.

Original Codeblock
[code]

(0064) 9 999 9999

[/code]

New Codeblock
[code]

(0064) 9 999_ 9999

[/code]

NOTE: Obviously the above code is repeated once for each number in the example.

Viva Skype Fix

Simple Skype Fix in action

Done. Now get onto something more important.

Leave a Reply

Your email address will not be published. Required fields are marked *