From bf928ee44391b4928299d0fb958a81d331ad7348 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 3 Oct 2018 13:41:37 +0900 Subject: [PATCH] fix: use white background for non-OSR renderer by default (#14934) --- atom/browser/web_contents_preferences.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index f2385b974dc7..e6bf71fb685c 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -213,8 +213,13 @@ void WebContentsPreferences::AppendCommandLineSwitches( // --background-color. std::string s; - if (dict_.GetString(options::kBackgroundColor, &s)) + if (dict_.GetString(options::kBackgroundColor, &s)) { command_line->AppendSwitchASCII(switches::kBackgroundColor, s); + } else if (!(dict_.GetBoolean(options::kOffscreen, &b) && b)) { + // For non-OSR WebContents, we expect to have white background, see + // https://github.com/electron/electron/issues/13764 for more. + command_line->AppendSwitchASCII(switches::kBackgroundColor, "#fff"); + } // --guest-instance-id, which is used to identify guest WebContents. int guest_instance_id = 0;