-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Startup the WebBrowser renders a gray surface (WPF) #196
Comments
Thanks, I'll open a bug and look into that. I expect its something related to how we're using HwndHost. Generally though wouldn't you want to show a progress control or otherwise hide the control until some event like NavigationComplete or a WebMessage from your web content to let you know its ready to show to the end user? |
No not really - I'm expecting content to load almost instantly and I'm OK with seeing whatever browser natural load behavior that you would expect when a document first loads because I can control that. The content I'm rendering (or even about:config) should be instantly rendering and by the time the form actually becomes visible via UI (which is delayed as is) the content should already long be there and ready to render. But that doesn't seem to be happening here. You can see I realize transparency is not so easy with this control since it's a Windowed control mapped into the WPF canvas, but this worked in previous iterations of the Web Browser control. It seems to me the rendering internally needs to be delayed until navigation starts. But I guess the control could be not visible internally until the navigation has started. You're probably right I could handle this with InitializeAsync() but do we really want to require that for every application to do that especially since it's not very obvious where the grey render comes from? |
Same problem. public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
webView.Initialized += (s, e) =>
{
MessageBox.Show("inited");
};
webView.NavigationStarting += (s, e) =>
{
MessageBox.Show("start navigate");
};
}
} and neither msgbox shows. |
+1 the load is noticeably ~1 second too slow, and the grey on load is jarring when trying to ensure a seamless experience. In fact this led me to abandon moving forward for now with testing the control in an existing project. |
I was just experimenting with WebView2 in a new WPF app I'm writing and came across the same thing. My app is in a dark theme and when loading WebView2, I see a bright silver flicker which is very jarring before the actual content loads. I agree that we need the control to be transparent until the first content is actually rendered, for this control to be serviceable in themed apps. Another thing I noticed is that when you resize the control, even if the now-rendered HTML background is dark, you still see that silver flicker on the edges before rendering "catches up" to the new size. That also is extremely visually jarring and needs to be resolved. If you can't fix this, then maybe at least give us the ability to set the default background color to something other than this silver color. This way we could adjust it to match the rest of our app's theme and it wouldn't be nearly as noticeable. |
EDIT: Actually, my API does not address this issue. Please disregard! Left and deleted a comment last night because I wasn't sure I'd made the announcement at the appropriate time. Turns out I was fine so I'm reposting. For those who did, thanks for taking a look! Hi all, I'm working on a background color API to address this. Would appreciate if any of you could take a look and give your feedback! |
This should be fixed in the latest package, 1.0.781-prerelease. Thanks! |
This is kind of a nit-picky report, but I noticed that when using the control (in WPF) it briefly displays a gray background before content is rendered. Startup is relatively slow (compared to the IE WB control anyway) and the grey flash is pretty noticeable.
In the screen capture I have a small form with a full form docked WebView2 that is set to
about:blank
(just to do the quickest loading things possible) on a green background:Notice how the page never shows the green background, but launches into a grey background then after initialization (or whatever) shows the white of the
about:blank
.This is even more noticeable for my initial scenario which is loading an editor with a black background:
At first I though it was part of my slow loading content, but even when loading
about:blank
there still was the grey flash before the control displays content. I also experimented with hiding the WebBrowser or the docking container and making it visible later, but even then I still get the grey flash.Expected behavior:
AB#28898913
The text was updated successfully, but these errors were encountered: