3

Im trying to figure out if it is possible to get a list of all installed browser extensions using javascript

I understand it is possible on

chrom using - chrome.extension reference firefox - using Application.extensions.all

But is it possible on IE and Safari ?

lior r
  • 2,220
  • 7
  • 43
  • 80

3 Answers3

3

You can only do that from the Chrome Context (Firefox) or Background Script (Chrome). It is not possible to get the list of extensions from a webpage.

Kashif
  • 1,238
  • 10
  • 15
2

It's not possible to get a list of all the installed extension with "Chrome tabs".enter image description here you only able to get extension list view extension tabs.

Nazim Kerimbekov
  • 4,712
  • 8
  • 34
  • 58
Waleed Nasir
  • 579
  • 5
  • 9
0

Follow these steps:

Note: These steps are compatible with manifest V3 and V2

  1. Add managment permission to manifest file

    ...
    "permissions": [
       "management"
    ]
    ...
    
  2. Call to get all installed extensions list in the background.js file

    chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
        const result = detectMessageType(request, sender);
    
        // Check if result exists
        if (result) {
            result.then(response => {
                return sendResponse(response);
            });
        }
    });
    
    function detectMessageType(request, sender) {
    
        // Check background request type
        if (request && request.type) {
            switch (request.type) {
                case 'get_all_installed_extensions': {
                    return getAllInstalledExt(request.options, sender);
                }
            }
        }
    }
    
    async function getAllInstalledExt() {
        const gettingAll = chrome.management.getAll();
        return await gettingAll.then(infoArray => {
            return infoArray.filter(item => item.type === "extension").map(item => item.name);
        });
    }
    
  3. Then in your main js file of your extension app, write this to get the list of installed extensions

    chrome.runtime.sendMessage({type: 'get_all_installed_extensions'}, response => {
        console.log(response); // print the list of installed extensions
    });
    
Kamran Taghaddos
  • 452
  • 1
  • 10
  • 22