From 26d9c7ffb08b3c9ae8308c7b25091736714a9ddb Mon Sep 17 00:00:00 2001 From: Sean McArthur <sean.monstar@gmail.com> Date: Mon, 30 Jul 2012 21:06:19 -0700 Subject: [PATCH] catch winchan removeListener error in IE8 removeListener throws in IE8 --- resources/static/common/js/lib/winchan.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/static/common/js/lib/winchan.js b/resources/static/common/js/lib/winchan.js index b31cd2263..ee039892a 100644 --- a/resources/static/common/js/lib/winchan.js +++ b/resources/static/common/js/lib/winchan.js @@ -236,7 +236,10 @@ // if window is unloaded and the client hasn't called cb, it's an error var onUnload = function() { - removeListener(isIE ? msgTarget : window, 'message', onDie); + try { + // IE8 doesn't like this... + removeListener(isIE ? msgTarget : window, 'message', onDie); + } catch (ohWell) { } if (cb) doPost({ a: 'error', d: 'client closed window' }); cb = undefined; // explicitly close the window, in case the client is trying to reload or nav -- GitLab