title: How to Open WebView links in Browser in Xamarin Cross-Plotform Application for both iOS and Android
body: <p>i am new to Xamarin,
  I am developing Xamarin Cross-Plotform Application and which is working fine for both iOS and Android.</p>
  <p>i have one View in my Portable Class Library Project and this View is supporting Both iOS And Android, in that i am using WebView and i am loading that WebView with an External Html Page,
  Here i have an issue Like in that External Html page we have Some Hyperlinks, and when we click on that hyperlink it is get opened in app but i need this should open with a browser.</p>
  <p>I am loading my webview in Portable Class Library Project, like below</p>
  <pre><code>mywebview.Source = new UrlWebViewSource { Url = myurl };
  </code></pre>
  <p>Can Any one help me out how to open webview hyperlinks in Browser for both iOS and Android.</p>
  <p>I Tried with the following block of code, but it is not working</p>
  <pre><code>private void mywebview_Navigated(object sender, WebNavigatedEventArgs e)
  {
      string jscall = &quot;var d = document.getElementsByTagName('a'); for (var i = 0; i &lt; d.length; i++) { if (d[i].getAttribute('target') == '_blank') { if(d[i].href.includes('?')) {d[i].href = d[i].href + '&amp;target=blank';} else {d[i].href = d[i].href + '?target=blank';}}}&quot;;
      Loadfromweb.Eval(jscall);
  }
  
  private void mywebview_Navigating(object sender, WebNavigatingEventArgs e)
  {
      if (e.Url.ToLower().Contains(&quot;target=blank&quot;))
      {
          var uri = new Uri(e.Url);
          Device.OpenUri(uri);
          e.Cancel = true;
      }
      else
      {
          e.Cancel = false;
      }
  }
  </code></pre>