From c106f3bc5159bb81d778b89e59f316131b0eb209 Mon Sep 17 00:00:00 2001 From: Daniel Bernal Date: Fri, 19 Jul 2024 17:07:30 +0200 Subject: [PATCH] Link duckPlayer host onAppear --- DuckDuckGo.xcodeproj/project.pbxproj | 2 + .../xcshareddata/swiftpm/Package.resolved | 240 +++++++++++++++--- DuckDuckGo/TabViewController.swift | 3 + 3 files changed, 207 insertions(+), 38 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index cc96638f15..5bed0eb12e 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -2506,6 +2506,7 @@ D6037E682C32F2E7009AAEC0 /* DuckPlayerSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DuckPlayerSettings.swift; sourceTree = ""; }; D60B1F262B9DDE5A00AE4760 /* SubscriptionGoogleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionGoogleView.swift; sourceTree = ""; }; D625AAEA2BBEEFC900BC189A /* TabURLInterceptorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabURLInterceptorTests.swift; sourceTree = ""; }; + D62BBD852C4AB7430093D2C7 /* content-scope-scripts */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "content-scope-scripts"; path = "../content-scope-scripts"; sourceTree = ""; }; D62EC3B82C246A5600FC9D04 /* YoutublePlayerNavigationHandlerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YoutublePlayerNavigationHandlerTests.swift; sourceTree = ""; }; D62EC3BB2C2470E000FC9D04 /* DuckPlayerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DuckPlayerTests.swift; sourceTree = ""; }; D62EC3BD2C24710F00FC9D04 /* DuckPlayerURLExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DuckPlayerURLExtensionTests.swift; sourceTree = ""; }; @@ -3732,6 +3733,7 @@ 84E341891E2F7EFB00BDBA6F = { isa = PBXGroup; children = ( + D62BBD852C4AB7430093D2C7 /* content-scope-scripts */, EE3B98EB2A963515002F63A0 /* WidgetsExtensionAlpha.entitlements */, 6FB030C7234331B400A10DB9 /* Configuration.xcconfig */, EEB8FDB92A990AEE00EBEDCF /* Configuration-Alpha.xcconfig */, diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 033d30feb9..7eb0e31a1c 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,41 +1,205 @@ { - "pins" : [ - { - "identity" : "apple-toolbox", - "kind" : "remoteSourceControl", - "location" : "https://github.com/duckduckgo/apple-toolbox.git", - "state" : { - "revision" : "0c13c5f056805f2d403618ccc3bfb833c303c68d", - "version" : "3.1.2" + "object": { + "pins": [ + { + "package": "AppleToolbox", + "repositoryURL": "https://github.com/duckduckgo/apple-toolbox.git", + "state": { + "branch": null, + "revision": "0c13c5f056805f2d403618ccc3bfb833c303c68d", + "version": "3.1.2" + } + }, + { + "package": "BareBonesBrowserKit", + "repositoryURL": "https://github.com/duckduckgo/BareBonesBrowser.git", + "state": { + "branch": null, + "revision": "31e5bfedc3c2ca005640c4bf2b6959d69b0e18b9", + "version": "0.1.0" + } + }, + { + "package": "BloomFilter", + "repositoryURL": "https://github.com/duckduckgo/bloom_cpp.git", + "state": { + "branch": null, + "revision": "8076199456290b61b4544bf2f4caf296759906a0", + "version": "3.0.0" + } + }, + { + "package": "BrowserServicesKit", + "repositoryURL": "https://github.com/DuckDuckGo/BrowserServicesKit", + "state": { + "branch": null, + "revision": "3274feb8d84fda5f27541c13f2ab428b4e77a5e2", + "version": "172.0.1" + } + }, + { + "package": "DesignResourcesKit", + "repositoryURL": "https://github.com/duckduckgo/DesignResourcesKit", + "state": { + "branch": null, + "revision": "ae83941bb277a2750abc2d6697fa278f8c8c5f5e", + "version": "3.0.0" + } + }, + { + "package": "Autofill", + "repositoryURL": "https://github.com/duckduckgo/duckduckgo-autofill.git", + "state": { + "branch": null, + "revision": "2b81745565db09eee8c1cd44d38eefa1011a9f0a", + "version": "12.0.1" + } + }, + { + "package": "GRDB", + "repositoryURL": "https://github.com/duckduckgo/GRDB.swift.git", + "state": { + "branch": null, + "revision": "9f049d7b97b1e68ffd86744b500660d34a9e79b8", + "version": "2.3.0" + } + }, + { + "package": "Gzip", + "repositoryURL": "https://github.com/1024jp/GzipSwift.git", + "state": { + "branch": null, + "revision": "731037f6cc2be2ec01562f6597c1d0aa3fe6fd05", + "version": "6.0.1" + } + }, + { + "package": "FindInPageIOSJSSupport", + "repositoryURL": "https://github.com/duckduckgo/ios-js-support", + "state": { + "branch": null, + "revision": "6a6789ac8104a587316c58af75539753853b50d9", + "version": "2.0.0" + } + }, + { + "package": "Kingfisher", + "repositoryURL": "https://github.com/onevcat/Kingfisher.git", + "state": { + "branch": null, + "revision": "2ef543ee21d63734e1c004ad6c870255e8716c50", + "version": "7.12.0" + } + }, + { + "package": "Lottie", + "repositoryURL": "https://github.com/airbnb/lottie-spm.git", + "state": { + "branch": null, + "revision": "1d29eccc24cc8b75bff9f6804155112c0ffc9605", + "version": "4.4.3" + } + }, + { + "package": "OHHTTPStubs", + "repositoryURL": "https://github.com/AliSoftware/OHHTTPStubs.git", + "state": { + "branch": null, + "revision": "12f19662426d0434d6c330c6974d53e2eb10ecd9", + "version": "9.1.0" + } + }, + { + "package": "PrivacyDashboardResources", + "repositoryURL": "https://github.com/duckduckgo/privacy-dashboard", + "state": { + "branch": null, + "revision": "348594efe2cd40ef156e915c272d02ec22f1903f", + "version": "4.2.0" + } + }, + { + "package": "Punycode", + "repositoryURL": "https://github.com/gumob/PunycodeSwift.git", + "state": { + "branch": null, + "revision": "4356ec54e073741449640d3d50a1fd24fd1e1b8b", + "version": "2.1.0" + } + }, + { + "package": "swift-argument-parser", + "repositoryURL": "https://github.com/apple/swift-argument-parser", + "state": { + "branch": null, + "revision": "0fbc8848e389af3bb55c182bc19ca9d5dc2f255b", + "version": "1.4.0" + } + }, + { + "package": "swift-syntax", + "repositoryURL": "https://github.com/apple/swift-syntax.git", + "state": { + "branch": null, + "revision": "64889f0c732f210a935a0ad7cda38f77f876262d", + "version": "509.1.1" + } + }, + { + "package": "Swifter", + "repositoryURL": "https://github.com/httpswift/swifter.git", + "state": { + "branch": null, + "revision": "9483a5d459b45c3ffd059f7b55f9638e268632fd", + "version": "1.5.0" + } + }, + { + "package": "SwiftSoup", + "repositoryURL": "https://github.com/scinfu/SwiftSoup", + "state": { + "branch": null, + "revision": "028487d4a8a291b2fe1b4392b5425b6172056148", + "version": "2.7.2" + } + }, + { + "package": "DDGSyncCrypto", + "repositoryURL": "https://github.com/duckduckgo/sync_crypto", + "state": { + "branch": null, + "revision": "2ab6ab6f0f96b259c14c2de3fc948935fc16ac78", + "version": "0.2.0" + } + }, + { + "package": "TrackerRadarKit", + "repositoryURL": "https://github.com/duckduckgo/TrackerRadarKit", + "state": { + "branch": null, + "revision": "1403e17eeeb8493b92fb9d11eb8c846bb9776581", + "version": "2.1.2" + } + }, + { + "package": "WireGuardKit", + "repositoryURL": "https://github.com/duckduckgo/wireguard-apple", + "state": { + "branch": null, + "revision": "13fd026384b1af11048451061cc1b21434990668", + "version": "1.1.3" + } + }, + { + "package": "ZIPFoundation", + "repositoryURL": "https://github.com/weichsel/ZIPFoundation.git", + "state": { + "branch": null, + "revision": "02b6abe5f6eef7e3cbd5f247c5cc24e246efcfe0", + "version": "0.9.19" + } } - }, - { - "identity" : "designresourceskit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/duckduckgo/DesignResourcesKit", - "state" : { - "revision" : "ae83941bb277a2750abc2d6697fa278f8c8c5f5e", - "version" : "3.0.0" - } - }, - { - "identity" : "swift-argument-parser", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-argument-parser", - "state" : { - "revision" : "0fbc8848e389af3bb55c182bc19ca9d5dc2f255b", - "version" : "1.4.0" - } - }, - { - "identity" : "swift-syntax", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-syntax.git", - "state" : { - "revision" : "64889f0c732f210a935a0ad7cda38f77f876262d", - "version" : "509.1.1" - } - } - ], - "version" : 2 + ] + }, + "version": 1 } diff --git a/DuckDuckGo/TabViewController.swift b/DuckDuckGo/TabViewController.swift index 5f3aa279e8..da5b981d51 100644 --- a/DuckDuckGo/TabViewController.swift +++ b/DuckDuckGo/TabViewController.swift @@ -408,6 +408,9 @@ class TabViewController: UIViewController { resetNavigationBar() delegate?.tabDidRequestShowingMenuHighlighter(tab: self) tabModel.viewed = true + + // Link DuckPlayer to current Tab + duckPlayerNavigationHandler.duckPlayer.setHostViewController(self) } override func buildActivities() -> [UIActivity] {