Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make sure we call the callback if remote debugger doesn't trigger a p…

…age loaded event.
  • Loading branch information...
commit 0a97d637ccb7e8651bd7ba24e1cf2012f98d36c6 1 parent e51dad7
@sourishkrout sourishkrout authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 app/ios.js
View
24 app/ios.js
@@ -393,6 +393,30 @@ IOS.prototype.onPageChange = function(pageArray) {
me.curWindowHandle = keyId;
me.remote.pageIdKey = parseInt(keyId, 10);
} else {
+ var dirty = function() {
+ var item = function(arr) {
+ return _.filter(arr, function(obj) {
+ return obj.id == me.curWindowHandle;
+ })[0];
+ };
+
+ var win = item(pageArray);
+ var ret = false;
+ _.each(item(me.windowHandleCache), function(el, idx, l) {
+ if (l[idx] !== win[idx]) {
+ ret = true;
+ }
+ });
+
+ return ret;
+ };
+
+ // If a window gets navigated to an anchor it doesn't always fire a page callback event
+ // Let's check if we wound up in such a situation.
+ if (dirty()) {
+ me.remote.pageLoad();
+ }
+
logger.info("New page listing is same as old, doing nothing");
}
Please sign in to comment.
Something went wrong with that request. Please try again.