session·续2

A String[] array which consists of all the known available spell checker languages. Providing a language code to the setSpellCheckerLanaguages API that isn’t in this array will result in an error.

ses.cookies Readonly

A Cookies object for this session.

ses.webRequest Readonly

A WebRequest object for this session.

ses.protocol Readonly

A Protocol object for this session.

const { app, session } = require('electron')const path = require('path')app.on('ready', function () {  const protocol = session.fromPartition('some-partition').protocol  protocol.registerFileProtocol('atom', function (request, callback) {    var url = request.url.substr(7)    callback({ path: path.normalize(`${__dirname}/${url}`) })  }, function (error) {    if (error) console.error('Failed to register protocol')  })})

ses.netLog Readonly

A NetLog object for this session.

const { app, session } = require('electron')app.on('ready', async function () {  const netLog = session.fromPartition('some-partition').netLog  netLog.startLogging('/path/to/net-log')  // After some network events  const path = await netLog.stopLogging()  console.log('Net-logs written to', path)})