Capture redirect url in wkwebview in ios

Use this WKNavigationDelegate method public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Swift.Void) { if(navigationAction.navigationType == .other) { if let redirectedUrl = navigationAction.request.url { //do what you need with url //self.delegate?.openURL(url: redirectedUrl) } decisionHandler(.cancel) return } decisionHandler(.allow) } Hope this helps

Adding header view to WKWebView ScrollView

In webView Delegate method – (void)webViewDidFinishLoad:(UIWebView *)webView add the following codebase, mainWebViewObj.scrollView.contentInset = UIEdgeInsetsMake(headerView.frame.size.height,0.0,headerView.frame.size.height,0.0); mainWebViewObj.scrollView.backgroundColor = [UIColor whiteColor]; if(![headerView superview]) { [webView.scrollView addSubview:headerView]; [webView.scrollView bringSubviewToFront:headerView]; } [mainWebViewObj.scrollView setContentOffset: CGPointMake(0, -mainWebViewObj.scrollView.contentInset.top) animated:NO]; this worked perfect for me. Hope it solves your problem.

UIWebView to view self signed websites (No private api, not NSURLConnection) – is it possible?

Finally I got it! What you can do is this: Initiate your request using UIWebView as normal. Then – in webView:shouldStartLoadWithRequest – we reply NO, and instead start an NSURLConnection with the same request. Using NSURLConnection, you can communicate with a self-signed server, as we have the ability to control the authentication through the extra … Read more

UIWebViewDelegate not monitoring XMLHttpRequest?

Interesting question. There are two parts to make this work: a JavaScript handler and UIWebView delegate methods. In JavaScript, we can modify prototype methods to trigger events when an AJAX request is created. With our UIWebView delegate, we can capture these events. JavaScript Handler We need to be notified when an AJAX request is made. … Read more

Black line appearing at bottom of UIWebView. How to remove?

I had same issue and solution is given below : Set UIWebView’s opaque to NO Set UIWebView’s backgroundcolor to clear color. Note : Both things provided above are necessary. Other solutions while using above one webView.scrollView.backgroundColor = UIColor.whiteColor() OR The meta to go in the head tag of HTML <meta name=”viewport” content=”initial-scale=1, maximum-scale=1″>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)