Questions tagged [webview2]

Use the tag for the questions about Microsoft Edge WebView2 control. For current issues check https://github.com/MicrosoftEdge/WebView2Feedback/issues

Microsoft Edge WebView2 control uses Microsoft Edge (Chromium) as the rendering engine.

It can be used in Win32 C++ or .NET (WPF or WinForms) and WinUI 3 applications.

For further information, see the WebView2 documentation or the WebView2 feedback project for bugs and feature requests.

727 questions
20
votes
17 answers

Why my coreWebView2 which is object of webView2 is null?

I am creating a object of Microsoft.Web.WebView2.WinForm.WebView2 but the sub obect of this coreWebView2 is null Microsoft.Web.WebView2.WinForm.WebView2 webView = new Microsoft.Web.WebView2.WinForm.WebView2() // Change some GUI properties of…
Abbas Tambawala
  • 281
  • 1
  • 2
  • 6
17
votes
2 answers

How to fix msedgewebview2 error in VS2022 when admin?

I have installed the relatively fresh Visual Studio 2022 on a Windows installation. The work I do often requires administrative privileges (local IIS). To do this I have two users, one 'normal' account that is logged in to Windows and one…
pekaaw
  • 2,309
  • 19
  • 18
13
votes
1 answer

WebView2 EnsureCoreWebView2Async never returns

In my WPF application I need to show an html string, and I know that I need to call EnsureCoreWebView2Async method before calling NavigateToString because otherwise the CoreWebView will be null and I would have an exception. The problem is that…
Daniele Armanasco
  • 7,289
  • 9
  • 43
  • 55
13
votes
3 answers

Set Cache directory for WebView2

I am using WebView2 in WPF control to host the new edge. In my code, I want to cache the cookie and browser specific data to a cache directory. The cache location should be set in the CoreWebView2EnvironmentOptions when creating the…
DotNetSpartan
  • 931
  • 4
  • 20
  • 41
12
votes
9 answers

Microsoft Edge WebView2 - Sample crashes on Load

I took the latest version of Microsoft.Web.WebView2 (0.9.515-prerelease) and added to a test C# WinForms application. Am using VS 2019, .NET framework is 4.7.2. Placed the WebView2 control on a form, compiled and ran. The application crashed on…
Krishnan V S
  • 1,124
  • 1
  • 13
  • 31
11
votes
2 answers

CefSharp vs WebView2

I'm considering moving a project from cef (CefSharp) to WebView2 WPF. My preliminary tests shows that WebView2 API have the interface I need for this port. I am afraid that I can miss something that can prevent me from switching to WebView2 and I'll…
ekalchev
  • 762
  • 7
  • 24
11
votes
1 answer

How do I use WebView2 in a console application

string text = "return 'test';"; var webView = new Microsoft.Web.WebView2.WinForms.WebView2(); webView.EnsureCoreWebView2Async(null).RunSynchronously(); var srun = webView.CoreWebView2.ExecuteScriptAsync(text); When I run the above code…
Aaron Fischer
  • 20,853
  • 18
  • 75
  • 116
11
votes
3 answers

How to prevent WebView2(Edge based) to open a new window

Inside Webview2 when I open a new tab, a new window outside WindowsForms is open. I want to prevent this window to Open, how can I do that?
Tiago Gomes
  • 161
  • 1
  • 9
11
votes
4 answers

Detect if WebView2 is installed on clients machine (VB.NET)

I am looking for a way to detect if WebView2 runtime is installed on the clients machines so that i can display using the old ie browser instead if they don't have it installed. I am using VB.NET. Thanks
Tom Knevitt
  • 129
  • 1
  • 1
  • 7
10
votes
1 answer

WebView2 how to load local file?

I have a WebView2 control in my WinForm .NET Framework 4.7.2, how can i load inside it my local html file? I was trying to set the .Source with file:// extention but nothing... Here is what i've tryed: private void Form1_Load(object sender,…
Kasper Juner
  • 832
  • 3
  • 15
  • 34
10
votes
3 answers

Print functionality in WebView2 control

Thanks in Advance ! In my application, I have embedded a WebView2 control inside a WPF usercontrol. Is there anyway or a workaround that can help me to take a print of the WebView2 control ? I identified that the current WebView2 pre-release SDK…
DotNetSpartan
  • 931
  • 4
  • 20
  • 41
10
votes
4 answers

VB.Net Webview2 How can I get html source code?

I sucessfully display a web site on WebView2 in my VB.net (Visual Studio 2017) project but can not get html souce code. Please advise me how to get html code. My code: Private Sub testbtn_Click(sender As Object, e As EventArgs) Handles…
Tom
  • 123
  • 1
  • 1
  • 7
10
votes
3 answers

How can I use the Microsoft Edge WebView2 control in C# windows application

How can I use the Microsoft Edge WebView2 control in C# windows application using Visual Studio?
Prasad-yadav
  • 121
  • 1
  • 1
  • 5
9
votes
3 answers

Hide or modify the toolbar of Webview2 when viewing pdf

I am using the new Webview2 control to render Pdf files in my WPF application. This is working well but I would like to customize the toolbar to hide for example the save buttons on some criteria. I did not find methods or properties to do that…
Alex R
  • 347
  • 2
  • 10
9
votes
2 answers

WebView2 (2020/06) -> Where's the DOM?

I moved a sort of working Excel VBA app that automated IE as part of a web-scraping and order placing system I wrote for my wife who was spending hours tortured by the 90's style Usborne Children Books Consultant Portal to a C#/Windows…
user7806247
1
2 3
48 49