Skip to content

Commit

Permalink
Fixing progress listener detaching if the window was autoclosed. Fixe…
Browse files Browse the repository at this point in the history
…s issue 8093
  • Loading branch information
barancev committed Oct 27, 2014
1 parent d197b82 commit f36cb1b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions javascript/firefox-driver/js/webLoadingListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ WebLoadingListener = function(browser, toCall, timeout, opt_window) {

var handler = this.handler;
loadingListenerTimer.setTimeout(function() {
browser.removeProgressListener(handler);
if (browser.removeProgressListener) {
browser.removeProgressListener(handler);
}
func(true);
}, timeout);
};
Expand All @@ -252,5 +254,7 @@ WebLoadingListener = function(browser, toCall, timeout, opt_window) {
* @param {!WebLoadingListener} listener The listener to remove.
*/
WebLoadingListener.removeListener = function(browser, listener) {
browser.removeProgressListener(listener.handler);
if (browser.removeProgressListener) {
browser.removeProgressListener(listener.handler);
}
};

0 comments on commit f36cb1b

Please sign in to comment.