electron/lib/browser/api/session.ts

15 lines
412 B
TypeScript
Raw Normal View History

2023-02-20 20:57:38 +00:00
import { fetchWithSession } from '@electron/internal/browser/api/net-fetch';
const { fromPartition, fromPath, Session } = process._linkedBinding('electron_browser_session');
2023-02-20 20:57:38 +00:00
Session.prototype.fetch = function (input: RequestInfo, init?: RequestInit) {
return fetchWithSession(input, init, this);
};
export default {
fromPartition,
fromPath,
get defaultSession () {
return fromPartition('');
}
};