【问题标题】:WebView shouldStartLoadWithRequest, get only the main urlWebView shouldStartLoadWithRequest,只获取主url
【发布时间】:2014-07-26 14:37:47
【问题描述】:

我有这段代码可以获取 WebView 正在打开的 url:

-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{

NSlog(@"My Url -> %@",request.URL);

}

此代码向我发送完整的网址,例如:

https://www.google.com/?gws_rd=ssl

就我而言,我只是想尝试获取此页面的主 url,返回:

www.google.com

我该怎么做?

【问题讨论】:

    标签: objective-c webview uiwebview


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-10
      • 2019-07-19
      • 1970-01-01
      相关资源
      最近更新 更多