Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8655861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:08:32+00:00 2026-06-12T15:08:32+00:00

I have a WebView component that I use to display HTML Ads in my

  • 0

I have a WebView component that I use to display HTML Ads in my app. When user clicks an Ad in the WebView I want to open the Ad link in an external browser. How do I do that?

I need something like OnNavigating from the WP7 browser. I tried the Tapped event of the WebView but it never gets called even when I set IsTapEnabled=true. I need something like

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:08:33+00:00Added an answer on June 12, 2026 at 3:08 pm

    You will need to use the ScriptNotify event for this. Here’s how I handled the scenario (using NavigateToString). If you’re retrieving the web view content from a URL, you will need be able to modify the HTML for this to work.

    1. Add the following Javascript code to your HTML

      <script type="text/javascript">for (var i = 0; i < document.links.length; i++) { document.links[i].onclick = function() { window.external.notify('LaunchLink:' + this.href); return false; } }</script>
      

      This adds an onclick handler to every link (<a href=”…”></a>) on the page. window.external.notify is a Javascript method that works in the Webview.

    2. Add the ScriptNotify event handler to the webview.

      WebView.ScriptNotify += WebView_ScriptNotify;
      
    3. Declare the event handler

      async private void WebView_ScriptNotify(object sender, NotifyEventArgs e)
      {
          try
          {
              string data = e.Value;
              if (data.ToLower().StartsWith("launchlink:"))
              {
                  await Launcher.LaunchUriAsync(new Uri(data.Substring("launchlink:".Length), UriKind.Absolute));
              }
          }
          catch (Exception)
          {
              // Could not build a proper Uri. Abandon.
          }
      }
      

    Note that you if you’re using an external URL, this has to be added to the webview’s allowed Uris whitelist (http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.webview.scriptnotify for reference).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webview that's supposed to show cyrillic text wv.loadData( myStringHtml, html/text, utf-8);
I have an app that is displaying a webpage using a WebView control. I
I have a WebView that I'm using to open some files stored in the
I have an Android app that uses a WebView to enable users to install
i have a webview, that is being show in an app there is an
I have a WebView that loads a local HTML file like this: [webView loadRequest:[NSURLRequest
I have a WebView that I want to save as a WebArchive. I just
I have a webview and I want to manually switch to another tab during
I have a webview, which shows the pages of a ebook. I want to
I have a webview that I'm creating in an Activity which is a child

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.