Updated for version 2 of chrome extension api