I have a webview which I am using as a content player. I want to detect whether a link clicked(like policy or t&c) should be opened in external webview or in same webview.
As per UIWebView documentation, shouldStartLoadWithRequest delegate method sends "UIWebViewNavigationTypeLinkClicked" as navigationType when a page is opened with href only. It sends "UIWebViewNavigationTypeOther" in case of javascript triggered links.
but in my case policy document is opened using window.open() which expects this document to be opened in external tab or webview whereas UIWebview detects it as "UIWebViewNavigationTypeOther" so I can't decide how to open in external webview.
Please see below function which tries to open policy doc:
function PolicyView() {
blnLinkClicked=true;
policy2=window.open('policy.html','','scrollbars=yes,width=550,height=500');
if (policy2.opener == null) policy2.opener = self;
policy2.focus();
}
The same url is detected as external in other platforms like android, mobile safari and other browsers.
Please advice if anyone worked on similar functionality. Any lead will be appreciated. Thanks in advance.