зеркало из https://github.com/electron/electron.git
register extension handler for every session created
This commit is contained in:
Родитель
ebff40b5a5
Коммит
cb5e648502
|
@ -10,7 +10,9 @@ const fromPartition = function (partition, persist) {
|
|||
throw new Error('session module can only be used when app is ready')
|
||||
}
|
||||
|
||||
return bindings.fromPartition(partition, persist)
|
||||
let session = bindings.fromPartition(partition, persist)
|
||||
process.emit('session-created', session)
|
||||
return session
|
||||
}
|
||||
|
||||
// Returns the Session from |partition| string.
|
||||
|
|
|
@ -280,10 +280,12 @@ app.once('ready', function () {
|
|||
}
|
||||
})
|
||||
}
|
||||
protocol.registerBufferProtocol('chrome-extension', chromeExtensionHandler, function (error) {
|
||||
if (error) {
|
||||
console.error(`Unable to register chrome-extension protocol: ${error}`)
|
||||
}
|
||||
process.on('session-created', function (session) {
|
||||
session.protocol.registerBufferProtocol('chrome-extension', chromeExtensionHandler, function (error) {
|
||||
if (error) {
|
||||
console.error(`Unable to register chrome-extension protocol: ${error}`)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// Load persisted extensions.
|
||||
|
|
Загрузка…
Ссылка в новой задаче