cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmo...@apache.org
Subject [13/50] ios commit: [CB-1547] Ignore iframe navigations in webview delegate methods
Date Mon, 25 Feb 2013 13:41:02 GMT
[CB-1547] Ignore iframe navigations in webview delegate methods


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/a24f146a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/a24f146a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/a24f146a

Branch: refs/heads/multipart_plugin_result
Commit: a24f146a1e286bcf7fa7187d72e3a7962acaead1
Parents: 09d5c8f
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Thu Feb 14 20:38:15 2013 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Thu Feb 14 20:38:15 2013 -0500

----------------------------------------------------------------------
 CordovaLib/Classes/CDVViewController.m |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/a24f146a/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index 73ea987..e92d98d 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -498,11 +498,11 @@
  */
 - (void)webViewDidStartLoad:(UIWebView*)theWebView
 {
-    [_commandQueue resetRequestId];
-    // Only send the reset message for top-level navigation.
-    if (self.isTopLevelNavigation) {
-        [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification
object:nil]];
+    if (!self.isTopLevelNavigation) {
+        return;
     }
+    [_commandQueue resetRequestId];
+    [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification
object:nil]];
 }
 
 /**
@@ -510,6 +510,10 @@
  */
 - (void)webViewDidFinishLoad:(UIWebView*)theWebView
 {
+    if (!self.isTopLevelNavigation) {
+        return;
+    }
+
     [CDVUserAgentUtil releaseLock:&_userAgentLockToken];
 
     /*
@@ -536,6 +540,9 @@
 
 - (void)webView:(UIWebView*)webView didFailLoadWithError:(NSError*)error
 {
+    if (!self.isTopLevelNavigation) {
+        return;
+    }
     [CDVUserAgentUtil releaseLock:&_userAgentLockToken];
 
     NSLog(@"Failed to load webpage with error: %@", [error localizedDescription]);


Mime
View raw message