iriscouch / browserid_couchdb

Mozilla BrowserID support plugin for CouchDB
Apache License 2.0
57 stars 9 forks source link

Programmatic login with callback function fails because popup window cannot open #11

Open nibl opened 12 years ago

nibl commented 12 years ago

Programmatic login with a callback, as described in the instructions, does not work. Probably because Chrome and Firefox block the popup. It works fine without the callback function though.

Chrome and Firefox block popup windows unless the user initiates opening a new window. Opening the window must be the first action performed by the event. Is this not the case with a callback in general, or just the way the callback is implemented here?

// jQuery code example:
//
$('#openLogin').live('click', function() {

$.couch.browserid.login(); // works, but since there's no callback the program loses track of the login process and is not informed of how to continue

$.couch.browserid.login(function(event, error, user) {...}  // callback fails