diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index aea43c89a0f..684323bc102 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -1447,12 +1447,12 @@ void WebContents::DidStartLoading() { } void WebContents::DidStopLoading() { - Emit("did-stop-loading"); - auto* web_preferences = WebContentsPreferences::From(web_contents()); if (web_preferences && web_preferences->IsEnabled(options::kEnablePreferredSizeMode)) web_contents()->GetRenderViewHost()->EnablePreferredSizeMode(); + + Emit("did-stop-loading"); } bool WebContents::EmitNavigationEvent(