以编程方式安装Chrome扩展程序 [英] Installing Chrome extension programmatically

查看:69
本文介绍了以编程方式安装Chrome扩展程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已经被问了很多,我都读了全部,但是找不到与我的问题有关的任何东西,所以再问一遍. 我做了一个简单的Chrome扩展程序.还可以使用Chrome将其打包为crx. 我想使用nsis或C ++安装程序以编程方式安装它.

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.

从此处获得一些帮助 http://www.chromium.org/administrators/pre -installed-extensions

但是我不确定如何获取所使用扩展名的ID. 由于同一扩展名的ID在不同计算机上的Chrome上不同,因此一个脚本将无法工作. 注册表方法也对我不起作用.

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.

那有什么窍门?

推荐答案

打包扩展时,还会获得一个私钥(在.pem文件中).扩展名ID直接来自此文件(另请参见此答案 ).

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).

获取私钥和​​扩展ID后,您可以通过填充 "key" 字段.

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

在设计安装程序时,请记住 Google真的在努力,使开发人员很难(如果不是不可能的话)安装Chrome网上应用店未托管的Chrome扩展程序.

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.

这篇关于以编程方式安装Chrome扩展程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆