diff --git a/www/InAppBrowser.js b/www/InAppBrowser.js index 5da53fd..83f5a22 100644 --- a/www/InAppBrowser.js +++ b/www/InAppBrowser.js @@ -30,6 +30,7 @@ function InAppBrowser() { 'loaderror' : channel.create('loaderror'), 'exit' : channel.create('exit') }; + this._alive = true; } InAppBrowser.prototype = { @@ -39,7 +40,10 @@ InAppBrowser.prototype = { } }, close: function (eventname) { - exec(null, null, "InAppBrowser", "close", []); + if (this._alive) { + this._alive = false; + exec(null, null, "InAppBrowser", "close", []); + } }, show: function (eventname) { exec(null, null, "InAppBrowser", "show", []);