Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skype URIs not working under HTTPS on Chrome, iPad, iPhone

I'm attempting to use the Skype javascript API and noticing some craziness: If my page is HTTP, everything works fine (all the skype buttons, and skype: protocol hrefs) but once I move it to HTTPS it breaks in Chrome, iPad, and iPhone. Case and point:

Call buttons work here: http://developer.skype.com/skype-uris/skype-uri-tutorial-webpages#uriTJS_Generator

Call buttons DO NOT work here: https://developer.skype.com/skype-uris/skype-uri-tutorial-webpages#uriTJS_Generator

This is on their own site and it's no workie...

Can anyone suggest some series of rain dances I should do to fix this? Praying to the Skype gods? I'm only a mere mortal.

like image 796
Devin McQueeney Avatar asked Oct 26 '13 12:10

Devin McQueeney


People also ask

What is URI Skype?

Introduction to Skype URIs Skype URIs enable you to create innovative mobile, web, and desktop apps that initiate Skype calls and chats, enabling your users to reach their friends, family and businesses in a convenient yet familiar way.

Which would you use to embed a Skype URI link on your webpage?

The basic design pattern for adding Skype URIs to your web pages involves: Importing the [skype-uri. js] http://www.skypeassets.com/i/scom/js/>skype-uri.js file from http://www.skypeassets.com/i/scom/js/ into your web page. Using a div tag to mark where you want place the Skype URI on your web page.


2 Answers

On click script is creating iframe and adding src="skype:echo123;+16505550123?call" and then as mb21 said bug occurs or "restrictive security policy" happens.

function a(s, v, t) {
    var u = true;
    window.onblur = function () {
        u = false
    };
    var r = document.getElementById(v);
    if (r !== null) {
        r.src = s         //here error happens....
    }
    setTimeout(function () {
        if (u) {
            alert(Skype.installSkypeMsg);
            Skype.tryAnalyzeSkypeUri("redirect", t);
            window.location = Skype.SkypeClientDownloadUrl
        }
    }, 2000)
}

How about just using:

<a onclick="window.location='skype:echo123;+16505550123?call';return false;" href="">link</a>
like image 109
ViliusL Avatar answered Oct 04 '22 00:10

ViliusL


I think this is a bug (or a quite restrictive security policy) in Chrome (and other browsers). In the Chrome developer console I get:

[blocked] The page at https://developer.skype.com/skype-uris/skype-uri-tutorial-webpages#uriTJS_Generator ran insecure content from skype:echo123;+16505550123?call.

It treats skype:echo123;+16505550123?call as a URL and finds it not to be secure (i.e. not https) so the browser refuses to load it. Probably, the JavaScript in the Skype SDK uses window.open or something similar, so digging around in their code might bring up a solution.

Maybe you can adapt this ugly workaround?

like image 29
mb21 Avatar answered Oct 03 '22 23:10

mb21