deprecate app.allowNTLMCredentialsForAllDomains

This commit is contained in:
deepak1556 2016-05-23 10:59:55 +05:30
parent 62cad610e0
commit f68d0f324f
5 changed files with 55 additions and 14 deletions

View file

@ -1,6 +1,6 @@
'use strict'
const {Menu} = require('electron')
const {deprecate, Menu, session} = require('electron')
const {EventEmitter} = require('events')
const bindings = process.atomBinding('app')
@ -22,9 +22,6 @@ Object.assign(app, {
commandLine: {
appendSwitch: bindings.appendSwitch,
appendArgument: bindings.appendArgument
},
allowNTLMCredentialsForAllDomains () {
this.commandLine.appendSwitch('auth-server-whitelist', '*')
}
})
@ -44,6 +41,18 @@ if (process.platform === 'darwin') {
}
}
app.allowNTLMCredentialsForAllDomains = function (allow) {
if (!process.noDeprecations) {
deprecate.warn('app.allowNTLMCredentialsForAllDomains', 'session.allowNTLMCredentialsForDomains')
}
let domains = allow ? '*' : ''
if (!this.isReady()) {
this.commandLine.appendSwitch('auth-server-whitelist', domains)
} else {
session.defaultSession.allowNTLMCredentialsForDomains(domains)
}
}
// Routes the events to webContents.
const events = ['login', 'certificate-error', 'select-client-certificate']
for (let name of events) {