Google Earth Discovery installs on a web page in Internet Explorer

Is it possible on a web page in Internet Explorer to determine if the Google Earth application is installed on the client machine using Javascript?

This page is part of a trusted intranet site.

Update: Detecting it by creating an ActiveX object or any IE-specific javascript is fine.

+3
source share
2 answers

I do not think this works using Javascript. I'm sure Google Earth does not install the plug-in in Internet Explorer (or any other browser, for that matter). This way you can forget Javascript.

, ActiveX. ActiveX, , , .

+2

, - html init API

<body onload="init()">
   bla bla bla 
</body>

JavaScript GE ,

function init()
{
    if (ge == null)
    {
        google.earth.createInstance("content", initCallback, failureCallback);
    }
}

finally -

function failureCallback(errorCode)
{
    if (errorCode == "ERR_CREATE_PLUGIN") {
        alert("Plugin not installed")
    } else {
        alert("Other failure loading the Google Earth Plugin: " + errorCode);
    }
}

.

MikeD

+5

Source: https://habr.com/ru/post/1717900/


All Articles