From 6473b1f6ca0a3d26ddf1668ebb2e637aa5b22b3a Mon Sep 17 00:00:00 2001 From: nerodesu017 <46645625+nerodesu017@users.noreply.github.com> Date: Thu, 24 Apr 2025 00:02:31 +0300 Subject: [PATCH] fix: cookie fetch missing function --- src/objc/ModalWebViewController.mm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/objc/ModalWebViewController.mm b/src/objc/ModalWebViewController.mm index 3a3a277..2b1e3c0 100644 --- a/src/objc/ModalWebViewController.mm +++ b/src/objc/ModalWebViewController.mm @@ -105,6 +105,19 @@ - (void)getBrowserCookiesForCurrentUrlWithCompletion:(void (^)(NSDictionary *))c }]; } +- (NSDictionary *)getBrowserCookiesForCurrentUrl { + __block NSDictionary *result = nil; + dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); + + [self getBrowserCookiesForCurrentUrlWithCompletion:^(NSDictionary *cookies) { + result = cookies; + dispatch_semaphore_signal(semaphore); + }]; + + dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); + return result; +} + - (void)updateCapturedCookiesWithCompletion:(void (^)(void))completion { WKHTTPCookieStore *cookieStore = self.webView.configuration.websiteDataStore.httpCookieStore;