Merge pull request #13050 from electron/3.0.0-deprecations

chore: removal of 3.0.0 deprecations
This commit is contained in:
Charles Kerr 2018-05-30 09:25:36 +02:00 committed by GitHub
commit b89fe86fa1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 76 additions and 421 deletions

View file

@ -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

View file

@ -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)
}
}

View file

@ -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

View file

@ -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) {

View file

@ -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
}