Rob Wu has released Extension Source Viewer, a Firefox add-on which allows viewing the source code of Chrome and Firefox browser extensions before installing them.
If that sounds familiar it’s because Wu is also the developer of Chrome Extension Viewer, which also now supports both Chrome and Firefox extensions.
Both add-ons work in much the same way. Visit an extension’s chrome.store.com or addons.mozilla.org home, click the crx icon and you’ll get a "download as zip" or "view" option.
The Viewer displays a simple list of everything in the source, including HTML, JS, CSS and image files, and clicking any of these displays it in a preview pane.
A search box with regular expression support helps locate text of interest.
This might help you spot malicious browser extensions, but keep in mind that the developers usually go to great lengths to disguise what they’re really doing. There’s no harm in checking, but threats can be very hard to spot.
Still, even if you’re clueless about the code, Source Viewer offers other benefits, such as allowing previewing and saving any image in the extension without installing it first.