diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-04 19:14:02 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-04 19:14:02 -0700 |
commit | 4e9f2ec3e63b6ecb11e7fb83b69b3b8d93079adf (patch) | |
tree | 6fc5a2d064ecfa894152ae90b99cff2b24d2fec4 /src | |
parent | 651c02c50f42cc9fc1e3dfcc9f68d9a047a44242 (diff) | |
download | DotNetOpenAuth-4e9f2ec3e63b6ecb11e7fb83b69b3b8d93079adf.zip DotNetOpenAuth-4e9f2ec3e63b6ecb11e7fb83b69b3b8d93079adf.tar.gz DotNetOpenAuth-4e9f2ec3e63b6ecb11e7fb83b69b3b8d93079adf.tar.bz2 |
Fixed yet another stability problem in IE.
Diffstat (limited to 'src')
-rw-r--r-- | src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js index a3a6949..b5301cc 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js @@ -271,24 +271,29 @@ window.dnoa_internal.DiscoveryResult = function(identifier, discoveryInfo) { var thisServiceEndpointLocal = thisServiceEndpoint; thisServiceEndpoint.popupCloseChecker = window.setInterval(function() { if (thisServiceEndpointLocal.popup) { - if (thisServiceEndpointLocal.popup.closed) { - // The window closed, either because the user closed it, canceled at the OP, - // or approved at the OP and the popup window closed itself due to our script. - // If we were graying out the entire page while the child window was up, - // we would probably revert that here. - window.clearInterval(thisServiceEndpointLocal.popupCloseChecker); - thisServiceEndpointLocal.popup = null; - - // The popup may have managed to inform us of the result already, - // so check whether the callback method was cleared already, which - // would indicate we've already processed this. - if (window.dnoa_internal.processAuthorizationResult) { - trace('User or OP canceled by closing the window.'); - if (thisDiscoveryResult.onAuthFailed) { - thisDiscoveryResult.onAuthFailed(thisDiscoveryResult, thisServiceEndpoint); + try { + if (thisServiceEndpointLocal.popup.closed) { + // The window closed, either because the user closed it, canceled at the OP, + // or approved at the OP and the popup window closed itself due to our script. + // If we were graying out the entire page while the child window was up, + // we would probably revert that here. + window.clearInterval(thisServiceEndpointLocal.popupCloseChecker); + thisServiceEndpointLocal.popup = null; + + // The popup may have managed to inform us of the result already, + // so check whether the callback method was cleared already, which + // would indicate we've already processed this. + if (window.dnoa_internal.processAuthorizationResult) { + trace('User or OP canceled by closing the window.'); + if (thisDiscoveryResult.onAuthFailed) { + thisDiscoveryResult.onAuthFailed(thisDiscoveryResult, thisServiceEndpoint); + } } - window.dnoa_internal.processAuthorizationResult = null; } + } catch (e) { + // This usually happens because the popup is currently displaying the OP's + // page from another domain, which makes the popup temporarily off limits to us. + // Just skip this interval and wait for the next callback. } } else { // if there's no popup, there's no reason to keep this timer up. |