mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
work around XmlHttpRequest bug 317600 by pausing for a 0ms timeout before trying to log in
This commit is contained in:
parent
18d8e8fcd7
commit
b4967c8831
@ -427,6 +427,15 @@ WeaveSvc.prototype = {
|
||||
_login: function WeaveSync__login(password, passphrase) {
|
||||
let self = yield;
|
||||
|
||||
// XmlHttpRequests fail when the window that triggers them goes away
|
||||
// because of bug 317600, and the first XmlHttpRequest we do happens
|
||||
// just before the login dialog closes itself (for logins prompted by
|
||||
// that dialog), so it triggers the bug. To work around it, we pause
|
||||
// here and then continue after a 0ms timeout.
|
||||
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
timer.initWithCallback({ notify: self.cb }, 0, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
yield;
|
||||
|
||||
// cache password & passphrase
|
||||
// if null, we'll try to get them from the pw manager below
|
||||
ID.get('WeaveID').setTempPassword(password);
|
||||
|
Loading…
Reference in New Issue
Block a user