mirror of
https://github.com/electron/electron.git
synced 2026-02-18 02:51:53 -05:00
feat: add session.storagePath to get path on disk for session data (#28665)
This commit is contained in:
@@ -964,6 +964,13 @@ v8::Local<v8::Promise> Session::CloseAllConnections() {
|
||||
return handle;
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> Session::GetPath(v8::Isolate* isolate) {
|
||||
if (browser_context_->IsOffTheRecord()) {
|
||||
return v8::Null(isolate);
|
||||
}
|
||||
return gin::ConvertToV8(isolate, browser_context_->GetPath());
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
|
||||
base::Value Session::GetSpellCheckerLanguages() {
|
||||
return browser_context_->prefs()
|
||||
@@ -1188,11 +1195,13 @@ gin::ObjectTemplateBuilder Session::GetObjectTemplateBuilder(
|
||||
#endif
|
||||
.SetMethod("preconnect", &Session::Preconnect)
|
||||
.SetMethod("closeAllConnections", &Session::CloseAllConnections)
|
||||
.SetMethod("getStoragePath", &Session::GetPath)
|
||||
.SetProperty("cookies", &Session::Cookies)
|
||||
.SetProperty("netLog", &Session::NetLog)
|
||||
.SetProperty("protocol", &Session::Protocol)
|
||||
.SetProperty("serviceWorkers", &Session::ServiceWorkerContext)
|
||||
.SetProperty("webRequest", &Session::WebRequest);
|
||||
.SetProperty("webRequest", &Session::WebRequest)
|
||||
.SetProperty("storagePath", &Session::GetPath);
|
||||
}
|
||||
|
||||
const char* Session::GetTypeName() {
|
||||
|
||||
@@ -124,6 +124,7 @@ class Session : public gin::Wrappable<Session>,
|
||||
v8::Local<v8::Value> NetLog(v8::Isolate* isolate);
|
||||
void Preconnect(const gin_helper::Dictionary& options, gin::Arguments* args);
|
||||
v8::Local<v8::Promise> CloseAllConnections();
|
||||
v8::Local<v8::Value> GetPath(v8::Isolate* isolate);
|
||||
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
|
||||
base::Value GetSpellCheckerLanguages();
|
||||
void SetSpellCheckerLanguages(gin_helper::ErrorThrower thrower,
|
||||
|
||||
Reference in New Issue
Block a user