feat: promisify protocol.isProtocolHandled() (#16423)
* feat: promisify protocol * fix base::Bind and specs * update documentation * make callback-compatible * async awaitify tests
This commit is contained in:
parent
32d98851bc
commit
1f2b02c18f
7 changed files with 65 additions and 66 deletions
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { app } = require('electron')
|
||||
const { app, deprecate } = require('electron')
|
||||
const { fromPartition, Session, Cookies } = process.atomBinding('session')
|
||||
|
||||
// Public API.
|
||||
|
@ -20,5 +20,6 @@ Object.setPrototypeOf(Session.prototype, EventEmitter.prototype)
|
|||
Object.setPrototypeOf(Cookies.prototype, EventEmitter.prototype)
|
||||
|
||||
Session.prototype._init = function () {
|
||||
this.protocol.isProtocolHandled = deprecate.promisify(this.protocol.isProtocolHandled, 1)
|
||||
app.emit('session-created', this)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue