How to link to chrome extension like Chrome Web St

2019-03-12 23:41发布

问题:

I'd like to self host a chrome extension on my own site but would like the install experience to be the same as on the chrome web store. Specifically, I'd like to have a "add to chrome" button which asks the user to install the extension with one more click. Currently on self hosted extensions you have to confirm the download and then confirm the install.

Here's an example of the web store: https://chrome.google.com/webstore/detail/olnconaknblgbkfgknkfmmfhhbebkekd

The only reason I'd like to self host is so that they can stay on my site while installing the extension.

I'd be perfectly fine hosting on the chrome webstore as well if that helped with the experience (i.e. a special link from my site to the chrome webstore that would start the download immediately).

Any ideas?

回答1:

Chrome webstore has special treatment, you can't reproduce it.

To save you trouble of self hosting, you can provide a direct link to crx file hosted on webstore which has the following format:

http://clients2.google.com/service/update2/crx?response=redirect&x=id%3D<EXTENSION_ID_HERE>%26uc%26lang%3Den-US&prod=chrome

Users would still need to confirm 2 times, but at least you don't have to host it and users won't leave your site.

UPDATE

Chrome 15, that was just released into stable branch, has Inline Installation, which seems like exactly what you are looking for.



回答2:

Chrome now has inline install that enables a one-click install on your site but downloading from the store.

See here for more details.



回答3:

Add something like this to your meta-data

<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/you-chrome-id">

Add this any where:

onclick="javascript:chrome.webstore.install()"