asarfuckery/electronasar/canary/browser/api/session.js

25 lines
589 B
JavaScript
Raw Normal View History

2019-06-20 21:19:08 +00:00
'use strict'
const { EventEmitter } = require('events')
const { app } = require('electron')
const { fromPartition, Session, Cookies } = process.atomBinding('session')
2019-06-16 20:19:06 +00:00
// Public API.
Object.defineProperties(exports, {
2019-06-20 21:19:08 +00:00
defaultSession: {
enumerable: true,
get () { return fromPartition('') }
},
fromPartition: {
enumerable: true,
value: fromPartition
}
})
Object.setPrototypeOf(Session.prototype, EventEmitter.prototype)
Object.setPrototypeOf(Cookies.prototype, EventEmitter.prototype)
2019-06-16 20:19:06 +00:00
Session.prototype._init = function () {
2019-06-20 21:19:08 +00:00
app.emit('session-created', this)
}