0

I've used chrome.management.getAll() function in order to list all the extensions installed on my google chrome browser. However, this function returns only those extensions which I have installed from the chrome web store and not those I've loaded (the one I've created). I'm using this function with the intent to establish a communication with a second extension.

chrome.management.getAll(function(extInfos) {
    extInfos.forEach(function(ext) {
       console.log(ext.name);
 });
});
  • Aha, you mean "unpacked" ones. It should still return those! If not, file a bug. – Xan Mar 16 '15 at 13:12
  • Yes, it should return the unpacheck ones. Since, I'm not going to upload the extension to the web store unless it is not completed. –  Mar 16 '15 at 13:20
  • I cannot reproduce this! For me, `getAll()` returns unpacked extensions just fine. You should add your code where you try to enumerate extensions. – Xan Mar 16 '15 at 15:44
  • 1
    @Xan when i try to execute the script from the browser console, it does enumerate all the extensions including the unpacked ones. However, the same piece of code does return a different list when it is executed within the background of the extension! –  Mar 16 '15 at 23:05
  • please share your extension background page code. – François Beaufort Mar 18 '15 at 13:29
  • @FrançoisBeaufort I edited my post, you can check the code! –  Mar 18 '15 at 21:58
  • @Xan oops, corrected. –  Mar 18 '15 at 22:13
  • I was able to get all my "development" extensions/apps with this code in `Chrome 43.0.2334.0`. – François Beaufort Mar 19 '15 at 10:06
  • Take a look at this answer: https://stackoverflow.com/a/72544362/6666348 – Kamran Taghaddos Jun 08 '22 at 10:48

1 Answers1

0

don't you only need the id to do message passing between extensions ? check: https://developer.chrome.com/extensions/messaging#external. The id can be retrieved easily from the extensions list (just copy/paste) and it will stay the same when you publish your extension as well.

AhmadAssaf
  • 3,556
  • 5
  • 31
  • 42
  • 2
    It will NOT stay the same as you publish, unless you take [additional steps](http://stackoverflow.com/questions/21497781/how-to-change-chrome-packaged-app-id-or-why-do-we-need-key-field-in-the-manifest). For unpacked extensions, [it's a hash of the path](http://stackoverflow.com/a/26058672/934239) to extension. – Xan Mar 16 '15 at 13:14
  • A previous question for the same author explains that there can be many extensions that listen, and keeping the list of possible IDs is impractical. – Xan Mar 16 '15 at 13:16