Setup protocol after ready has already fired
This commit is contained in:
parent
a6e3eeee2d
commit
802fca28f7
1 changed files with 8 additions and 2 deletions
|
@ -9,9 +9,15 @@ exports.registerStandardSchemes = function (schemes) {
|
|||
registerStandardSchemes(schemes)
|
||||
}
|
||||
|
||||
app.once('ready', function () {
|
||||
const setupProtocol = function () {
|
||||
let protocol = session.defaultSession.protocol
|
||||
for (let method in protocol) {
|
||||
exports[method] = protocol[method].bind(protocol)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (app.isReady()) {
|
||||
setupProtocol()
|
||||
} else {
|
||||
app.once('ready', setupProtocol)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue