Closed hiagodotme closed 11 months ago
I think you need to get the tab webContents and use contents.setBackgroundThrottling(false)
as described here: https://www.electronjs.org/docs/latest/api/web-contents#contentssetbackgroundthrottlingallowed
The webContents you need is the one related to the webview (which you can access in tab.webview
), not the window's one. Electron used to provide a method webview.getWebContents()
but it's now deprecated, so you will have to write your own function to get it: https://www.electronjs.org/docs/latest/breaking-changes#deprecated-webviewgetwebcontents
My use of tabs is to keep more than one centralized panel connected to sockets.
Each tab will connect to a socket and there will still be intervals running non-stop every 1s. In my current electron application I basically needed to do this:
This solves my problem, but when running my application within the tab when it is not active, backgroundThrottling limits the tab, impacting my application.
My question is, how do I disable backgroundThrottling within a tab/webview?