diff --git a/python/pyphantomjs/bootstrap.js b/python/pyphantomjs/bootstrap.js index d897524fc0..25697b00d8 100644 --- a/python/pyphantomjs/bootstrap.js +++ b/python/pyphantomjs/bootstrap.js @@ -63,7 +63,7 @@ window.WebPage = function() { onScriptLoaded(scriptUrl); // And disconnect the signal handler try { - this.javaScriptAlertSent.disconnect(this); + this.javaScriptAlertSent.disconnect(arguments.callee); } catch (e) {} } }); diff --git a/src/bootstrap.js b/src/bootstrap.js index d897524fc0..25697b00d8 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -63,7 +63,7 @@ window.WebPage = function() { onScriptLoaded(scriptUrl); // And disconnect the signal handler try { - this.javaScriptAlertSent.disconnect(this); + this.javaScriptAlertSent.disconnect(arguments.callee); } catch (e) {} } });