Thursday, October 29, 2026
HomeiOS Developmentios - the way to shut popup in wkwebview (xamarin c#)

ios – the way to shut popup in wkwebview (xamarin c#)

[ad_1]

i created new popup in wkwebview (onclick=”popopen(this.href))

 public override WKWebView CreateWebView(WKWebView webView, WKWebViewConfiguration configuration, WKNavigationAction navigationAction, WKWindowFeatures windowFeatures)
        {if (navigationAction.TargetFrame == null)
            {WKPreferences wkPreferences = new WKPreferences() { JavaScriptCanOpenWindowsAutomatically = true, JavaScriptEnabled = true };
                wkPreferences.SetValueForKey(NSObject.FromObject(true), (NSString)"allowFileAccessFromFileURLs");
                WKWebViewConfiguration wkConfig = new WKWebViewConfiguration();
                wkConfig.Preferences = wkPreferences;
                WKWebView webView1 = new WKWebView(new CGRect(0, 0, webView.Body.Width, webView.Body.Peak), wkConfig);

                webView1.LoadRequest(navigationAction.Request);
                webView1.NavigationDelegate = new AllowAllDelegate();
                webView1.UIDelegate = this;
                webView1.Configuration.ProcessPool = webView.Configuration.ProcessPool;
            
                webView.Superview.AddSubview(webView1);}

and the way to shut new popup? (motion like a href=”#” onclick=”…” )

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments