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;