From 7fc572a582800a25866d762221b6c2fffa4cefd5 Mon Sep 17 00:00:00 2001 From: Kyle Hickinson Date: Thu, 26 Feb 2026 16:20:55 -0500 Subject: [PATCH] [iOS] Expose the associated profile in BraveWebViewConfiguration (#34227) --- ios/browser/api/web_view/brave_web_view_configuration.h | 3 +++ ios/browser/api/web_view/brave_web_view_configuration.mm | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/ios/browser/api/web_view/brave_web_view_configuration.h b/ios/browser/api/web_view/brave_web_view_configuration.h index e73fc48f69f..5605f49cdd4 100644 --- a/ios/browser/api/web_view/brave_web_view_configuration.h +++ b/ios/browser/api/web_view/brave_web_view_configuration.h @@ -19,6 +19,9 @@ NS_ASSUME_NONNULL_BEGIN CWV_EXPORT @interface BraveWebViewConfiguration : CWVWebViewConfiguration +/// The profile associated with this web view configuration +@property(readonly) id profile; + /// Exposes the website data store associated with the WKWebViewConfiguration /// /// Note: Usage of this should be limited to when the diff --git a/ios/browser/api/web_view/brave_web_view_configuration.mm b/ios/browser/api/web_view/brave_web_view_configuration.mm index 137de65128a..bbc66081f93 100644 --- a/ios/browser/api/web_view/brave_web_view_configuration.mm +++ b/ios/browser/api/web_view/brave_web_view_configuration.mm @@ -25,6 +25,11 @@ CWVAutofillDataManager* _autofillDataManager; } +- (id)profile { + auto* profile = ProfileIOS::FromBrowserState(self.browserState); + return [[ProfileBridgeImpl alloc] initWithProfile:profile]; +} + - (WKWebsiteDataStore*)websiteDataStore { DCHECK(base::FeatureList::IsEnabled( brave::features::kUseProfileWebViewConfiguration))