Ad

Javascript Line Preventing Google App From Running

- 1 answer

I had a google app running perfectly until I added this script:

chrome.identity.getProfileUserInfo(email){
    alert(email);
}

It wont even launched now. Did I write it correctly?

Ad

Answer

Aside from your syntax error, you also can't use alert() within a chrome app.

From here.

It is also worth noting that the "alert()" function isn't supported in Chrome packaged apps. If you need to pop a message that blocks the UI, I would highly recommend the jQuery based blockUI plugin.

alert() blocks the javascript execution and messes with the flow, so google disabled it for chrome apps.

Ad
source: stackoverflow.com
Ad