Move the warning of registerStandardSchemes to native code

This commit is contained in:
Cheng Zhao 2016-07-12 16:51:31 +09:00
parent 13e1818bf7
commit 4ebb83e999
2 changed files with 9 additions and 8 deletions

View file

@ -1,13 +1,7 @@
const {app, session} = require('electron')
const {registerStandardSchemes} = process.atomBinding('protocol')
exports.registerStandardSchemes = function (schemes) {
if (app.isReady()) {
console.warn('protocol.registerStandardSchemes should be called before app is ready')
return
}
registerStandardSchemes(schemes)
}
exports.registerStandardSchemes = registerStandardSchemes
const setupProtocol = function () {
let protocol = session.defaultSession.protocol