We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb63189 commit a5ed8fbCopy full SHA for a5ed8fb
atom/browser/api/atom_api_browser_window.cc
@@ -309,6 +309,16 @@ void BrowserWindow::SetBackgroundColor(const std::string& color_name) {
309
auto* view = web_contents()->GetRenderWidgetHostView();
310
if (view)
311
view->SetBackgroundColor(ParseHexColor(color_name));
312
+ // Also update the web preferences object otherwise the view will be reset on
313
+ // the next load URL call
314
+ if (api_web_contents_) {
315
+ auto* web_preferences =
316
+ WebContentsPreferences::From(api_web_contents_->web_contents());
317
+ if (web_preferences) {
318
+ web_preferences->preference()->SetStringKey(options::kBackgroundColor,
319
+ color_name);
320
+ }
321
322
}
323
324
void BrowserWindow::SetBrowserView(v8::Local<v8::Value> value) {
0 commit comments