diff --git a/atom/browser/api/atom_api_session.cc b/atom/browser/api/atom_api_session.cc index 115fc87a94..51c363b238 100644 --- a/atom/browser/api/atom_api_session.cc +++ b/atom/browser/api/atom_api_session.cc @@ -592,6 +592,16 @@ bool Session::Equal(Session* session) const { #endif } +bool Session::IsOffTheRecord() const { + brave::BraveBrowserContext* brave_browser_context = + brave::BraveBrowserContext::FromBrowserContext(profile_); + if (brave_browser_context->IsOffTheRecord()) + return true; + if (brave_browser_context->IsIsolatedStorage()) + return true; + return false; +} + // static mate::Handle Session::CreateFrom( v8::Isolate* isolate, content::BrowserContext* browser_context) { @@ -649,6 +659,7 @@ void Session::BuildPrototype(v8::Isolate* isolate, &Session::AllowNTLMCredentialsForDomains) .SetMethod("setEnableBrotli", &Session::SetEnableBrotli) .SetMethod("equal", &Session::Equal) + .SetMethod("isOffTheRecord", &Session::IsOffTheRecord) .SetProperty("partition", &Session::Partition) .SetProperty("contentSettings", &Session::ContentSettings) .SetProperty("userPrefs", &Session::UserPrefs) diff --git a/atom/browser/api/atom_api_session.h b/atom/browser/api/atom_api_session.h index ac0d579fe1..207caec241 100644 --- a/atom/browser/api/atom_api_session.h +++ b/atom/browser/api/atom_api_session.h @@ -92,6 +92,7 @@ class Session: public mate::TrackableObject, v8::Local SpellChecker(v8::Isolate* isolate); v8::Local Extensions(v8::Isolate* isolate); bool Equal(Session* session) const; + bool IsOffTheRecord() const; protected: Session(v8::Isolate* isolate, Profile* browser_context);