You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by mm...@apache.org on 2013/02/25 14:41:02 UTC
[13/50] ios commit: [CB-1547] Ignore iframe navigations in webview
delegate methods
[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 <ag...@chromium.org>
Authored: Thu Feb 14 20:38:15 2013 -0500
Committer: Andrew Grieve <ag...@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]);