aboutsummaryrefslogtreecommitdiffstats
path: root/packages/service-preload/src/index.ts
Commit message (Collapse)AuthorAge
* chore(deps): Bump electron to 19 for setBackgroundColor fixLibravatar Kristóf Marussy2022-05-16
| | | | | | | | Since https://github.com/electron/electron/pull/33435 has landed in electron 19 alpha, but not in 18, moving to 19 lets us remove the workarounds for setBackgroundColor. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat(service-preload): Embed service-injectLibravatar Kristóf Marussy2022-05-16
| | | | | | | | Embed the service-inject script into the service-preload script to avoid having to load it manually and reduce IPC communication when a service loads. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* fix(service-preload): Browser view canvas backgroundLibravatar Kristóf Marussy2022-03-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* fix: Cosmetic fixesLibravatar Kristóf Marussy2022-02-14
| | | | | | | | | * Update the browser view size more quickly (negligible CPU usage overhead) * Style the body element by default instead of the html element for better compatibility with website CSS. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* feat: Load and switch servicesLibravatar Kristóf Marussy2022-02-14
| | | | Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* refactor: Coding conventionsLibravatar Kristóf Marussy2022-02-08
| | | | | | | | | Make sure that files have a default import with the same name as the file whenever possible to reduce surprise. Also shuffles around some file names for better legibility. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* fix: Do not access localStorage in service-preloadLibravatar Kristóf Marussy2022-02-08
| | | | | | | | | | | | loglevel wants to persist the current log level in localStorage, which apparently crashes the network service. We'll need to find another way to log in service preload scripts. The main window preload scripts seems unaffected, even though we use loglevel (and hence localStorage) in both the preload and the renderer script. Maybe related: https://github.com/electron/electron/issues/31689 Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* build: Add eslint-plugin-unicornLibravatar Kristóf Marussy2022-01-09
| | | | Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* build: Eslint fixes for multi-module projectLibravatar Kristóf Marussy2022-01-09
| | | | Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* refactor: Fetch service inject asynchronouslyLibravatar Kristóf Marussy2021-12-25
| | | | | | Since we don't plan to shim any APIs that must be present immediately when the service loads, we might as well switch to asynchronous IPC for fetching the script to inject into the main world.
* refactor: Simplify script injectionLibravatar Kristóf Marussy2021-12-25
| | | | | | | | | Inject CSS and main world scripts synchronously to avoid race conditions with page loading. Don't try to miming userAgentData for now, since it won't bypass google's checks. However, simply omitting chrome from the user agent does bypass them, at least for now.
* feat: User agent data simulatorLibravatar Kristóf Marussy2021-12-24
|
* feat: Service to main process communicationLibravatar Kristóf Marussy2021-12-24