1. <tfoot id='CFyer'></tfoot>
    1. <small id='CFyer'></small><noframes id='CFyer'>

    2. <legend id='CFyer'><style id='CFyer'><dir id='CFyer'><q id='CFyer'></q></dir></style></legend>

    3. <i id='CFyer'><tr id='CFyer'><dt id='CFyer'><q id='CFyer'><span id='CFyer'><b id='CFyer'><form id='CFyer'><ins id='CFyer'></ins><ul id='CFyer'></ul><sub id='CFyer'></sub></form><legend id='CFyer'></legend><bdo id='CFyer'><pre id='CFyer'><center id='CFyer'></center></pre></bdo></b><th id='CFyer'></th></span></q></dt></tr></i><div id='CFyer'><tfoot id='CFyer'></tfoot><dl id='CFyer'><fieldset id='CFyer'></fieldset></dl></div>
        <bdo id='CFyer'></bdo><ul id='CFyer'></ul>

    4. 如何在 UIWebView 中检测重定向

      时间:2023-10-22

      <small id='jI8dy'></small><noframes id='jI8dy'>

      • <i id='jI8dy'><tr id='jI8dy'><dt id='jI8dy'><q id='jI8dy'><span id='jI8dy'><b id='jI8dy'><form id='jI8dy'><ins id='jI8dy'></ins><ul id='jI8dy'></ul><sub id='jI8dy'></sub></form><legend id='jI8dy'></legend><bdo id='jI8dy'><pre id='jI8dy'><center id='jI8dy'></center></pre></bdo></b><th id='jI8dy'></th></span></q></dt></tr></i><div id='jI8dy'><tfoot id='jI8dy'></tfoot><dl id='jI8dy'><fieldset id='jI8dy'></fieldset></dl></div>

          <tbody id='jI8dy'></tbody>
            <bdo id='jI8dy'></bdo><ul id='jI8dy'></ul>

                <tfoot id='jI8dy'></tfoot>
              1. <legend id='jI8dy'><style id='jI8dy'><dir id='jI8dy'><q id='jI8dy'></q></dir></style></legend>
                本文介绍了如何在 UIWebView 中检测重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我在我的应用程序中使用 UIWebView 作为嵌入式浏览器.我遇到的问题是跟踪应该在 URL 栏中显示的 URL.

                I am using a UIWebView as an embedded browser within my app. The problem I have is tracking the URL that should be displayed in the URL bar.

                在进行 Google 搜索时,结果页面通常会生成如下链接:

                When doing a Google search, the results page often generates links like this:

                http://www.google.com/url?sa=t&source=web&cd=1&ved=0CC4QFjAA&url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FDog&rct=j&q=dogs&ei=27XeTc6RFIWEvAO858DHBQ&usg=AFQjCNGkEDcWzea4pSlurHhcuQfqFcp_pw

                当用户点击这个链接时,UIWebView先上报这个链接,然后是shouldStartLoadWithRequest:navigationType:中的重定向链接.

                When the user clicks this link, the UIWebView first reports this link and then the redirected link in shouldStartLoadWithRequest:navigationType:.

                我怎么知道这是一个重定向,而不是为页面上的图像或其他元素加载的一些补充站点?就目前而言,我的 URL 栏在上面的示例中显示来自 Google 的长链接,而不是更新到 Wikipedia URL.

                How can I tell this is a redirect as opposed to some supplementary site being loaded for images or other elements on the page? As it stands my URL bar is displaying the long link from Google in the above example rather than updating to the Wikipedia URL.

                推荐答案

                你能做的最好的事情就是观察 webView:shouldStartLoadWithRequest:navigationType: 委托方法.我假设重定向属于 UIWebViewNavigationTypeOther.

                The best you can really do is observe the webView:shouldStartLoadWithRequest:navigationType: delegate method. I assume that redirects fall under UIWebViewNavigationTypeOther.

                这篇关于如何在 UIWebView 中检测重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:在 UIWebView 上获取 HTTP 响应标头 下一篇:创建 Safari Webarchives 的跨平台方式

                相关文章

                1. <i id='8lemi'><tr id='8lemi'><dt id='8lemi'><q id='8lemi'><span id='8lemi'><b id='8lemi'><form id='8lemi'><ins id='8lemi'></ins><ul id='8lemi'></ul><sub id='8lemi'></sub></form><legend id='8lemi'></legend><bdo id='8lemi'><pre id='8lemi'><center id='8lemi'></center></pre></bdo></b><th id='8lemi'></th></span></q></dt></tr></i><div id='8lemi'><tfoot id='8lemi'></tfoot><dl id='8lemi'><fieldset id='8lemi'></fieldset></dl></div>
                2. <small id='8lemi'></small><noframes id='8lemi'>

                    <legend id='8lemi'><style id='8lemi'><dir id='8lemi'><q id='8lemi'></q></dir></style></legend>
                    • <bdo id='8lemi'></bdo><ul id='8lemi'></ul>

                  1. <tfoot id='8lemi'></tfoot>