0

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!

Stickerbox
  • 141
  • 1
  • 12
  • Well, that callback is only called when a new frame loads (i.e. the whole page reloads, or when a page in an iframe loads a new url). This is not occurring when YouTube loads new content using JS. So, is your question how to receive notification whenever JS is executed on a page you load? What are you trying to accomplish ultimately? – Mathew Jan 24 '13 at 02:37

1 Answers1

0

I think you can refer this,may be this can helpful to you in passing your webview request in safari without URL

Community
  • 1
  • 1
Kirtikumar A.
  • 4,140
  • 43
  • 43