So, as you may have noticed I have added a lovely dynamic Skype button widget to my sidebar. Now, like any good developer/geek I decided I had best test it all out, make sure everything was working as it should. That’s where my problems started!
If you are having issues with newer version of Firefox not detecting Skype, or handling skype: links properly jump here
So on my netbook (which has become the computer of choice lately) I run Ubuntu 9.10 Karmic Koala, currently installed with Firefox 3.5.x as my browser of choice. The issues with the Skype button were apparent immediately, as IT DIDN’T WORK! – Instead, popping up a window directing me to install the latest version of Skype (I have it). After a bit of googling around it turned out the issue is with the Skype Javascript itself, shown here for reference. (This one is actually the script embedded into a PHP file for WordPress, however the premise is the same for the pure JavaScript. If you must see the actual script it is here.
Now the issue is with the
var CantDetect = ((navigator.userAgent.indexOf(‘Safari’) != -1) || (navigator.userAgent.indexOf(‘Opera’) != -1));
Section, you may note that there is no Firefox userAgent string, meaning the Script can’t validate you’re browser. Before you say it, I know, Skype should fix this themselves but hey, doesn’t seem to be high up their priorities. Anyway, simply add the Firefox userAgent string to the end of the CantDetect variable like so:
var CantDetect = ((navigator.userAgent.indexOf(‘Safari’) != -1) || (navigator.userAgent.indexOf(‘Opera’) != -1)); || (navigator.userAgent.indexOf(‘Firefox’) != -1));
** UPDATE – Mon 26th Oct 18:00 **
After testing this out on another machine, specifically Windows 7 running Firefox 3.5.x this now brings up another issue. Looking into the code some more, adding the firefox useragent to the CantDetect variable basically forces the script to skip the Skype Application detection function. This then causes Firefox to return the popup about not knowing how to handle the protocol (assuming you don’t have Skype installed). I need to play with the script a bit more to get it working properly methinks.
The above fix does work, however it basically forces any browser that passes the firefox useragent to bypass the rest of the script and execute the “skype:” protocol handler directly. Not exactly what the script was designed to do. So after mulling things over at work today I figured out how to fix it. Add the “mozilla” useragent to the ActiveX Variable like so:
var activex = ((navigator.userAgent.indexOf(‘Win’) != -1) && (navigator.userAgent.indexOf(‘MSIE’) != -1) && (navigator.userAgent.indexOf(‘Mozilla’) != -1) && (parseInt(navigator.appVersion) >= 4 ));
This should fix the Skype download annoyance, now onto the next job.
So the script now successfully detects your Firefox install and continues with its job, now what? Well we need to associate the “skype:” protocol to actually do something when launched. This used to be a simple task of pointing the protocol handler to the skype-action-handler, but since this is no longer included we have to install it first.
So, grab the DBus skype-action-handler API from Evan Carroll’s website and extract.
In a console, navigate to extracted files directory and run these. You probably want to be root for the make commands:
perl Makefile.PL
make
make test
make install
Almost there. Now we need to associate the skype protocol to the action-handler within Firefox.
Type “about:config” in the url bar, continue on the error and do the following:
* Use the scroll bar to navigate to the network.protocol… section.
* Check if the network protocol section includes a network.protocol-handler.app.skype key.
* If a key exists, edit it. If no key exists, create a key by right-clicking on any key and selecting New -> String from the pull-down menu.
* Enter network.protocol-handler.app.skype as the key name.
* Enter /usr/local/bin/skype-action-handler as the key value.
The first time you click a skype: link Firefox will prompt you what to do, just select the skype-action-handler as the application and you should be good to go. One thing to note – this seems to only work whilst Skype is currently running, ie. It won’t open up Skype if its not already. I am looking into creating a bash script that will basically check for the Skype process, if found, run the skype-action-handler application, else start skype then run the app. Any suggestions on this are more than welcome.
** UPDATE – Sat 16th Jan 14:00 **
It seems with the latest versions of Firefox (Ubuntu anyway) that things have broken yet again. The skype protocol handler method mentioned above no longer works. Instead use this method (taken from Mozillazine KB) :
Firefox 3.5 specific (works without installed Gnome libraries)
- Type about:config into the address bar and press Enter.
- Right-click -> New -> Boolean -> Name: network.protocol-handler.expose.foo -> Value -> false (Replacing foo with the protocol you’re specifying)
- Next time you click a link of protocol-type foo you will be asked which application to open it with.
When asked to choose the application, select the skype-action-handler in /usr/local/bin – this will then correctly open Skype. Now the second issue seems to be Firefox no longer includes skype as an application mime-type. I am in the process of sorting this out as I write this…
** UPDATE – Sat 16th Jan 15:00 **
OK I fixed it. The code for detecting mimetypes in the Skype detection script is BAD – rather than using ;
<em><em>navigator.mimeTypes["application/x-skype"]; </em></em>
We should be using;
navigator.mimeTypes.namedItem('application/x-skype')
This solves the issue in detecting the Skype installation on a Linux machine. If you are still having issues, try this;
sudo -i
echo "application/x-skype skype" >> /etc/mime.types



hay .. the solution that you have provide did not … worked for me where as i can use the various skype link by opening the link in tabs .. well this is how it is working for me after installing skype handler ..
It sounds like your action handler in Firefox isn’t using the skype handler. Double check your settings in Firefox, and make sure you have read the latest update. If you are still having trouble come back with your specific problem and I’ll see what I can do.
navigator.mimeTypes.namedItem(‘application/x-skype’)
and it seems to work in ie7/ie8 too, meaning i can pretty much leave out that activex/vbscript bit.
good find.