Add some raw code based on chrome-app offical examples.