在ios上的m.youtube.com上导航uiwebview上点击链接 [英] Get clicked linked on uiwebview navigating on m.youtube.com on ios

查看:130
本文介绍了在ios上的m.youtube.com上导航uiwebview上点击链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ios应用程序上使用uiwebview。
我上面有文本框,它导航uiwebview。
我输入m.youtube.com并且webview完全加载它。我在youtube.com上搜索了一下,结果很好。当我点击任何视频时,我会转到视频页面,并且我希望该页面的网址链接会显示有待观看的视频。
m.youtube.com/watch?v=sa+2DFdfd。。但如何?

I use uiwebview on my ios application. I have textbox above it and it navigates the uiwebview. I enter m.youtube.com and the webview perfectly loads it. I made a search on the youtube.com and the results is loaded perfectly. When I click any of the video I go to the video page, and I want to have that url link of the page will appear with video to watch. m.youtube.com/watch?v=sa+2DFdfd .. but how ?

搜索说明:

当我在我的iphone 5上使用safari尝试这个时,我看到导航栏根据我所在的页面完全改变。在这个例子中我看到
;关于safari $ m $ b的m.youtube.com/watch?v=34124S但是我无法在uiwebview上查看它....我无法获得最新加载的网页链接。

When I try this on my iphone 5 using safari I see the navigation bar changes perfectly according to which page I am in. in this example I see; m.youtube.com/watch?v=34124S on safari but I can not cacth it on uiwebview.... I can not get the latest loaded web page link.

ShouldLoadStart仅适用于第一次加载的页面。然后当你点击页面;如果链接的类型为< a href ='/ someLink'/> 链接,则ShouldLoadStart会捕获该链接,但如果它是由javascript类型的链接组成的,则代表们没有抓住点击的链接。请帮助抓住m.youtube.com/watch?v=34124S,就像在youtube网页上的safari一样。

ShouldLoadStart does only work only for the first time page loaded. Then when you click on the page; if the link is type of <a href='/someLink' /> link the ShouldLoadStart catches the link but if it is a made of javascript type of link , the clicked link is not caught by delegates. Please help to catch m.youtube.com/watch?v=34124S like safari does on youtube pages.

推荐答案

我得到了通过使用中央通知链接。当视频出现全视图时,我抓住了那个事件,我得到了加载的页面内部html并获得了唯一的链接..

I got the link by using central notification. when the video appears full view, I catch that event and I get the loaded pages inner html and get the unique link..

如果您有更好的想法,请在下面分享!

If you have better idea please share below!

这篇关于在ios上的m.youtube.com上导航uiwebview上点击链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆