I have a UIWebView which I\'m using as an embedded browser within my app.
I\'ve noticed that links in webpages that open new windows are ignored without any call int
WKWebViewConfiguration *theConfiguration = [[WKWebViewConfiguration alloc] init];
theConfiguration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
webView1 = [[WKWebView alloc] initWithFrame:self.webView.frame configuration:theConfiguration];
webView1.navigationDelegate = self;
webView1.UIDelegate = self;
[self.view addSubview:webView1];
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
NSString *htmlString = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
NSLog(@"htmlString: %@", htmlString);
[webView1 loadHTMLString:htmlString baseURL:[NSURL URLWithString:@"your url"];
}];
[dataTask resume];