Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8099CE908 for ; Fri, 15 Feb 2013 01:38:55 +0000 (UTC) Received: (qmail 8908 invoked by uid 500); 15 Feb 2013 01:38:55 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 8874 invoked by uid 500); 15 Feb 2013 01:38:55 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 8861 invoked by uid 99); 15 Feb 2013 01:38:55 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Feb 2013 01:38:55 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 0C90282B13F; Fri, 15 Feb 2013 01:38:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agrieve@apache.org To: commits@cordova.apache.org X-Mailer: ASF-Git Admin Mailer Subject: ios commit: [CB-1547] Ignore iframe navigations in webview delegate methods Message-Id: <20130215013855.0C90282B13F@tyr.zones.apache.org> Date: Fri, 15 Feb 2013 01:38:55 +0000 (UTC) Updated Branches: refs/heads/master 09d5c8f23 -> a24f146a1 [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/master Commit: a24f146a1e286bcf7fa7187d72e3a7962acaead1 Parents: 09d5c8f Author: Andrew Grieve Authored: Thu Feb 14 20:38:15 2013 -0500 Committer: Andrew Grieve 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]);