MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
452 stars 55 forks source link

Sporadic blank window with no signs of error/exception message #3776

Closed ztanczos closed 1 year ago

ztanczos commented 1 year ago

Description Our users have reported a sporadic issue when an embedded WebView2 fails to render the web content, it just displays a blank page. There is no sign of error messages or exceptions. The WebView2 control seems to be working fine, i.e.: there is a context menu available, DevTools is working but the location is 'about:blank'. Sometimes it takes just one or two restarts to face this issue, sometimes it cannot be reproduced for days.

Version SDK: 1.0.1823.32 Runtime: 114.0.1823.79 and 116.0.1938.62 Framework: WPF OS: Windows 10

Additional info When we enabled chromium logging via additional arguments (--enable-logging --v=1) we see the following entries:

[46936:32128:0907/153649.664:VERBOSE1:embedded_browser_proxy_url_loader_factory.cc(121)] EmbeddedBrowserProxyURLLoaderFactory::CreateLoaderAndStart,proxy: 000043D400BBF7C0, skipped for http://**the*url*we*are*trying*to*open**
[32472:44300:0907/153649.664:VERBOSE1:network_delegate.cc(35)] NetworkDelegate::NotifyBeforeURLRequest: http://**the*url*we*are*trying*to*open**
[46936:32128:0907/153649.683:VERBOSE1:profile_manager.cc(1651)] AddKeepAlive(Default, kClearingBrowsingData). keep_alives=[kBrowserWindow (2), kClearingBrowsingData (1)]
[46936:32128:0907/153649.684:VERBOSE1:edge_dash_service.cc(194)] EdgeDashService::RemoveExtractionsBetween
[46936:32128:0907/153649.684:WARNING:dependency_manager.cc(48)] Trying to register KeyedService Factory: `EdgeBrowserEssentialsSafetyDataManager` after the call to the main registration function `ChromeBrowserMainExtraPartsProfiles::EnsureBrowserContextKeyedServiceFactoriesBuilt()`. Please add a call your factory `KeyedServiceFactory::GetInstance()` in the previous method or to the appropriate `EnsureBrowserContextKeyedServiceFactoriesBuilt()` function to properly register your factory.
[46936:32128:0907/153649.684:VERBOSE1:pref_proxy_config_tracker_impl.cc(191)] 000043D4009EAC00: set chrome proxy config service to 000043D40041F100
[46936:32128:0907/153649.686:WARNING:dependency_manager.cc(48)] Trying to register KeyedService Factory: `CouponsDataManager` after the call to the main registration function `ChromeBrowserMainExtraPartsProfiles::EnsureBrowserContextKeyedServiceFactoriesBuilt()`. Please add a call your factory `KeyedServiceFactory::GetInstance()` in the previous method or to the appropriate `EnsureBrowserContextKeyedServiceFactoriesBuilt()` function to properly register your factory.
[46936:32128:0907/153649.686:VERBOSE1:coupons_data_manager.cc(197)] CouponsDataManager::CouponsDataManager is_bing_identity_valid_for_enroll_: 0 is_rebates_user_: 0
[46936:32128:0907/153649.689:VERBOSE1:embedded_browser_impl.cc(4947)] DidFinishNavigation uncommitted navigation: 3
[32472:44300:0907/153649.698:VERBOSE1:network_delegate.cc(35)] NetworkDelegate::NotifyBeforeURLRequest: http://**a*proxy*url*request**
[46936:51548:0907/153649.730:VERBOSE1:command_storage_backend.cc(927)] Current session files:
[46936:32128:0907/153649.843:VERBOSE1:profile_manager.cc(1702)] RemoveKeepAlive(Default, kClearingBrowsingData). keep_alives=[kBrowserWindow (2)]
[46936:32128:0907/153717.864:VERBOSE1:request_sender.cc(142)] is off the record0

The only suspicious outlier which we don't have in a regular, successful session is this line:

[46936:32128:0907/153649.689:VERBOSE1:embedded_browser_impl.cc(4947)] DidFinishNavigation uncommitted navigation: 3

Unfortunately searching the internet with this log entry did not help.

Any help on how to fix or how to further troubleshoot this problem would be greatly appreciated.

Thanks, Zoltan

pontusn commented 1 year ago

Sounds familiar, we have noticed intermittent aborted navigations, possibly related to race-conditions during initialization.

ztanczos commented 1 year ago

Thanks @pontusn, yes it seems we also had something similar. We re-ordered our initialization logic and the issue disappeared. We suspect that that the ClearBrowsingDataAsync() call was still running when we triggered the navigation which - in some non-deterministic cases cancelled it.