Sleek’s Web Extension SDK provides a convenient method to detect whether specific known browser extensions are installed and enabled in the user’s browser. This feature is helpful for optimizing compatibility, UI logic, or enabling/disable features based on other extensions.
This guide assumes that you have already integrated and initialized the SDK. If not, refer to the SDK introduction.
This detection only works if the extension is enabled. If a known extension is installed but currently disabled, it will not be detected by the SDK.

Overview

The SDK uses a content script that attempts to access a list of known Web Accessible Resources (WARs) exposed by other extensions. If any of the URLs are accessible, the corresponding extension is considered installed. This detection method is subject to browser restrictions. Make sure that you are calling the detection API from a tab and context where content scripts can execute (e.g., not from chrome://extensions or other restricted URLs).

Detecting Installed Extensions

Use the getAllKnownInstalledExtensions() method provided by the SDK to get a list of known extensions that are both installed and currently enabled in the user’s browser.
import { getWebExtensionSdkInstance } from "@sleek/web-ext-sdk";

const sdk = getWebExtensionSdkInstance();

const knownInstalledExtensions = await sdk.getAllKnownInstalledExtensions();

console.log(knownInstalledExtensions);
Each object in the returned array contains:
  • name: Name of the extension
  • id: Extension ID

Requirements and Limitations

  • The detection call must originate from a tab where content scripts are active.
  • Internal browser pages such as chrome://extensions, about:blank, or edge://settings do not support content script injection and are therefore unsupported.
  • Extension detection is based on a curated list of known extensions and their publicly accessible assets (e.g., images or scripts); only extensions with detectable resources can be identified.
  • The method only detects extensions that are currently installed and enabled.
If your use case requires detecting an extension not currently supported, please contact the Sleek team to request support for new detectable extensions.