Skip to content

Instantly share code, notes, and snippets.

@paulirish
Last active January 1, 2025 22:49
Show Gist options
  • Save paulirish/78d6c1406c901be02c2d to your computer and use it in GitHub Desktop.
Save paulirish/78d6c1406c901be02c2d to your computer and use it in GitHub Desktop.
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 website

https://robwu.nl/crxviewer/

Option 3: 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

@zilun-wang
Copy link

Nothing from above worked for me, I kept getting 0B responses until I replaced prodversion=44.0.2403.130 with the actual version of my browser which is 131.0.6778.109 at the time of writing this. -> prodversion=131.0.6778.109 then downloaded the file.

Thanks for your update. This works for me.

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