electron/lib/browser/api/protocol.js
Cheng Zhao ab3122ef2a No need to keep the deprecated APIs
They will be removed in next release.
2016-05-10 09:53:35 +09:00

16 lines
504 B
JavaScript

const app = require('electron').app
const {createProtocolObject, registerStandardSchemes} = process.atomBinding('protocol')
exports.registerStandardSchemes = function (schemes) {
if (app.isReady()) {
throw new Error('protocol.registerStandardSchemes should be called before app is ready')
}
registerStandardSchemes(schemes)
}
app.once('ready', function () {
let protocol = createProtocolObject()
for (let method in protocol) {
exports[method] = protocol[method].bind(protocol)
}
})