106

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.

Rob W
  • 341,306
  • 83
  • 791
  • 678
wong2
  • 34,358
  • 48
  • 134
  • 179
  • 2
    For all we know they could easily just be two random numbers stored in a database somewhere with no actual mapping. Why do you want this - you want to scrape all the extensions off the site mechanically? – Rup Aug 25 '11 at 03:48
  • 1
    You can also use 'Give Me CRX', a Google Chrome extension for obtaining source .crx file of any Chrome extension via its Web Store. P.S: I created and published this extension. Extension link: [Give Me CRX (a Chrome Extension)](http://goo.gl/LT98O) – iAnuj Aug 26 '12 at 13:43

13 Answers13

146

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

Rob W
  • 341,306
  • 83
  • 791
  • 678
  • 1
    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: https://github.com/Rob--W/crxviewer/commit/49a84243c9dadfd0401955a4c839bcc13ad53ce9 – Rob W Aug 10 '13 at 21:29
  • 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. – craastad Sep 24 '13 at 11:09
  • @craastad Because Chrome recognizes the file as an extension. Install the [Chrome extension source viewer extension](https://chrome.google.com/webstore/detail/chrome-extension-source-v/jifpbeccnghkjeaalbbjmodiffmgedin) to easily access the extension's source code in Chrome/Opera. – Rob W Sep 24 '13 at 11:11
  • 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 – BBerastegui Jun 01 '20 at 20:24
  • 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. – Ashley Jun 11 '20 at 14:32
  • 3
    Example URL that worked for me: https://clients2.google.com/service/update2/crx?response=redirect&prodversion=95.0.4638.54&acceptformat=crx2,crx3&x=id%3Dpnlccmojcmeohlpggmfnbbiapkmbliob%26uc – user674669 Jan 07 '22 at 11:36
  • For those looking to download the CRX file from the Microsoft Extension store, use `https://edge.microsoft.com/extensionwebstorebase/v1/crx?response=redirect&x=id%3D[EXTENSIONID]%26installsource%3Dondemand%26uc` instead. – 3limin4t0r Apr 14 '23 at 14:48
30

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.

serg
  • 109,619
  • 77
  • 317
  • 330
  • 1
    Oh you are the developer of "Extension Gallery and Web Store Inspector"? thanks very much! – wong2 Aug 25 '11 at 06:01
  • 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? – neocotic Aug 26 '11 at 09:13
  • @Alasdair Warning is probably displayed when you are trying to install in, not just download. – serg Aug 26 '11 at 14:59
  • 17
    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. – Matthew Gertner Jun 19 '14 at 12:07
  • The long URL provided in the question still works, though. So back to square one! – neyl Jun 23 '14 at 11:37
  • 5
    No longer works. I get `204 No Content`. Even after replacing `%3D` with `=` and `%26` with `&`. – Dan Dascalescu Jan 26 '16 at 00:29
  • 9
    Confirming that this URL no longer works, I get `204 No Content` too. **See the answer mentioning PRODVERSION, that one works.** – i336_ Feb 02 '16 at 13:15
  • 1
    Here's the one I use that works for native and non-native extensions: `https://clients2.google.com/service/update2/crx?response=redirect&os=linux&arch=x86-64&nacl_arch=x86-64&prod=chromiumcrx&prodchannel=unknown&prodversion=49.0.2623.108&x=id%3D{ID}%26uc` with `{ID}` being the extension id. – damio Apr 24 '16 at 00:48
  • That last one doesn't seem to work either – Andy May 01 '21 at 13:46
8

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.

arulraj.net
  • 4,579
  • 3
  • 36
  • 37
7

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

prime
  • 14,464
  • 14
  • 99
  • 131
4

Another way to get the crx file.

  1. Copy the url of the extension, for example: https://chrome.google.com/webstore/detail/tiff-viewer/fciggfkkblggmebjbekbebbcffeacknj?hl=es

  2. In the website http://crxextractor.com/

  3. Click in the option "START FOR FREE".

  4. Paste the url of the extension in the textbox.

  5. Click in the option "DOWNLOAD".

  6. Click in the option "GET .CRX".

Wiicho Orozco
  • 448
  • 1
  • 4
  • 9
3

This is a lower-tech way of doing it than to use fiddler, and I realize this is three years old now, but I always look to see if someone else has solved the problem. So I found someone did, and I just used their solution several times successfully. Their solution is an extension that can download other extensions, called Give Me CRX:

https://chrome.google.com/webstore/detail/give-me-crx/acpimoebmfjpfnbhjgdgiacjfebmmmci

Bewc
  • 431
  • 5
  • 15
3

To download the chrome extension from a given id, you could just use like this

var currentEXTId = 'bjclhonkhgkidmlkghlkiffhoikhaajg';    
let downloadURL = https://clients2.google.com/service/update2/crx?response=redirect&x=id%3D" + currentEXTId + "%26uc&prodversion=32;

The above one is the download URL for the chrome extension. There is also a chrome extension which could help you for downloading chrome extension as zip or crx file.https://chrome.google.com/webstore/detail/crx-extractordownloader/ajkhmmldknmfjnmeedkbkkojgobmljda

Also the code for how its done is available in this Github repo

Ashokkumar
  • 327
  • 4
  • 16
  • 1
    Please don't just post some tool or library as an answer. At least demonstrate [how it solves the problem](http://meta.stackoverflow.com/a/251605) in the answer itself. – Zoe Mar 21 '19 at 10:33
2

Create a bookmark add the javascript function as the address. Browse to the chrome extension you want to download then click on the bookmark and it should start downloading.

javascript:(function(){
    var pathname = location.pathname;pathArray = pathname.split("/");   
    location = ("http://clients2.google.com/service/update2/crx?response=redirect&x=id"+"%" + "3D" + pathArray[pathArray.length -1]+"%" + "26uc%" + "26lang%" + "3Den-US&prod=chrome"); })();

Thanks

Zalmy
  • 129
  • 4
  • 1
    @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. – Rob W Apr 10 '14 at 16:09
  • 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.. https://gist.github.com/adardesign/c0dff591556b90fefcc5 – adardesign Apr 13 '14 at 14:55
  • `location.href = 'http://clients2.google.com/service/update2/crx?response=redirect&prodversion=42&x=' + encodeURIComponent('uc&id=' + location.pathname.split('/').pop());` – Alf Eaton May 06 '15 at 13:05
  • 1
    this workes for me `javascript:(function(){ location.href = 'https://clients2.google.com/service/update2/crx?response=redirect&prodversion=38.0&x=' + encodeURIComponent('id=' + location.pathname.split('/').pop() + '%26installsource%3Dondemand%26uc'); })();` – goat Jul 23 '16 at 04:59
  • My version: `javascript:window.location.href=%22https://clients2.google.com/service/update2/crx?response=redirect&prodversion=95&acceptformat=crx2,crx3&x=id%253D%22+window.location.href.split(%27/%27).at(-1).split(%27?%27)[0]+%22%2526uc%22 `using auto-escape – Luke Miles Nov 14 '21 at 22:58
2

Also, I recommend to try this website http://crxextractor.com. Here you can download an extension by it's Chrome Webstore URL and extract it's source code in the browser, no additional software required, and everything get done in a click or two.

Vladimir Ignatev
  • 2,054
  • 1
  • 20
  • 34
  • Chrome blocks the download without giving me a option to keep the file other than the discard button. How to work around this? – echo Apr 04 '18 at 22:05
2

This works for Microsoft Edge Chromium:

https://edge.microsoft.com/extensionwebstorebase/v1/crx?response=redirect&prod=chromiumcrx&prodchannel=&x=id%3D<EXTENSION_ID_HERE>%26installsource%3Dondemand%26uc 
2

I made a simple Python script for downloading extensions as CRX files from the Chrome Web Store:

It has no external dependencies and works with either Python 2 or 3.

Thanks to Rob W for the original solution.

szx
  • 6,433
  • 6
  • 46
  • 67
1

None of the manually ways in this post works for me so i searched for a URL to download the extension direct. Find this and works perfect for me.

https://clients2.google.com/service/update2/crx?response=redirect&prodversion=49.0&x=id%3D###EXTENSION_ID###%26installsource%3Dondemand%26uc

You must replace ###EXTENSION_ID### with the extension id from the chrome shop. Its part of the URL.

Example Google Translate Extension:

https://clients2.google.com/service/update2/crx?response=redirect&prodversion=49.0&x=id%3Daapbdbdomjkkjkaonfhkkikfgjllcleb%26installsource%3Dondemand%26uc
Schmidko
  • 690
  • 1
  • 7
  • 17
0

You use the https://www.crx4chrome.com/ and search for your extension, it also has a different version of that extension, once you click it download .crx file