How to View the Source Code of a Chrome Extension

There are two main reasons why you may want to read the source code of any Google Chrome extension (including Web Apps and Chrome Themes):

  1. If the Chrome extension has been created by an unknown developer,  you want to ensure that it does what the description says and nothing more. You would not like to download a Chrome extension on your machine that tracks your search logs or browsing history.
  2. You are learning how to write a Chrome extension (or theme) and are curious to know how some of the good extensions have been written. The licenses of some Chrome extensions may even allow code reuse with attribution.

Google Chrome extensions and web apps are distributed as CRX files but they are standard ZIP files that you can easily extract using WinZip or any of the other unzip utilities. For instance, here’s the Chrome App for Angry birds – right-click and save this file as .zip to view all the HTML, CSS, JS and image files that make this popular extension.

If you would like to see the source code of a Chrome Extension, the easiest option would be that you open the local Chrome folder on your computer, switch to the Extensions directory and there you’ll find a separate folder for each of the installed Chrome extensions and apps.

The path of Chrome’s extension folder in Windows is:

C:\\Users\\user\\AppData\\Local\\Google\\Chrome\\User Data\\Name\\Extensions

chrome extensions

Download Chrome Extensions with a Bookmarklet

Alternatively, if you would like to view the source of a Chrome extension but without installing it on your computer, here’s a bookmarklet that will help help.

javascript: (function () {
  document.body.appendChild(document.createElement('script')).src = 'http://digitalinspiration.com/tools/crx/index.js';
})();

Drag the bookmarklet link to your bookmarks toolbar and while you are on the extensions page of Google Chrome, just click the bookmarklet to see the direct download link of the .crx file. You should right-click and save the .crx file with a .zip extension (or use any download manager) else the file will open in Chrome.

The same trick will also help you extract Google Chrome themes since they are also packaged using the same CRX format.

Amit Agarwal

Amit Agarwal

Google Developer Expert, Google Cloud Champion

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India.

Amit has developed several popular Google add-ons including Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

0

Awards & Titles

Digital Inspiration has won several awards since it's launch in 2004.

Google Developer Expert

Google Developer Expert

Google awarded us the Google Developer Expert award recogizing our work in Google Workspace.

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards in 2017.

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional (MVP) title for 5 years in a row.

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator title recognizing our technical skill and expertise.

Email Newsletter

Sign up for our email newsletter to stay up to date.

We will never send any spam emails. Promise.