From 802fca28f72144ac65da92fe70f1e73f7226f551 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 16 Jun 2016 16:23:08 -0700 Subject: [PATCH] Setup protocol after ready has already fired --- lib/browser/api/protocol.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/browser/api/protocol.js b/lib/browser/api/protocol.js index 4daf4ed..1f72924 100644 --- a/lib/browser/api/protocol.js +++ b/lib/browser/api/protocol.js @@ -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) +} -- 2.7.4