mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
feat: Allow usage of an absolute path for partitions used in a session (#37604)
* 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()
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { fetchWithSession } from '@electron/internal/browser/api/net-fetch';
|
||||
const { fromPartition, Session } = process._linkedBinding('electron_browser_session');
|
||||
const { fromPartition, fromPath, Session } = process._linkedBinding('electron_browser_session');
|
||||
|
||||
Session.prototype.fetch = function (input: RequestInfo, init?: RequestInit) {
|
||||
return fetchWithSession(input, init, this);
|
||||
@@ -7,6 +7,7 @@ Session.prototype.fetch = function (input: RequestInfo, init?: RequestInit) {
|
||||
|
||||
export default {
|
||||
fromPartition,
|
||||
fromPath,
|
||||
get defaultSession () {
|
||||
return fromPartition('');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user