File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed
Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { sleep } from '../helpers/async-helpers';
1313import { easeInOutSine } from '../helpers/animation-helpers' ;
1414import { IPC } from '../features/todos/constants' ;
1515import { getRecipeDirectory , loadRecipeConfig } from '../helpers/recipe-helpers' ;
16+ import { isMac } from '../environment' ;
1617
1718
1819const debug = require ( 'debug' ) ( 'Franz:Models:ServiceBrowserView' ) ;
@@ -245,6 +246,7 @@ export class ServiceBrowserView {
245246 }
246247
247248 this . enableContextMenu ( ) ;
249+ this . hacks ( ) ;
248250
249251 this . webContents . loadURL ( this . config . url ) ;
250252 }
@@ -463,6 +465,24 @@ export class ServiceBrowserView {
463465 this . window . webContents . send ( UPDATE_SERVICE_STATE , { serviceId : this . config . id , state : this . webContentsState } ) ;
464466 }
465467
468+ hacks ( ) {
469+ this . webContents . insertCSS ( 'html { background: white; } ' ) ;
470+ if ( isMac ) {
471+ this . webContents . insertCSS ( `
472+ body:before {
473+ background: transparent;
474+ height: 30px;
475+ width: 100%;
476+ position: absolute;
477+ content: " ";
478+ z-index: 9999999;
479+ pointer-events: none;
480+ -webkit-app-region: drag;
481+ }
482+ ` ) ;
483+ }
484+ }
485+
466486 get webContents ( ) {
467487 return this . view . webContents ;
468488 }
Original file line number Diff line number Diff line change @@ -19,12 +19,6 @@ class RecipeWebview {
1919 window . FranzAPI = {
2020 clearCache : RecipeWebview . clearCache ,
2121 } ;
22-
23- // fix BrowserView Background issue
24- const styles = document . createElement ( 'style' ) ;
25- styles . innerHTML = 'html { background: white; }' ;
26-
27- document . querySelector ( 'head' ) . appendChild ( styles ) ;
2822 }
2923
3024 loopFunc = ( ) => null ;
You can’t perform that action at this time.
0 commit comments