2023-02-20 20:57:38 +00:00
|
|
|
import { fetchWithSession } from '@electron/internal/browser/api/net-fetch';
|
2023-03-20 14:34:49 +00:00
|
|
|
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);
|
|
|
|
};
|
2020-05-22 19:46:22 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
fromPartition,
|
2023-03-20 14:34:49 +00:00
|
|
|
fromPath,
|
2020-05-22 19:46:22 +00:00
|
|
|
get defaultSession () {
|
|
|
|
return fromPartition('');
|
|
|
|
}
|
|
|
|
};
|