From 520d32c3aa08867ba25cf3ed5e58cfa8de09e414 Mon Sep 17 00:00:00 2001 From: Kiru Date: Tue, 3 Dec 2024 05:14:36 +0100 Subject: [PATCH] blog: mention background color on WebContentsView (#699) Previously the `WebContentsView` migration guide/blog post did not mention the changed default background color of `WebContentsView` compared to `BrowserView`'s, this adds a note about that. Co-authored-by: Erick Zhao Co-authored-by: Charles Kerr --- blog/migrate-to-webcontentsview.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/blog/migrate-to-webcontentsview.md b/blog/migrate-to-webcontentsview.md index 54e7217a8..0abdc47fb 100644 --- a/blog/migrate-to-webcontentsview.md +++ b/blog/migrate-to-webcontentsview.md @@ -39,6 +39,17 @@ For the most part, each instance where your app instantiates new BrowserViews ca + this.tabBar = new WebContentsView({ ``` + :::info + + By default, `WebContentsView` instantiates with a white background, while `BrowserView` instantiates with a transparent background. + To get a transparent background in `WebContentsView`, set its background color to an RGBA hex value with an alpha (opaqueness) channel set to `00`: + + ```diff + + this.webContentsView.setBackgroundColor("#00000000"); + ``` + + ::: + 2. Migrate where the `BrowserView` gets added to its parent window. ```diff