Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

Option 2: Use the CRX Viewer extension

The Chrome extension source viewer is open source (github repo) and makes this super easy.

Option 3: View source of locally installed extension

  1. Find your Chrome local profile directory. Open chrome://version/ and find the "Profile Path:` field. Open that folder up.
  2. Open the Extensions/ subfolder
  3. All your extensions are here, with typically readable source.

Mapping between locally installed extension IDs and names

  • On about:extensions, turn on Developer Mode and you'll see IDs under each entry
  • Inside the Extensions/ folders, the manifest.json has a readable name field

image

@figital

This comment has been minimized.

Show comment
Hide comment
@figital

figital Aug 26, 2015

Thanks Paul this looks super handy.

figital commented Aug 26, 2015

Thanks Paul this looks super handy.

@serkanh

This comment has been minimized.

Show comment
Hide comment
@serkanh

serkanh Aug 28, 2015

Thanks Paul.

serkanh commented Aug 28, 2015

Thanks Paul.

@kyriakos

This comment has been minimized.

Show comment
Hide comment
@kyriakos

kyriakos commented Aug 28, 2015

thanks!

@kel

This comment has been minimized.

Show comment
Hide comment
@kel

kel Aug 28, 2015

Awesome, thanks.

kel commented Aug 28, 2015

Awesome, thanks.

@Rob--W

This comment has been minimized.

Show comment
Hide comment
@Rob--W

Rob--W Aug 28, 2015

Hi @paulirish, I was wondering where the surge of stars on my repository came from, and ended up at this gist :)

For the command-line URL, use prodchannel=stable instead of prodchannel=unknown, for the reason given in Rob--W/crxviewer#20.

Rob--W commented Aug 28, 2015

Hi @paulirish, I was wondering where the surge of stars on my repository came from, and ended up at this gist :)

For the command-line URL, use prodchannel=stable instead of prodchannel=unknown, for the reason given in Rob--W/crxviewer#20.

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Oct 10, 2015

@Rob--W thx! updated to stable.

Owner

paulirish commented Oct 10, 2015

@Rob--W thx! updated to stable.

@loretoparisi

This comment has been minimized.

Show comment
Hide comment
@loretoparisi

loretoparisi Oct 16, 2017

@paulirish I have found that some extensions does not download its contents (i.e. the background.js is a void file). Any idea?

loretoparisi commented Oct 16, 2017

@paulirish I have found that some extensions does not download its contents (i.e. the background.js is a void file). Any idea?

@km3r

This comment has been minimized.

Show comment
Hide comment
@km3r

km3r Mar 14, 2018

the file i got seems to be a ".crx" file which couldnt be opened by 7-zip or windows explorer until i renamed the extension to ".crx" or ".tar"

km3r commented Mar 14, 2018

the file i got seems to be a ".crx" file which couldnt be opened by 7-zip or windows explorer until i renamed the extension to ".crx" or ".tar"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment