Skip to content

Commit

Permalink
fix: undefined backgroundColor (#32654)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jan 31, 2022
1 parent b1ffac5 commit f998093
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions shell/browser/api/electron_api_browser_window.cc
Expand Up @@ -37,7 +37,6 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,
gin::Dictionary::CreateEmpty(isolate);
options.Get(options::kWebPreferences, &web_preferences);

v8::Local<v8::Value> value;
bool transparent = false;
options.Get(options::kTransparent, &transparent);

Expand All @@ -47,8 +46,9 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,
#endif

// Copy the backgroundColor to webContents.
if (options.Get(options::kBackgroundColor, &value)) {
web_preferences.SetHidden(options::kBackgroundColor, value);
std::string color;
if (options.Get(options::kBackgroundColor, &color)) {
web_preferences.SetHidden(options::kBackgroundColor, color);
} else if (!vibrancy_type.empty() || transparent) {
// If the BrowserWindow is transparent or a vibrancy type has been set,
// also propagate transparency to the WebContents unless a separate
Expand Down Expand Up @@ -80,6 +80,7 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,

// Copy the webContents option to webPreferences. This is only used internally
// to implement nativeWindowOpen option.
v8::Local<v8::Value> value;
if (options.Get("webContents", &value)) {
web_preferences.SetHidden("webContents", value);
}
Expand Down

0 comments on commit f998093

Please sign in to comment.