How to download a CRX file from the Chrome web store for a given ID?

111,341

Solution 1

For one of my extensions I had to download other CRXs automatically knowing only extension ID. I solved this by opening the following URL:

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

this page will forward you to that https://clients2.googleusercontent.com/crx/download/ address.

I don't remember already how I came up with that URL (it was either in page source somewhere or I used network sniffer), but it has been working great for me since last December, so it looks reliable.

Solution 2

The CRX file itself can be directly downloaded from
https://clients2.google.com/service/update2/crx?response=redirect&prodversion=[PRODVERSION]&acceptformat=crx2,crx3&x=id%3D[EXTENSIONID]%26uc

  • [PRODVERSION] is the version of Chrome, which must be 31.0.1609.0 at the very least, and
  • [EXTENSIONID] is the ID of the extension

(New in 2018) acceptformat=crx2,crx3 instructs the server to also respond with extensions in the CRX3 format (instead of 204 No Content when the extension is not available as CRX2).

If the extension you're using contains OS-specific modules (e.g. NaCl), then you have to add additional parameters (os, arch, nacl_arch).

For the full logic of generating a complete CRX download URL, see the get_crx_url function in https://github.com/Rob--W/crxviewer/blob/master/src/cws_pattern.js.

This is a part of the Chrome Extension Source Viewer extension, available in the Chrome Web Store: https://chrome.google.com/webstore/detail/chrome-extension-source-v/jifpbeccnghkjeaalbbjmodiffmgedin


Note that opening the previous URL in Chrome will not trigger a download because Chrome automatically intercepts responses whose Content-Type is set to application/x-chrome-extension. If you want to programatically download the crx file in a Chrome extension, change the MIME-type to application/octet-stream (e.g. as done in src/lib/crx-to-zip.js).

Solution 3

There's this website just to do exactly that:

http://chrome-extension-downloader.com/

Solution 4

I wrote a small python script to automate that process what @serg @Rob W

https://gist.github.com/arulrajnet/2424bc1ffc40324f3786

you can use that also.

python ChromeAppDownloader.py -u https://chrome.google.com/webstore/detail/google-maps/lneaknkopdijkpnocmklfnjbeapigfbh

This is how you have to use.

Solution 5

You can use the below URL template,

https://clients2.google.com/service/update2/crx?response=redirect&prodversion=[PRODVERSION]&x=id%3D[EXTENSIONID]%26uc

The PRODVERSION is the Chrome version. (get it from settings -> Help -> About Google Chrome). Ex : Version 69.0.3497.100 (Official Build) (64-bit)

The EXTENSIONID is the id for the extension. Ex : Here is a sample plugin, https://chrome.google.com/webstore/detail/jetbrains-ide-support/hmhgeddbohgjknpmjagkdomcpobmllji?hl=en the id is hmhgeddbohgjknpmjagkdomcpobmllji

So sample request to download will be https://clients2.google.com/service/update2/crx?response=redirect&prodversion=69.0.3497.100&x=id%3Dhmhgeddbohgjknpmjagkdomcpobmllji%26uc

Share:
111,341
wong2
Author by

wong2

Actively maintaining https://github.com/wong2/pick

Updated on June 13, 2021

Comments

  • wong2
    wong2 almost 3 years

    I'd like to download the .crx file of an extension from webstore, I use fiddler to analyze the network request when I install an extension from webstore and got it.
    For example, for the extension: https://chrome.google.com/webstore/detail/bjclhonkhgkidmlkghlkiffhoikhaajg
    the download link is:

    https://clients2.googleusercontent.com/crx/download/OgAAADQ_Loe5gfVPF2OUaB35tvex-NKlmA8V4K5YlWuvLCknMH7egLLmnMoFuCZePl_idE1GMf8jZC2KbjQqyyLDoDAAxlKa5eDp-z9frOppHWtQsRU3-iGrrrrA/extension_1_7_11.crx
    Now I'm wondering if there is a universal method for get .crx of an extension, the problem is how did Google encryption

    bjclhonkhgkidmlkghlkiffhoikhaajg

    into

    OgAAADQ_Loe5gfVPF2OUaB35tvex-NKlmA8V4K5YlWuvLCknMH7egLLmnMoFuCZePl_idE1GMf8jZC2KbjQqyyLDoDAAxlKa5eDp-z9frOppHWtQsRU3-iGrrrrA ?

    any idea will be helpful.

  • wong2
    wong2 over 12 years
    Oh you are the developer of "Extension Gallery and Web Store Inspector"? thanks very much!
  • neocotic
    neocotic over 12 years
    This will work perfectly for an install link on my website. Thanks a lot! It's worth noting that you get the warning notification when using this URL. Is this the same when using it within an extension?
  • user2012801
    user2012801 over 12 years
    @Alasdair Warning is probably displayed when you are trying to install in, not just download.
  • Rob W
    Rob W over 10 years
    Note: Some extensions contain NaCl modules, that require additional query string parameters. See the source code of my crxviewer extension for the composition of the URL: github.com/Rob--W/crxviewer/commit/…
  • craastad
    craastad over 10 years
    Chrome threw a fit while trying to open this url, if you are on windows, then open it in IE to download it with no problem.
  • Rob W
    Rob W over 10 years
    @craastad Because Chrome recognizes the file as an extension. Install the Chrome extension source viewer extension to easily access the extension's source code in Chrome/Opera.
  • Rob W
    Rob W about 10 years
    @adardesign Have you tried it? This does not even work, for two reasons: 1. Use location.pathname instead of location.href. If the URL contains ?lang=en, then this snippet will fail. 2. Chrome will not "start downloading", but ask you to install the extension.
  • Dwarf
    Dwarf about 10 years
    You are right, I was just trying to answer this question with the following gist, but then I saw this answer, where the same idea was put into a bookmarklet.. and no I didn't try it. See gist.. gist.github.com/adardesign/c0dff591556b90fefcc5
  • Matthew Gertner
    Matthew Gertner almost 10 years
    It seems like Google has changed something recently and this approach no longer works (it returns 204). Anyone have any idea what changed? The author of chrome-extension-downloader.com appears to have fixed it but hasn't updated the documentation.
  • neyl
    neyl almost 10 years
    The long URL provided in the question still works, though. So back to square one!
  • törzsmókus
    törzsmókus over 9 years
    ...except you can never know for sure that you download the same code from their site that you wanted.
  • Alf Eaton
    Alf Eaton about 9 years
    location.href = 'http://clients2.google.com/service/update2/crx?response=red‌​irect&prodversion=42‌​&x=' + encodeURIComponent('uc&id=' + location.pathname.split('/').pop());
  • törzsmókus
    törzsmókus almost 9 years
    @inf3rno how do you know? just because a downloaded extension ‘works’ for you, it might also steal your data or kill your kittens in the background. that’s why you should only download from Google servers, unless you can check the integrity of the crx file (e.g. by a checksum)
  • inf3rno
    inf3rno almost 9 years
    @törzsmókus I checked the code in the crx file, that's how I know. Ofc. there is no guarantee that this downloader is always safe.
  • Dan Dascalescu
    Dan Dascalescu over 8 years
    No longer works. I get 204 No Content. Even after replacing %3D with = and %26 with &.
  • i336_
    i336_ over 8 years
    Confirming that this URL no longer works, I get 204 No Content too. See the answer mentioning PRODVERSION, that one works.
  • damio
    damio about 8 years
    Here's the one I use that works for native and non-native extensions: https://clients2.google.com/service/update2/crx?response=red‌​irect&os=linux&arch=‌​x86-64&nacl_arch=x86‌​-64&prod=chromiumcrx‌​&prodchannel=unknown‌​&prodversion=49.0.26‌​23.108&x=id%3D{ID}%2‌​6uc with {ID} being the extension id.
  • goat
    goat almost 8 years
    this workes for me javascript:(function(){ location.href = 'https://clients2.google.com/service/update2/crx?response=re‌​direct&prodversion=3‌​8.0&x=' + encodeURIComponent('id=' + location.pathname.split('/').pop() + '%26installsource%3Dondemand%26uc'); })();
  • echo
    echo about 6 years
    Chrome blocks the download without giving me a option to keep the file other than the discard button. How to work around this?
  • Keenan
    Keenan almost 6 years
    I know this answer is a bit old, but while this site is still alive - it attempts to load third party scripts. Do be aware before using it.
  • Zoe stands with Ukraine
    Zoe stands with Ukraine about 5 years
    Please don't just post some tool or library as an answer. At least demonstrate how it solves the problem in the answer itself.
  • BBerastegui
    BBerastegui almost 4 years
    God bless you, internet stranger. This works at the time of this comment. The older url that I had was working only for some urls, but not all. This one solved it :D
  • Ashley
    Ashley almost 4 years
    This can be used to install Themes in Microsoft Edge (Chromium) without having to trust a third-party website or extension to acquire the CRX for you; just punch the URL as specified directly into the address bar and Edge does the rest.
  • Andy
    Andy about 3 years
    That last one doesn't seem to work either
  • Luke Miles
    Luke Miles over 2 years
    My version: javascript:window.location.href=%22https://clients2.google.c‌​om/service/update2/c‌​rx?response=redirect‌​&prodversion=95&acce‌​ptformat=crx2,crx3&x‌​=id%253D%22+window.l‌​ocation.href.split(%‌​27/%27).at(-1).split‌​(%27?%27)[0]+%22%252‌​6uc%22 using auto-escape
  • user674669
    user674669 over 2 years
    Example URL that worked for me: clients2.google.com/service/update2/…
  • nightcoder
    nightcoder almost 2 years
    My Avira antivirus blocked access to this site, be careful.