Installing Chrome extension programmatically

偶尔善良 提交于 2019-12-05 02:46:23

问题


I know this has been asked pretty much and I read them all but couldn't find anything relevant to my problem so asking again. I have made a simple chrome extension. Also packed it as crx using chrome. I want to install it programmatically using an nsis or C++ installer.

Got some help from here http://www.chromium.org/administrators/pre-installed-extensions

But I am not sure how can I get the ID of the extension that is used. As the ID for the same extension is different on chromes on different machine's, so one script wont work. Also registry method didn't worked for me.

So whats the trick ?


回答1:


When you pack an extension, you also get a private key (in a .pem file). The extension ID is directly derived from this file (see also this answer).

After getting a private key and extension ID, you can lock the extension ID by populating the "key" field in the manifest file.

When designing an installer, keep in mind that Google is trying really hard to make it extremely difficult (if not impossible) for developers to install Chrome extensions that are not hosted in the Chrome Web store.



来源:https://stackoverflow.com/questions/20835525/installing-chrome-extension-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!