Vous pouvez utiliser cette fonction pour vérifier une fois par seconde le support du plugin et s'il est installé.
function googleEarthErrors() {
if (google.earth.isSupported()) {
alert('Google Earth Plugin is supported for this browser');
} else {
alert('Google Earth Plugin is NOT supported for this browser');
return false;
}
if (google.earth.isInstalled()) {
alert('Google Earth Plugin is installed');
} else {
alert('Google Earth Plugin is NOT installed');
setTimeout('googleEarthErrors()', 1000);
}
Il est évident que vous voulez remplacer les alertes par quelque chose de plus utile et moins ennuyeux :)
En outre, vous devriez vérifier cette réponse - How to check for presence of the google earth plugin using JavaScript?