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
2
votes
0 answers

Can't configure CultureInfo for Blazor Hybrid on Windows platform

Blazor Hybrid for Windows platform keeps en-us for the culture. Therefore date pickers and numeric inputs can't be properly configured. Problem seems related to WebView2 which dev teams claims to have documentation about this but I fail to…
Pompoko
  • 21
  • 2
2
votes
1 answer

WebView2 ExecuteScriptAsync method returns encoded HTML

I am using Microsoft Webview2 to load a web page and below code is used to read the HTML content string html = await webView1.ExecuteScriptAsync("document.documentElement.outerHTML"); The resulting output html appears with all tag opening, closing…
2
votes
1 answer

C# How to use CoreWebView2PrintSettings correctly?

I'm using PrintToPdfAsync to print the content of my WebView in pdf, but when trying to adjust the top margin I'm not getting a response. The file is created but the margin comes as default. CoreWebView2PrintSettings printSettings =…
2
votes
2 answers

How to execute script using webview2 to expand an html element using c#

I'm not quite sure how to ask this question. So I'm attaching two images How can I expand the Product Details tab so that the html rendered in the webview2 control looks like the second picture using code behind?
Jimmy
  • 63
  • 3
2
votes
1 answer

webview2 events to inform the application for all static files loading

I want to know about all the static files which the webview2 component loads in order to perform some validations. Files that I want to be informed about are images, JavaScript and CSS files. I spent several hours trying to find an event which will…
pitaridis
  • 2,801
  • 3
  • 22
  • 41
2
votes
1 answer

LocalStorage is dismissed after app restarting. Maui&Blazor

I develop an app with MAUI&Blazor on the windows platform. For storing the page states, the states are persisted in the local storage. But with every app restarting, those states are missing. The Maui reuses the system browser, which should have…
Echo
  • 183
  • 2
  • 11
2
votes
0 answers

Microsoft Windows WebView2 in FormsControlLibrary

I've tried using the "new" WebView2 Control inside of a custom UserControlLibrary in order to get a .dll out of it. I've used it inside of a normal Forms App where it works flawlessly. Just inside of a custom UserControl it just won't show. Has…
de0x95
  • 61
  • 4
2
votes
1 answer

Should I reuse a single WebView2 environment for multiple webview instances?

I have implemented a WebView2 component in our software, using C++/Win32. There can be multiple of these webviews. Should I create a new WebView2 environment for each one, or reuse it? Currently I'm making a new environment for each view (using…
O'Rooney
  • 2,878
  • 2
  • 27
  • 41
2
votes
0 answers

How to access Document property in Webview2 control?

My existing C# Winforms project earlier had the default WebBrowser control. As it fails to load modern websites, I have started using the Webview2 control. The earlier WebBrowser control used to offer the Document property; which is missing from…
Kim Smith
  • 105
  • 8
2
votes
1 answer

How to deselect text in a `ICoreWebView2` control?

Assume that we have 2 ICoreWebView2 controls in a panel, and they are X and Y. When there is any text selected in X, if we then select text in Y, we can observe that the text we selected in X is still selected, even though X has lost keyboard focus,…
Cody
  • 609
  • 4
  • 21
2
votes
1 answer

.net Blazor Desktop folder picker?

I am using a WPF Desktop app with BlazorWebView. I would like to open up file explorer and have the user select a folder to get the path selected. I can use the browser input to select files but as I understand it is a limitation of the browser to…
David Randoll
  • 61
  • 1
  • 10
2
votes
0 answers

Understanding CoreWebView2Environment.CreateAsync behaviour

I have an app with custom webview runtime installed near the exectuable. In order to reproduce some user issue I did the following experiment: I removed msedgewebview2.exe and started the app. env =…
Ashot
  • 10,807
  • 14
  • 66
  • 117
2
votes
0 answers

Persist WebView2 PDF toolbar settings & listen to its buttons events

How can I manipulate and preset the WebView2 PDF toolbar Fit to width or Fit to page setting? Fit to width seems to be the default but I would like to be able to persit the user preference. Also how do we know if the user interacts with the PDF…
tinmac
  • 2,357
  • 3
  • 25
  • 41
2
votes
0 answers

Can't initialize webview2, EnsureCoreWebView2Async(null); fails

using Microsoft.Web.WebView2.Core; namespace WebView2Demo { public partial class Form1 : Form { public Form1() { InitializeComponent(); InitWebView(); } async void InitWebView() …
Ashot
  • 10,807
  • 14
  • 66
  • 117
2
votes
0 answers

Why does EnsureCoreWebView2Async only return in OnContentRendered

I'm trying to use WebView2 in a WPF (.NET Framework) application, and I'm puzzled by the method EnsureCoreWebView2Async. I followed the Getting Started article, and surely enough it was not working for me. The method EnsureCoreWebView2Async would…
Arthur Attout
  • 2,701
  • 2
  • 26
  • 49