Merge pull request #13050 from electron/3.0.0-deprecations
chore: removal of 3.0.0 deprecations
This commit is contained in:
commit
b89fe86fa1
32 changed files with 76 additions and 421 deletions
|
@ -1,17 +1,8 @@
|
|||
const {EventEmitter} = require('events')
|
||||
const {deprecate} = require('electron')
|
||||
const {screen, Screen} = process.atomBinding('screen')
|
||||
|
||||
// Screen is an EventEmitter.
|
||||
Object.setPrototypeOf(Screen.prototype, EventEmitter.prototype)
|
||||
EventEmitter.call(screen)
|
||||
|
||||
const nativeFn = screen.getMenuBarHeight
|
||||
screen.getMenuBarHeight = function () {
|
||||
if (!process.noDeprecations) {
|
||||
deprecate.warn('screen.getMenuBarHeight', 'screen.getPrimaryDisplay().workArea')
|
||||
}
|
||||
return nativeFn.call(this)
|
||||
}
|
||||
|
||||
module.exports = screen
|
||||
|
|
|
@ -20,18 +20,3 @@ Object.setPrototypeOf(Cookies.prototype, EventEmitter.prototype)
|
|||
Session.prototype._init = function () {
|
||||
app.emit('session-created', this)
|
||||
}
|
||||
|
||||
Session.prototype.setCertificateVerifyProc = function (verifyProc) {
|
||||
if (verifyProc != null && verifyProc.length > 2) {
|
||||
// TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings
|
||||
this._setCertificateVerifyProc(({hostname, certificate, verificationResult}, cb) => {
|
||||
verifyProc(hostname, certificate, (result) => {
|
||||
// Disabled due to false positive in StandardJS
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
cb(result ? 0 : -2)
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this._setCertificateVerifyProc(verifyProc)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,6 @@
|
|||
const {EventEmitter} = require('events')
|
||||
const {deprecate} = require('electron')
|
||||
const {Tray} = process.atomBinding('tray')
|
||||
|
||||
Object.setPrototypeOf(Tray.prototype, EventEmitter.prototype)
|
||||
|
||||
// TODO(codebytere): remove in 3.0
|
||||
const nativeSetHighlightMode = Tray.prototype.setHighlightMode
|
||||
Tray.prototype.setHighlightMode = function (param) {
|
||||
if (!process.noDeprecations && typeof param === 'boolean') {
|
||||
if (param) {
|
||||
deprecate.warn('tray.setHighlightMode(true)', `tray.setHighlightMode("on")`)
|
||||
} else {
|
||||
deprecate.warn('tray.setHighlightMode(false)', `tray.setHighlightMode("off")`)
|
||||
}
|
||||
}
|
||||
return nativeSetHighlightMode.call(this, param)
|
||||
}
|
||||
|
||||
module.exports = Tray
|
||||
|
|
|
@ -165,14 +165,6 @@ for (const method of webFrameMethodsWithResult) {
|
|||
}
|
||||
}
|
||||
|
||||
const nativeOpenDevTools = WebContents.prototype.openDevTools
|
||||
WebContents.prototype.openDevTools = function (params) {
|
||||
if (!process.noDeprecations && params && 'detach' in params) {
|
||||
deprecate.warn('webContents.openDevTools({detach: true})', `webContents.openDevTools({mode: 'detach'})`)
|
||||
}
|
||||
return nativeOpenDevTools.call(this, params)
|
||||
}
|
||||
|
||||
// Make sure WebContents::executeJavaScript would run the code only when the
|
||||
// WebContents has been loaded.
|
||||
WebContents.prototype.executeJavaScript = function (code, hasUserGesture, callback) {
|
||||
|
|
|
@ -217,7 +217,7 @@ const attachGuest = function (event, elementInstanceId, guestInstanceId, params)
|
|||
plugins: params.plugins,
|
||||
zoomFactor: embedder._getZoomFactor(),
|
||||
webSecurity: !params.disablewebsecurity,
|
||||
blinkFeatures: params.blinkfeatures,
|
||||
enableBlinkFeatures: params.blinkfeatures,
|
||||
disableBlinkFeatures: params.disableblinkfeatures
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue