diff --git a/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m b/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m index a098be2b9..3021f8f57 100644 --- a/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m +++ b/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m @@ -108,9 +108,11 @@ - (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url + (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType { + BOOL isMainNavigation = [[request.mainDocumentURL absoluteString] isEqualToString:[request.URL absoluteString]]; + return ( navigationType == CDVWebViewNavigationTypeLinkClicked || - navigationType == CDVWebViewNavigationTypeLinkOther + (navigationType == CDVWebViewNavigationTypeLinkOther && isMainNavigation) ); }