0

がホストする html のハイパーリンクをクリックするとWebView、 内でページが開きますWebView。これを許可した場合、Microsoft はアプリケーションの認定に失敗すると思います。

WebViewそのため、でナビゲーションを検出し、ブラウザで URL を起動するにはどうすればよいですか?

4

1 に答える 1

0

ヒントをくれたXyroidに感謝します。これは私がやったことです:

        /// <summary>
        /// Regex pattern for getting href links.
        /// </summary>
        private static readonly Regex HrefRegex = new Regex("href=\"([^\"]*)\"", RegexOptions.IgnoreCase);

        // Append target="_blank" to all hrefs
        html = HrefRegex.Replace(html, new MatchEvaluator(HrefReplace));

        /// <summary>
        /// Replaces the contents of href with href and target.
        /// </summary>
        /// <param name="match">The match.</param>
        /// <returns>The href with target.</returns>
        private static string HrefReplace(Match match)
        {
            return string.Format("{0} target=\"_blank\"", match.Value);
        }
于 2013-05-28T13:37:18.017 に答える