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))