Can't use confirm window in extension

531 views
Skip to first unread message

Johnny Kao

unread,
Dec 24, 2013, 10:31:42 PM12/24/13
to chromium-...@chromium.org
Hi all, 

I found a weird problem about confirm window in chrome extension. My extension needs a confirm window for user before they want to delete some datas. But I found that the confirm window shows up in a very brief time and causes extension closed automatically. My do some experiment, and found that confirm window has problem in callback function.

For example, in app.js

    var showConfirm = function() {
      confirm('Are you sure?');
    };
    showConfirm();

is okay, but in app.js

    setTimeout(showConfirm, 1000);

is not okay. 

My platform is OSX, and using chrome v31.0.

Do I do anything wrong? Any opinions/ideas are welcome.

Thanks.

greatghoul

unread,
Dec 25, 2013, 4:16:41 AM12/25/13
to Johnny Kao, chromium-...@chromium.org
You can not use window.confirm in popup, but you can this instead.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/871d27dd-738e-4165-9268-2ad624a4411d%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/groups/opt_out.



--
 greatghoul - Ask and Learn!
Reply all
Reply to author
Forward
0 new messages