Rough port to a Chrome packaged app.