diff options
Diffstat (limited to 'packages/main/src')
-rw-r--r-- | packages/main/src/index.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts index 857c15d..617a8dd 100644 --- a/packages/main/src/index.ts +++ b/packages/main/src/index.ts | |||
@@ -155,6 +155,17 @@ async function createWindow(): Promise<void> { | |||
155 | } | 155 | } |
156 | }); | 156 | }); |
157 | 157 | ||
158 | // Inject CSS to simulate `browserView.setBackgroundColor`. | ||
159 | // This is injected before the page loads, so the styles from the website will overwrite it. | ||
160 | browserView.webContents.on('did-navigate', () => { | ||
161 | browserView.webContents.insertCSS( | ||
162 | 'html { background-color: #fff; }', | ||
163 | { | ||
164 | cssOrigin: 'author', | ||
165 | }, | ||
166 | ); | ||
167 | }); | ||
168 | |||
158 | autorun(() => { | 169 | autorun(() => { |
159 | browserView.setBounds(store.shared.browserViewBounds); | 170 | browserView.setBounds(store.shared.browserViewBounds); |
160 | }); | 171 | }); |