session.ts 412 B

1234567891011121314
  1. import { fetchWithSession } from '@electron/internal/browser/api/net-fetch';
  2. const { fromPartition, fromPath, Session } = process._linkedBinding('electron_browser_session');
  3. Session.prototype.fetch = function (input: RequestInfo, init?: RequestInit) {
  4. return fetchWithSession(input, init, this);
  5. };
  6. export default {
  7. fromPartition,
  8. fromPath,
  9. get defaultSession () {
  10. return fromPartition('');
  11. }
  12. };