I already tried getting the current URL of my UIWebView
with: webview.request.URL
.
Unfortunately the NSURL
was empty. Anything wrong h
I too found that the approved answer above was not reliable. But with a slight modification, it seems to work every time:
NSString *currentURL = [webView stringByEvaluatingJavaScriptFromString:@"window.location.href"];
Note the addition of ".href" to the Javascript as this is hidden at the end of the line of code.