diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 228f4dc98d..55cc722fcc 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -9225,7 +9225,7 @@ repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 98.0.1; + version = 99.0.0; }; }; C14882EB27F211A000D59F0C /* XCRemoteSwiftPackageReference "SwiftSoup" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7b794ad4d2..cdee4384e6 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/DuckDuckGo/BrowserServicesKit", "state" : { - "revision" : "ea133abe237b6cb57a4237e0373318a40c10afc2", - "version" : "98.0.1" + "revision" : "2c1c2bb0aad5a23524e298fa9bea9b890ae43e23", + "version" : "99.0.0" } }, { @@ -122,8 +122,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser", "state" : { - "revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41", - "version" : "1.3.0" + "revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531", + "version" : "1.2.3" } }, { diff --git a/DuckDuckGo/TabViewController.swift b/DuckDuckGo/TabViewController.swift index d798fb9502..05f59ce06b 100644 --- a/DuckDuckGo/TabViewController.swift +++ b/DuckDuckGo/TabViewController.swift @@ -426,16 +426,16 @@ class TabViewController: UIViewController { if consumeCookies { consumeCookiesThenLoadRequest(request) - } else if let url = request?.url { + } else if let urlRequest = request { var loadingStopped = false - linkProtection.getCleanURL(from: url, onStartExtracting: { [weak self] in + linkProtection.getCleanURLRequest(from: urlRequest, onStartExtracting: { [weak self] in if loadingInitiatedByParentTab { // stop parent-initiated URL loading only if canonical URL extraction process has started loadingStopped = true self?.webView.stopLoading() } self?.showProgressIndicator() - }, onFinishExtracting: {}, completion: { [weak self] cleanURL in + }, onFinishExtracting: {}, completion: { [weak self] cleanURLRequest in // restart the cleaned-up URL loading here if: // link protection provided an updated URL // OR if loading was stopped for a popup loaded by its parent @@ -443,8 +443,8 @@ class TabViewController: UIViewController { // the check is here to let an (about:blank) popup which has its loading // initiated by its parent to keep its active request, otherwise we would // break a js-initiated popup request such as printing from a popup - guard url != cleanURL || loadingStopped || !loadingInitiatedByParentTab else { return } - self?.load(urlRequest: .userInitiated(cleanURL)) + guard self?.url != cleanURLRequest.url || loadingStopped || !loadingInitiatedByParentTab else { return } + self?.load(urlRequest: cleanURLRequest) }) } @@ -488,7 +488,7 @@ class TabViewController: UIViewController { webView.evaluateJavaScript(js) } } - + public func load(url: URL) { webView.stopLoading() dismissJSAlertIfNeeded() @@ -551,6 +551,7 @@ class TabViewController: UIViewController { } webView.stopLoading() + dismissJSAlertIfNeeded() webView.load(urlRequest) } @@ -1351,16 +1352,9 @@ extension TabViewController: WKNavigationDelegate { navigationAction: navigationAction, onStartExtracting: { showProgressIndicator() }, onFinishExtracting: { }, - onLinkRewrite: { [weak self] newURL, navigationAction in + onLinkRewrite: { [weak self] newRequest, _ in guard let self = self else { return } - if self.isNewTargetBlankRequest(navigationAction: navigationAction) { - self.delegate?.tab(self, - didRequestNewTabForUrl: newURL, - openedByPage: true, - inheritingAttribution: self.adClickAttributionLogic.state) - } else { - self.load(url: newURL) - } + self.load(urlRequest: newRequest) }, policyDecisionHandler: decisionHandler) diff --git a/LocalPackages/DuckUI/Package.swift b/LocalPackages/DuckUI/Package.swift index b0fc39d008..7b9e1f4987 100644 --- a/LocalPackages/DuckUI/Package.swift +++ b/LocalPackages/DuckUI/Package.swift @@ -31,7 +31,7 @@ let package = Package( targets: ["DuckUI"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "98.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "99.0.0"), ], targets: [ .target( diff --git a/LocalPackages/SyncUI/Package.swift b/LocalPackages/SyncUI/Package.swift index ca3dec90e6..7a2a869f10 100644 --- a/LocalPackages/SyncUI/Package.swift +++ b/LocalPackages/SyncUI/Package.swift @@ -32,7 +32,7 @@ let package = Package( ], dependencies: [ .package(path: "../DuckUI"), - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "98.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "99.0.0"), .package(url: "https://github.com/duckduckgo/DesignResourcesKit", exact: "2.0.0") ], targets: [ diff --git a/LocalPackages/Waitlist/Package.swift b/LocalPackages/Waitlist/Package.swift index 33f974ec7d..836bd7a045 100644 --- a/LocalPackages/Waitlist/Package.swift +++ b/LocalPackages/Waitlist/Package.swift @@ -15,7 +15,7 @@ let package = Package( targets: ["Waitlist", "WaitlistMocks"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "98.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "99.0.0"), .package(url: "https://github.com/duckduckgo/DesignResourcesKit", exact: "2.0.0") ], targets: [