【发布时间】:2011-11-17 17:58:31
【问题描述】:
PhoneGap 有时会在 Safari 中打开网页,有时会在其 UIWebView 中打开,这是什么控制的?
【问题讨论】:
标签: cordova
PhoneGap 有时会在 Safari 中打开网页,有时会在其 UIWebView 中打开,这是什么控制的?
【问题讨论】:
标签: cordova
来自Does phoneGap support normal web?:
https://github.com/callback/callback-ios/blob/master/PhoneGapLib/Classes/PhoneGapDelegate.m#L669 透露:
navigationType == UIWebViewNavigationTypeOther && mainDocument != nil 则确实会打开 Safari。详述4:
window.location.href assignment,或window.open(...))mainDocument != nil 表示链接不是来自 iFrame?和/或没有目标?所以基本上,我认为只有在 UIWebView 中打开链接点击(除非它们是 gap:// 或 file:// 链接,或者设置了该策略。)
【讨论】: