diff --git a/shell/browser/api/electron_api_browser_window.cc b/shell/browser/api/electron_api_browser_window.cc index 99a61fa29f240..c296a469a5314 100644 --- a/shell/browser/api/electron_api_browser_window.cc +++ b/shell/browser/api/electron_api_browser_window.cc @@ -42,11 +42,23 @@ BrowserWindow::BrowserWindow(gin::Arguments* args, auto web_preferences = gin_helper::Dictionary::CreateEmpty(isolate); options.Get(options::kWebPreferences, &web_preferences); + bool transparent = false; + options.Get(options::kTransparent, &transparent); + + std::string vibrancy_type; +#if BUILDFLAG(IS_MAC) + options.Get(options::kVibrancyType, &vibrancy_type); +#endif + // Copy the backgroundColor to webContents. std::string color; if (options.Get(options::kBackgroundColor, &color)) { web_preferences.SetHidden(options::kBackgroundColor, color); +#if BUILDFLAG(IS_WIN) } else if (window_->IsTranslucent()) { +#else + } else if (!vibrancy_type.empty() || transparent) { +#endif // If the BrowserWindow is transparent or a vibrancy type has been set, // also propagate transparency to the WebContents unless a separate // backgroundColor has been set.