preventing pageLoad cbs being called twice

This commit is contained in:
sebv
2014-06-26 15:10:23 +08:00
parent 163657d8c7
commit 58987cbfe6

View File

@@ -371,7 +371,7 @@ RemoteDebugger.prototype.pageUnload = function (cb) {
RemoteDebugger.prototype.waitForDom = function (cb) {
this.logger.debug("Waiting for dom...");
if (typeof cb === "function") {
this.pageLoadedCbs.push(cb);
this.pageLoadedCbs.push(_.once(cb));
}
this.pageLoad();
};