mirror of
https://github.com/electron/electron.git
synced 2026-01-24 14:57:58 -05:00
Setup protocol after ready has already fired
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user