简体   繁体   中英

Recognize if google chrome extension is installed

Is there a way to determine if a specific extension is installed in Chrome with C# code?

I have only found JS options here in Stack Overflow.

I have tried to look for relevant files under %AppData% but there weren't.

Note: The requirment is to develop it with .Net 3.5.

Solved it. The problem was that the extension was loaded in developer mode from an unpacked folder. Therefore it wasn't copied to the %USERPROFILE%\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Extensions\\ directory.

So to look for an extension you have to first look in the mentioned path for manifest.json file and after that:

Load: %USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\preferences (it's a file)
Deserialize the json content.
iterate objects with "path" property.
Go to each path and open the manifest.json file

Hope it will help somebody.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM