chore: revert deprecated WebContents properties (#22640)
* chore: revert deprecated WebContents properties * Fix failing zoomFactor test
This commit is contained in:
parent
0c02d794c9
commit
1b353d1ed3
5 changed files with 124 additions and 65 deletions
|
@ -549,14 +549,34 @@ WebContents.prototype._init = function () {
|
|||
|
||||
const event = process.electronBinding('event').createEmpty()
|
||||
app.emit('web-contents-created', event, this)
|
||||
}
|
||||
|
||||
// Deprecations
|
||||
deprecate.fnToProperty(WebContents.prototype, 'audioMuted', '_isAudioMuted', '_setAudioMuted')
|
||||
deprecate.fnToProperty(WebContents.prototype, 'userAgent', '_getUserAgent', '_setUserAgent')
|
||||
deprecate.fnToProperty(WebContents.prototype, 'zoomLevel', '_getZoomLevel', '_setZoomLevel')
|
||||
deprecate.fnToProperty(WebContents.prototype, 'zoomFactor', '_getZoomFactor', '_setZoomFactor')
|
||||
deprecate.fnToProperty(WebContents.prototype, 'frameRate', '_getFrameRate', '_setFrameRate')
|
||||
// Properties
|
||||
|
||||
Object.defineProperty(this, 'audioMuted', {
|
||||
get: () => this.isAudioMuted(),
|
||||
set: (muted) => this.setAudioMuted(muted)
|
||||
})
|
||||
|
||||
Object.defineProperty(this, 'userAgent', {
|
||||
get: () => this.getUserAgent(),
|
||||
set: (agent) => this.setUserAgent(agent)
|
||||
})
|
||||
|
||||
Object.defineProperty(this, 'zoomLevel', {
|
||||
get: () => this.getZoomLevel(),
|
||||
set: (level) => this.setZoomLevel(level)
|
||||
})
|
||||
|
||||
Object.defineProperty(this, 'zoomFactor', {
|
||||
get: () => this.getZoomFactor(),
|
||||
set: (factor) => this.setZoomFactor(factor)
|
||||
})
|
||||
|
||||
Object.defineProperty(this, 'frameRate', {
|
||||
get: () => this.getFrameRate(),
|
||||
set: (rate) => this.setFrameRate(rate)
|
||||
})
|
||||
}
|
||||
|
||||
// JavaScript wrapper of Debugger.
|
||||
const { Debugger } = process.electronBinding('debugger')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue