Skip to content

Commit

Permalink
fix: BrowserView setBackgroundColor needs two calls (electron#31863)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere authored and t57ser committed Jan 25, 2022
1 parent e7a4f88 commit 1a8a01b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions shell/browser/api/electron_api_browser_view.cc
Expand Up @@ -155,11 +155,12 @@ gfx::Rect BrowserView::GetBounds() {
}

void BrowserView::SetBackgroundColor(const std::string& color_name) {
if (!web_contents())
return;
view_->SetBackgroundColor(ParseHexColor(color_name));

auto* wc = web_contents()->web_contents();
wc->SetPageBaseBackgroundColor(ParseHexColor(color_name));
if (web_contents()) {
auto* wc = web_contents()->web_contents();
wc->SetPageBaseBackgroundColor(ParseHexColor(color_name));
}
}

v8::Local<v8::Value> BrowserView::GetWebContents(v8::Isolate* isolate) {
Expand Down

0 comments on commit 1a8a01b

Please sign in to comment.