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.
CRX files are basically ZIP files. After you install an extension, all the files are in a folder named according to the extension ID. To get the extension ID, go to chrome://extensions/ and make sure Developer mode is checked.
In Chrome, navigate to chrome://extensions/Now drag and drop the extension from your file manager anywhere onto the extensions page in Chrome. If the extension is a . crx file you will be asked to review the permissions and add the extension.
The CRX file itself can be directly downloaded fromhttps://clients2.google.com/service/update2/crx?response=redirect&prodversion=[PRODVERSION]&acceptformat=crx2,crx3&x=id%3D[EXTENSIONID]%26uc
(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
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With