Skip to content

Commit

Permalink
blog: mention background color on WebContentsView (#699)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Co-authored-by: Charles Kerr <[email protected]>
  • Loading branch information
3 people authored Dec 3, 2024
1 parent f28c1df commit 520d32c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions blog/migrate-to-webcontentsview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 520d32c

Please sign in to comment.