Detecting if IceViewer extension is installed – Message Passing API

The IceViewer Chrome / Edge extension implements a Message Passing API, allowing customers and developers to send external messages to the extension.

The Message Passing API can be used to determine if the IceViewer extension is installed, and running on the computer for the current user.

Please note that the extension is only allowed to receive messages from localhost

or from https://*.blackice.com since it is highly not recommended in Google Chrome extensions to receive messages from wildcard (every) domain names.

In order to send a message to the IceViewer extension, one must use the chrome.runtime API.

Please see the following JavaScript example for demonstration:

<script>

(() => {

const EXTENSION_ID = 'hinllambflhajfhffnaeplcaonpbpkgo'; // extension ID

chrome.runtime.sendMessage(EXTENSION_ID, 'version', response => {

if (!response) {

// No extension detected.

return;

}

// extension version received

alert(response.version);

});

})();

</script>

The example source code above sends a message to the extension identified by the EXTENSION_ID with “version” action name, then if the response is not null, displays the received version number in the browser.

In case the response is null, it means that the extension is not installed, or not enabled.

For a working demonstration webpage about how to exchange messages with the extension from an external webpage. You can see the demonstration, and the JavaScript on the following webpage: https://www.blackice.com/ChromeExtension/getVersion.html .