diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-02-27 18:15:43 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-03-06 18:56:48 +0100 |
commit | c80aad5b4ab70462f39b5073c936adf9f54c5fd3 (patch) | |
tree | 23d37d3d7564f9dcac442adeafe4ef9c7e9bedd6 /packages/main | |
parent | feat: Location bar actions (diff) | |
download | sophie-c80aad5b4ab70462f39b5073c936adf9f54c5fd3.tar.gz sophie-c80aad5b4ab70462f39b5073c936adf9f54c5fd3.tar.zst sophie-c80aad5b4ab70462f39b5073c936adf9f54c5fd3.zip |
fix(service-preload): Browser view canvas background
Due to `BrowserView.setBackgroundColor` not working under linux, we have
to inject styles to make sure our `BrowserView` is opaque.
We try to cover more edge cases to avoid the interference of the
injected style and the web site's own styles according to the CSS
specification:
https://www.w3.org/TR/css-backgrounds-3/#body-background
In particular, we avoid overwriting the styles for the `html` element
if `body` already has an opaque background so that the background of
`body` can extend to the whole canvas.
This might still interfere with the web site if it updates the
background color on the fly (dark mode), but a reload should solve
most of such issues.
Hopefully, after
https://github.com/electron/electron/issues/32898
is resolved, we can get rid of the hack entirely.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/main')
-rw-r--r-- | packages/main/src/stores/MainStore.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/main/src/stores/MainStore.ts b/packages/main/src/stores/MainStore.ts index bf351d7..21d7a63 100644 --- a/packages/main/src/stores/MainStore.ts +++ b/packages/main/src/stores/MainStore.ts | |||
@@ -87,7 +87,7 @@ const MainStore = types | |||
87 | self.settings.setShowLocationBar(action.showLocationBar); | 87 | self.settings.setShowLocationBar(action.showLocationBar); |
88 | break; | 88 | break; |
89 | case 'reload-all-services': | 89 | case 'reload-all-services': |
90 | // TODO | 90 | self.services.forEach((service) => service.reload()); |
91 | break; | 91 | break; |
92 | case 'dispatch-service-action': { | 92 | case 'dispatch-service-action': { |
93 | const { serviceId, serviceAction } = action; | 93 | const { serviceId, serviceAction } = action; |