feat: add contents.getBackgroundThrottling() + backgroundThrottling property (#21036)
This commit is contained in:
parent
7656480247
commit
4afc756094
7 changed files with 59 additions and 0 deletions
|
@ -157,6 +157,9 @@ Object.assign(BrowserWindow.prototype, {
|
|||
setTouchBar (touchBar) {
|
||||
electron.TouchBar._setOnWindow(touchBar, this);
|
||||
},
|
||||
getBackgroundThrottling () {
|
||||
return this.webContents.getBackgroundThrottling();
|
||||
},
|
||||
setBackgroundThrottling (allowed) {
|
||||
this.webContents.setBackgroundThrottling(allowed);
|
||||
}
|
||||
|
|
|
@ -587,6 +587,11 @@ WebContents.prototype._init = function () {
|
|||
get: () => this.getFrameRate(),
|
||||
set: (rate) => this.setFrameRate(rate)
|
||||
});
|
||||
|
||||
Object.defineProperty(this, 'backgroundThrottling', {
|
||||
get: () => this.getBackgroundThrottling(),
|
||||
set: (allowed) => this.setBackgroundThrottling(allowed)
|
||||
});
|
||||
};
|
||||
|
||||
// Public APIs.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue