How to View the Source Code of a Chrome Extension 🧩

Did you know that you can view the source code of extensions you have installed on Chrome? Me neither! 😅

1 min read
How to View the Source Code of a Chrome Extension 🧩
Photo by Anna Shvets from Pexels

Today I learned that I can easily view the source code of the extensions I installed on Chrome! 😮

Not all of the plugin's source code is available, but their content scripts can be accessed by going to DevTools (F12) → SourcesContent scripts.

In three easy steps, you can see the files currently injected into the page.

Why should you look at them? As content scripts are injected into the websites you visit, it is interesting to see how these extensions affect the pages you visit. Are they injecting unwanted content with the promised features? 🤔

This is the only way to make sure they are doing exactly what they say. Even though the source code may be available on GitHub, the source code of the extension may differ if it adds unwanted code during packaging... 😵

Also, it might be worth taking a look at these code sources if you want to learn more about how they implement the functionalities they provide. 😉

Hope this opens up a lot of opportunities for you! 😁