Thanks for looking at my question. To do some testing, I've output the string for the current URL of a webView into the console. But with m.youtube.com, it seems that no URL is passed. This is probably the reason why using methods like:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
[[UIApplication sharedApplication] openURL:request.URL];
return NO;
}
return YES;
}
don't work with m.youtube.com, but do with other websites.
As Mathew said, YouTube loads using Javascript, so let me rephrase my question - is there a way to open the site in Safari when new javascript is loaded on the page?
I've uploaded a sample project that contains my problem.
https://www.dropbox.com/sh/m4yjv7awpj9wlh8/q0nQgHlQQC/YouTubeWebView
Thanks very much!