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
8
votes
1 answer

EnsureCoreWebView2Async not ready even after CoreWebView2InitializationCompleted event

As per Microsoft's Getting Started with webView2 in Windows Forms (as of 2021 March 9), I've got the following code (with webView2.source not set; edited out of Form.Designer.cs): public Form1() { InitializeComponent(); …
Baffin
  • 132
  • 1
  • 1
  • 6
8
votes
4 answers

How to stop webview2 from opening new browser window rather than inside the browser

i want to know if there is anyway of stopping the webview2 component from opening a browser window in win forms What is happening i looked everywhere but could not find one, i did find one though, but it used XAML/UWP one page used xaml but the…
Foreverably
  • 83
  • 1
  • 5
8
votes
2 answers

WebView2 control not loading HTML string

WebView2 Control: As shown below, the HTML String successfully loads via NavigateToString(...) call inside Button_Click(...) event. But I need to have the HTML string loaded as soon as the Window and/or its Grid is loaded. But the following code…
nam
  • 21,967
  • 37
  • 158
  • 332
8
votes
3 answers

How do you override the ContextMenu that appears when right clicking on WebView2 Control?

How do you override the ContextMenu that appears when right clicking on WebView2 Control? When you right click on WebView2 control, the standard context menu with options such as "Refresh", "Save as", etc. appears. How do I make my own…
DotNetSpartan
  • 931
  • 4
  • 20
  • 41
7
votes
2 answers

WebView2 file download notification box

I have what seems like a stupid problem. I have been working on a WebView2 app for a couple of days now. Prior to today, when I would download a file within the app, I would get the usual download notification box in the lower left. Now I'm getting…
KevinV
  • 91
  • 1
  • 3
7
votes
3 answers

How can I initialize the WebView2 in WPF?

I'm trying to use WebView2 in a WPF application. I read in the docs and in other posts as well, that I should call the EnsureCoreWebView2Async() or set the Source property in order to initialize the WebView. If I set the Source, it loads the web…
Attila Szász
  • 707
  • 4
  • 22
7
votes
2 answers

Equivalent of WebBrowser.InvokeScript(String, Object[]) in WebView2

In my WPF application, I am successfully able to communicate a message from WPF to JavaScript using the InvokeScript(String, Object[]) method of WebBrowser. I am passing my message in Object[] parameter and it is well received by JS code. (See the…
DotNetSpartan
  • 931
  • 4
  • 20
  • 41
6
votes
1 answer

How to take a screenshot of WebView2 from a console application

I am trying to take screenshot of the WebView2 output from a console application. The application is called from a non-interactive Windows Service. The purpose of console application is to generate graphic files from WPF controls. I am currently…
Mike
  • 559
  • 5
  • 21
6
votes
1 answer

window.postMessage VS window.chrome.webview.postMessage

How is window.postMessage different from window.chrome.webview.postMessage? I'm using it in the context of a WebView2 (in a .NET/WPF application). We are loading a third-party webpage in WebView2. The webpage fires window.postMessage with certain…
dotNET
  • 33,414
  • 24
  • 162
  • 251
6
votes
2 answers

WebView2 DevToolsProtocolEvent not raising

I'm trying to create an app that uses the WebView2 WPF component. Currently I'm working on logging the messages and errors that are written by the javascript code of the websites using console.log(). This is what I have right now: public partial…
Norberth Csorba
  • 312
  • 1
  • 9
6
votes
2 answers

How to post data with webview2

I need a post request for a login. I'm using the webview2 package in WPF and using it. My code is this: HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, new Uri("Sample_url")); request.Content = new…
Ali
  • 615
  • 10
  • 16
6
votes
5 answers

How to get sync return from ExecuteScriptAsync in WebView2

.NET, WinForms. The calls are triggered from the UI thread (buttons - clicks). The returns from ExecuteScriptAsync should continue to be processed synchronously, i.e. they should be synchronized again with the call context. I fail here. I tried for…
Sergej Loos
  • 292
  • 1
  • 2
  • 10
6
votes
1 answer

WPF WebView2 - not able to disable Context Menu

Environment: Windows 10 Pro - ver. 1903, VS2019 latest version, WPF Core When I have a manual control on an HTML page displayed inside WebView2 control, I can disable the context menu by simply adding oncontextmunu={return false;} as an attribute to…
nam
  • 21,967
  • 37
  • 158
  • 332
5
votes
2 answers

System.DllNotFoundException: Unable to load DLL 'WebView2Loader.dll' The specified module could not be found. (0x8007007E)

We are using webview2 to launch browser window. At design time webview2 is working fine and we see browser window, but at runtime webview2 is not getting initialized. For the design time only x64 Webview2Loader.dll working, but x64…
seef07
  • 125
  • 2
  • 13
5
votes
2 answers

Set Webview2 Source directly to a binary stream

I have a Webview2 Control in my application, used to view PDF documents. The application also stores to and reads from MS SQL server PDFs data. Currently, I am retrieving binary data from SQL, convert them to a temporary file to disk and…
Werner
  • 95
  • 8
1
2
3
48 49