Short question: Is it possible to detect window.open()
in a UIWebView
using the UIWebViewDelegate
or is there another way to reach thi
You need to overwrite window.open()
using JavaScript:
[webView stringByEvaluatingJavaScriptFromString:@"window.open = function (open) { return function (url, name, features) { window.location.href = url; return window; }; } (window.open);"];
Try using this delegate methods. Hope this helps.
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
- (void)webViewDidStartLoad:(UIWebView *)webView;