Skip to content

Commit

Permalink
fix: <webview> background transparency (electron#31722)
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak authored and t57ser committed Jan 25, 2022
1 parent 8633ee2 commit a86250f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shell/browser/api/electron_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,8 @@ void WebContents::HandleNewRenderFrame(
// Set the background color of RenderWidgetHostView.
auto* web_preferences = WebContentsPreferences::From(web_contents());
if (web_preferences) {
absl::optional<SkColor> color = web_preferences->GetBackgroundColor();
absl::optional<SkColor> color =
IsGuest() ? SK_ColorTRANSPARENT : web_preferences->GetBackgroundColor();
web_contents()->SetPageBaseBackgroundColor(color);
rwhv->SetBackgroundColor(color.value_or(SK_ColorWHITE));
}
Expand Down

0 comments on commit a86250f

Please sign in to comment.