问题
I have a chrome extension Id which I am getting from Registry (\Software\Google\Chrome\Extensions\{exID}
). I want to get the Extension name by using that Id. How to get that? I checked "Preference" file also but didn't get the relevant info in that.
I am doing this in WPF and C# so I am trying to avoid Javascript here.
回答1:
I'm currently looking at the Secure Preferences
file in the profile folder, and it contains all the data you need.
Google moved the extension data there and protected it with cryptographic hashes on Windows to fight malware, but the data you need is there unencrypted.
It's a JSON-formatted file that contains, among other things, copies of manifests of all installed extensions. Having {exID}
you will find the name at the following path of the Secure Preferences
file:
extensions.settings.{exID}.manifest.name
You will find other properties as well under the manifest
key.
How to find the file and how to parse JSON is outside the scope of this answer.
回答2:
You can get the name, description, and more about any installed extension checking its manifest.json
file, which is located inside:
<chrome-user-data>/Extensions/<extension-id>/<version>/manifest.json
To get the full path just replace the text wrapped between < and > with the following:
<chrome-user-data>
with one of the paths listed HERE, depending on your operating system.<extension-id>
with the ID of the extension you want to check.<version>
is not important, it's just the forst folder inside the extension-id folder.
来源:https://stackoverflow.com/questions/28022747/how-to-get-chrome-extension-name-and-status-by-using-extension-id-in-c-sharp