Fix crash in sandboxed Chrome apps (close #68)

Uses try/catch instead of `if (window.chrome)`.