e0c348a2f8
* Allow an absolute path to be used for creating sessions Allows an absolute path to be used for creating sessions by adding the session.fromPath() API. * Fixup! Clarify that an emptry string is not permitted as a parameter to fromPath()
14 lines
412 B
TypeScript
14 lines
412 B
TypeScript
import { fetchWithSession } from '@electron/internal/browser/api/net-fetch';
|
|
const { fromPartition, fromPath, Session } = process._linkedBinding('electron_browser_session');
|
|
|
|
Session.prototype.fetch = function (input: RequestInfo, init?: RequestInit) {
|
|
return fetchWithSession(input, init, this);
|
|
};
|
|
|
|
export default {
|
|
fromPartition,
|
|
fromPath,
|
|
get defaultSession () {
|
|
return fromPartition('');
|
|
}
|
|
};
|