File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { contextBridge } from 'electron' ;
1+ import { contextBridge , webFrame } from 'electron' ;
22
33import { invoke } from './ipc/renderer' ;
44import { JitsiMeetElectron , JitsiMeetElectronAPI } from './jitsi/preload' ;
@@ -10,7 +10,9 @@ import {
1010 serverInfo ,
1111} from './servers/preload/api' ;
1212import { setServerUrl } from './servers/preload/urls' ;
13- import { createRendererReduxStore } from './store' ;
13+ import { createRendererReduxStore , listen } from './store' ;
14+ import { WEBVIEW_DID_NAVIGATE } from './ui/actions' ;
15+ import { debounce } from './ui/main/debounce' ;
1416import { listenToMessageBoxEvents } from './ui/preload/messageBox' ;
1517import { handleTrafficLightsSpacing } from './ui/preload/sidebar' ;
1618import { whenReady } from './whenReady' ;
@@ -48,6 +50,17 @@ const start = async (): Promise<void> => {
4850 return ;
4951 }
5052
53+ listen (
54+ WEBVIEW_DID_NAVIGATE ,
55+ debounce ( ( ) => {
56+ const resources = webFrame . getResourceUsage ( ) ;
57+ // TODO: make this configurable
58+ if ( resources . images . size > 50 * 1024 * 1024 ) {
59+ webFrame . clearCache ( ) ;
60+ }
61+ } , 1000 * 30 )
62+ ) ;
63+
5164 listenToNotificationsRequests ( ) ;
5265 listenToScreenSharingRequests ( ) ;
5366 listenToMessageBoxEvents ( ) ;
You can’t perform that action at this time.
0 commit comments