Sunday, May 20, 2012

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.
Get CRX
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.

Create a Unique Password for Every Site You Use


You want to create lengthy, complicated and unique passwords for every website that you use but that rarely happens in practice because these complex strings would be nearly impossible for anyone to remember.
Most people thus rely on password management software that encrypt and store all your passwords in a database which is protected by a single password. You enter that master password and you instantly have access to all your stored user logins and passwords.
unique passwords
There’s however another solution as well that will help you generate unique passwords for all your online accounts but without storing the passwords anywhere – neither online nor on your computer. It’s called Password Chameleon.
With Password Chameleon, all you have to do is remember one master password. You enter the site’s domain name (say gmail.com) and your master password (say He!!0WorId) and tool will instantly create a password by mashing these two strings. Every time you enter your master password and the web domain, the tool will generate the same password.
The good thing is that passwords are generated locally on your computer and while all your online accounts will have unique passwords, you will have to remember just one master password. Also, Password Chameleon uses theSHA-1 Algorithm to generate your passwords (aka hashes) and it impossible to decrypt the master password from the generated hashes.
The downside is that this method isn’t a very practical solution for people who could be maintaining multiple accounts on the same website. The web app and browser extensions are free though the mobile apps cost a little less than $2.
Here’s another password trick suggested by Mozilla that recommends picking a base password and then adding a different suffix and prefix based on the website.