diff --git a/Core/FeatureFlag.swift b/Core/FeatureFlag.swift index f5c96b04ad..e7e9b9165b 100644 --- a/Core/FeatureFlag.swift +++ b/Core/FeatureFlag.swift @@ -35,6 +35,7 @@ public enum FeatureFlag: String { case networkProtectionWaitlistAccess case networkProtectionWaitlistActive case subscription + case autoconsentOnByDefault } extension FeatureFlag: FeatureFlagSourceProviding { @@ -64,6 +65,8 @@ extension FeatureFlag: FeatureFlagSourceProviding { return .remoteReleasable(.subfeature(AutofillSubfeature.onByDefault)) case .incontextSignup: return .remoteReleasable(.feature(.incontextSignup)) + case .autoconsentOnByDefault: + return .remoteReleasable(.subfeature(AutoconsentSubfeature.onByDefault)) } } } diff --git a/Core/PixelEvent.swift b/Core/PixelEvent.swift index babb0b9179..a94d9a0693 100644 --- a/Core/PixelEvent.swift +++ b/Core/PixelEvent.swift @@ -119,9 +119,6 @@ extension Pixel { case daxDialogsFireEducationShown case daxDialogsFireEducationConfirmed case daxDialogsFireEducationCancelled - case daxDialogsAutoconsentShown - case daxDialogsAutoconsentConfirmed - case daxDialogsAutoconsentCancelled case defaultBrowserButtonPressedSettings @@ -624,9 +621,6 @@ extension Pixel.Event { case .daxDialogsFireEducationShown: return "m_dx_fe_s" case .daxDialogsFireEducationConfirmed: return "m_dx_fe_co" case .daxDialogsFireEducationCancelled: return "m_dx_fe_ca" - case .daxDialogsAutoconsentShown: return "m_dax_dialog_autoconsent_shown" - case .daxDialogsAutoconsentConfirmed: return "m_dax_dialog_autoconsent_confirmed" - case .daxDialogsAutoconsentCancelled: return "m_dax_dialog_autoconsent_cancelled" case .defaultBrowserButtonPressedSettings: return "m_db_s" diff --git a/Core/UserDefaultsPropertyWrapper.swift b/Core/UserDefaultsPropertyWrapper.swift index 850a3a9738..bf12cc003f 100644 --- a/Core/UserDefaultsPropertyWrapper.swift +++ b/Core/UserDefaultsPropertyWrapper.swift @@ -87,7 +87,6 @@ public struct UserDefaultsWrapper { case voiceSearchEnabled = "com.duckduckgo.app.voiceSearchEnabled" - case autoconsentPromptSeen = "com.duckduckgo.ios.autoconsentPromptSeen" case autoconsentEnabled = "com.duckduckgo.ios.autoconsentEnabled" case shouldScheduleRulesCompilationOnAppLaunch = "com.duckduckgo.ios.shouldScheduleRulesCompilationOnAppLaunch" diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 65e4fbbd35..92de8d38f0 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -105,17 +105,12 @@ 1CB7B82123CEA1F800AA24EA /* DateExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CB7B82023CEA1F800AA24EA /* DateExtension.swift */; }; 1CB7B82323CEA28300AA24EA /* DateExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CB7B82223CEA28300AA24EA /* DateExtensionTests.swift */; }; 1E016AB42949FEB500F21625 /* OmniBarNotificationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E016AB32949FEB500F21625 /* OmniBarNotificationViewModel.swift */; }; - 1E016AB6294A5EB100F21625 /* CustomDaxDialog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E016AB5294A5EB100F21625 /* CustomDaxDialog.swift */; }; 1E05D1D629C46EBB00BF9A1F /* DailyPixel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E05D1D529C46EBB00BF9A1F /* DailyPixel.swift */; }; 1E05D1D829C46EDA00BF9A1F /* TimedPixel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E05D1D729C46EDA00BF9A1F /* TimedPixel.swift */; }; 1E05D1DB29C47B3300BF9A1F /* DailyPixelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E05D1D929C47B2B00BF9A1F /* DailyPixelTests.swift */; }; 1E0A75EA27A2FBD000A2BFB6 /* Downloads.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1E0A75E927A2FBD000A2BFB6 /* Downloads.storyboard */; }; 1E162605296840D80004127F /* Triangle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E162604296840D80004127F /* Triangle.swift */; }; 1E1626072968413B0004127F /* ViewExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E1626062968413B0004127F /* ViewExtension.swift */; }; - 1E16260B296845120004127F /* cookie-banner-illustration-animated.json in Resources */ = {isa = PBXBuildFile; fileRef = 1E162609296845120004127F /* cookie-banner-illustration-animated.json */; }; - 1E16260C296845120004127F /* cookie-banner-illustration-animated-dark.json in Resources */ = {isa = PBXBuildFile; fileRef = 1E16260A296845120004127F /* cookie-banner-illustration-animated-dark.json */; }; - 1E162610296C5C630004127F /* CustomDaxDialogViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E16260F296C5C630004127F /* CustomDaxDialogViewModel.swift */; }; - 1E162613296C62820004127F /* CookieConsentDaxDialogViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E162612296C62820004127F /* CookieConsentDaxDialogViewModel.swift */; }; 1E162615296D910F0004127F /* cookie-icon-animated-40-dark.json in Resources */ = {isa = PBXBuildFile; fileRef = 1E162614296D910F0004127F /* cookie-icon-animated-40-dark.json */; }; 1E1D8B5D2994FFE100C96994 /* AutoconsentMessageProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E1D8B5C2994FFE100C96994 /* AutoconsentMessageProtocolTests.swift */; }; 1E1D8B6129950FD200C96994 /* AutoconsentBackgroundTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E1D8B6029950FD200C96994 /* AutoconsentBackgroundTests.swift */; }; @@ -1210,17 +1205,12 @@ 1CB7B82023CEA1F800AA24EA /* DateExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateExtension.swift; sourceTree = ""; }; 1CB7B82223CEA28300AA24EA /* DateExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateExtensionTests.swift; sourceTree = ""; }; 1E016AB32949FEB500F21625 /* OmniBarNotificationViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OmniBarNotificationViewModel.swift; sourceTree = ""; }; - 1E016AB5294A5EB100F21625 /* CustomDaxDialog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomDaxDialog.swift; sourceTree = ""; }; 1E05D1D529C46EBB00BF9A1F /* DailyPixel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DailyPixel.swift; sourceTree = ""; }; 1E05D1D729C46EDA00BF9A1F /* TimedPixel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimedPixel.swift; sourceTree = ""; }; 1E05D1D929C47B2B00BF9A1F /* DailyPixelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DailyPixelTests.swift; sourceTree = ""; }; 1E0A75E927A2FBD000A2BFB6 /* Downloads.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Downloads.storyboard; sourceTree = ""; }; 1E162604296840D80004127F /* Triangle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Triangle.swift; sourceTree = ""; }; 1E1626062968413B0004127F /* ViewExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewExtension.swift; sourceTree = ""; }; - 1E162609296845120004127F /* cookie-banner-illustration-animated.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "cookie-banner-illustration-animated.json"; sourceTree = ""; }; - 1E16260A296845120004127F /* cookie-banner-illustration-animated-dark.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "cookie-banner-illustration-animated-dark.json"; sourceTree = ""; }; - 1E16260F296C5C630004127F /* CustomDaxDialogViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomDaxDialogViewModel.swift; sourceTree = ""; }; - 1E162612296C62820004127F /* CookieConsentDaxDialogViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CookieConsentDaxDialogViewModel.swift; sourceTree = ""; }; 1E162614296D910F0004127F /* cookie-icon-animated-40-dark.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "cookie-icon-animated-40-dark.json"; sourceTree = ""; }; 1E1D8B5C2994FFE100C96994 /* AutoconsentMessageProtocolTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoconsentMessageProtocolTests.swift; sourceTree = ""; }; 1E1D8B6029950FD200C96994 /* AutoconsentBackgroundTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoconsentBackgroundTests.swift; sourceTree = ""; }; @@ -3095,16 +3085,6 @@ name = AppTPBreakageForm; sourceTree = ""; }; - 1E16260029683B4D0004127F /* CustomDaxDialog */ = { - isa = PBXGroup; - children = ( - 1E1626082968418F0004127F /* Animations */, - 1E162611296C62350004127F /* Model */, - 1E016AB5294A5EB100F21625 /* CustomDaxDialog.swift */, - ); - name = CustomDaxDialog; - sourceTree = ""; - }; 1E162603296840790004127F /* SwiftUI */ = { isa = PBXGroup; children = ( @@ -3116,24 +3096,6 @@ name = SwiftUI; sourceTree = ""; }; - 1E1626082968418F0004127F /* Animations */ = { - isa = PBXGroup; - children = ( - 1E16260A296845120004127F /* cookie-banner-illustration-animated-dark.json */, - 1E162609296845120004127F /* cookie-banner-illustration-animated.json */, - ); - name = Animations; - sourceTree = ""; - }; - 1E162611296C62350004127F /* Model */ = { - isa = PBXGroup; - children = ( - 1E16260F296C5C630004127F /* CustomDaxDialogViewModel.swift */, - 1E162612296C62820004127F /* CookieConsentDaxDialogViewModel.swift */, - ); - name = Model; - sourceTree = ""; - }; 1E162616296D962A0004127F /* Model */ = { isa = PBXGroup; children = ( @@ -4941,7 +4903,6 @@ F11CEF581EBB66C80088E4D7 /* Tutorials */ = { isa = PBXGroup; children = ( - 1E16260029683B4D0004127F /* CustomDaxDialog */, 858650CF2469BCC100C36F8A /* DaxOnboarding */, 85EE7F53224667C3000FE757 /* WebContainer */, 85C11E4A209084DE00BFFEB4 /* HomeRow */, @@ -6085,7 +6046,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1E16260C296845120004127F /* cookie-banner-illustration-animated-dark.json in Resources */, AA4D6A8D23DE49A5007E8790 /* AppIconBlack40x40@3x.png in Resources */, F47E53DB250A9A1C0037C686 /* Onboarding.xcassets in Resources */, AA4D6ACC23DE4D27007E8790 /* AppIconPurple60x60@2x.png in Resources */, @@ -6148,7 +6108,6 @@ 85A313972028E78A00327D00 /* release_notes.txt in Resources */, 9865DFFD22A84CF300D27829 /* FavoriteHomeCell.xib in Resources */, 1EE411FE2858B9300003FE64 /* dark-shield.json in Resources */, - 1E16260B296845120004127F /* cookie-banner-illustration-animated.json in Resources */, AA4D6AD323DE4D27007E8790 /* AppIconPurple29x29@2x.png in Resources */, AA4D6AA123DE4CC4007E8790 /* AppIconBlue60x60@3x.png in Resources */, 984147A824F0259000362052 /* Onboarding.storyboard in Resources */, @@ -6531,7 +6490,6 @@ D664C7C72B289AA200CBFA76 /* PurchaseInProgressView.swift in Sources */, D6E83C122B1E6AB3006C8AFB /* SettingsView.swift in Sources */, F1668BCE1E798081008CBA04 /* BookmarksViewController.swift in Sources */, - 1E162610296C5C630004127F /* CustomDaxDialogViewModel.swift in Sources */, 8590CB69268A4E190089F6BF /* DebugEtagStorage.swift in Sources */, D6D12CA62B291CAA0054390C /* AppStoreRestoreFlow.swift in Sources */, C1CDA3162AFB9C7F006D1476 /* AutofillNeverPromptWebsitesManager.swift in Sources */, @@ -6769,7 +6727,6 @@ 98DA6ECA2181E41F00E65433 /* ThemeManager.swift in Sources */, C159DF072A430B60007834BB /* EmailSignupViewController.swift in Sources */, 37A6A8FE2AFD0208008580A3 /* FaviconsFetcherOnboarding.swift in Sources */, - 1E016AB6294A5EB100F21625 /* CustomDaxDialog.swift in Sources */, 02341FA42A437999008A1531 /* OnboardingStepView.swift in Sources */, F1CA3C3B1F045B65005FADB3 /* Authenticator.swift in Sources */, CBD4F13D279EBFA000B20FD7 /* HomeMessageCollectionViewCell.swift in Sources */, @@ -6958,7 +6915,6 @@ 3132FA2827A0788400DD7A12 /* PassKitPreviewHelper.swift in Sources */, 8505836C219F424500ED4EDB /* TextFieldWithInsets.swift in Sources */, CBD4F13F279EBFAF00B20FD7 /* HomeMessageViewModel.swift in Sources */, - 1E162613296C62820004127F /* CookieConsentDaxDialogViewModel.swift in Sources */, 1E4DCF4A27B6A38000961E25 /* DownloadListRepresentable.swift in Sources */, 2DC3FC65C6D9DA634426672D /* AutofillNoAuthAvailableView.swift in Sources */, ); diff --git a/DuckDuckGo/AppSettings.swift b/DuckDuckGo/AppSettings.swift index 790e10f995..b440082ffd 100644 --- a/DuckDuckGo/AppSettings.swift +++ b/DuckDuckGo/AppSettings.swift @@ -71,7 +71,6 @@ protocol AppSettings: AnyObject { func isWidgetInstalled() async -> Bool - var autoconsentPromptSeen: Bool { get set } var autoconsentEnabled: Bool { get set } var isSyncBookmarksPaused: Bool { get } diff --git a/DuckDuckGo/AppUserDefaults.swift b/DuckDuckGo/AppUserDefaults.swift index 552e381a02..008facdf6a 100644 --- a/DuckDuckGo/AppUserDefaults.swift +++ b/DuckDuckGo/AppUserDefaults.swift @@ -287,12 +287,30 @@ public class AppUserDefaults: AppSettings { } } } - - @UserDefaultsWrapper(key: .autoconsentPromptSeen, defaultValue: false) - var autoconsentPromptSeen: Bool - + + var autoconsentEnabled: Bool { + get { + // Use settings value if present + if let isEnabled = autoconsentEnabledSetting { + return isEnabled + } + + // Use onByDefault rollout otherwise + return featureFlagger.isFeatureOn(.autoconsentOnByDefault) + } + + set { + autoconsentEnabledSetting = newValue + } + } + + // Only for testing and `DebugViewController` purposes + func clearAutoconsentUserSetting() { + autoconsentEnabledSetting = nil + } + @UserDefaultsWrapper(key: .autoconsentEnabled, defaultValue: false) - var autoconsentEnabled: Bool + private var autoconsentEnabledSetting: Bool? var inspectableWebViewEnabled: Bool { get { diff --git a/DuckDuckGo/Autoconsent/AutoconsentManagement.swift b/DuckDuckGo/Autoconsent/AutoconsentManagement.swift index 524fa1792e..798431f0d3 100644 --- a/DuckDuckGo/Autoconsent/AutoconsentManagement.swift +++ b/DuckDuckGo/Autoconsent/AutoconsentManagement.swift @@ -25,7 +25,6 @@ final class AutoconsentManagement { private init() {} var sitesNotifiedCache = Set() - var promptLastShown: Date? func clearCache() { dispatchPrecondition(condition: .onQueue(.main)) diff --git a/DuckDuckGo/Autoconsent/AutoconsentUserScript.swift b/DuckDuckGo/Autoconsent/AutoconsentUserScript.swift index d4b5858497..bc85b57395 100644 --- a/DuckDuckGo/Autoconsent/AutoconsentUserScript.swift +++ b/DuckDuckGo/Autoconsent/AutoconsentUserScript.swift @@ -27,7 +27,6 @@ import PrivacyDashboard // swiftlint:disable file_length protocol AutoconsentPreferences { - var autoconsentPromptSeen: Bool { get set } var autoconsentEnabled: Bool { get set } } @@ -35,7 +34,6 @@ extension AppUserDefaults: AutoconsentPreferences { } protocol AutoconsentUserScriptDelegate: AnyObject { func autoconsentUserScript(_ script: AutoconsentUserScript, didUpdateCookieConsentStatus cookieConsentStatus: CookieConsentInfo) - func autoconsentUserScript(_ script: AutoconsentUserScript, didRequestAskingUserForConsent completion: @escaping (Bool) -> Void) } protocol UserScriptWithAutoconsent: UserScript { @@ -211,6 +209,12 @@ extension AutoconsentUserScript { } } + @MainActor + func handlePopupFound(message: WKScriptMessage, replyHandler: @escaping (Any?, String?) -> Void) { + os_log("Autoconsent popup found", log: .autoconsentLog) + replyHandler([ "type": "ok" ], nil) // this is just to prevent a Promise rejection + } + @MainActor func handleInit(message: WKScriptMessage, replyHandler: @escaping (Any?, String?) -> Void) { guard let messageData: InitMessage = decodeMessageBody(from: message.body) else { @@ -229,7 +233,7 @@ extension AutoconsentUserScript { return } - if preferences.autoconsentPromptSeen == true && preferences.autoconsentEnabled == false { + if preferences.autoconsentEnabled == false { // this will only happen if the user has just declined a prompt in this tab replyHandler([ "type": "ok" ], nil) // this is just to prevent a Promise rejection return @@ -260,11 +264,9 @@ extension AutoconsentUserScript { "rules": nil, // rules are bundled with the content script atm "config": [ "enabled": true, - // if it's the first time, disable autoAction - "autoAction": preferences.autoconsentPromptSeen ? "optOut" : nil, + "autoAction": "optOut", "disabledCmps": disabledCMPs, - // the very first time (autoconsentEnabled = nil), make sure the popup is visible - "enablePrehide": preferences.autoconsentPromptSeen, + "enablePrehide": true, "enableCosmeticRules": true, "detectRetries": 20, "isMainWorld": false @@ -309,31 +311,7 @@ extension AutoconsentUserScript { replyHandler(nil, "missing frame target") } } - - @MainActor - func handlePopupFound(message: WKScriptMessage, replyHandler: @escaping (Any?, String?) -> Void) { - guard preferences.autoconsentPromptSeen == false else { - // if feature is already enabled, opt-out will happen automatically - replyHandler([ "type": "ok" ], nil) // this is just to prevent a Promise rejection - return - } - - os_log("Prompting user about autoconsent", log: .autoconsentLog, type: .debug) - // if it's the first time, prompt the user and trigger opt-out - if message.webView?.window != nil { - ensurePrompt(callback: { shouldProceed in - if shouldProceed { - Task { - replyHandler([ "type": "optOut" ], nil) - } - } - }) - } else { - replyHandler(nil, "missing frame target") - } - } - @MainActor func handleOptOutResult(message: WKScriptMessage, replyHandler: @escaping (Any?, String?) -> Void) { guard let messageData: OptOutResultMessage = decodeMessageBody(from: message.body) else { @@ -419,24 +397,6 @@ extension AutoconsentUserScript { refreshDashboardState(consentManaged: true, cosmetic: nil, optoutFailed: false, selftestFailed: messageData.result) replyHandler([ "type": "ok" ], nil) // this is just to prevent a Promise rejection } - - @MainActor - func ensurePrompt(callback: @escaping (Bool) -> Void) { - let now = Date.init() - guard management.promptLastShown == nil || now > management.promptLastShown!.addingTimeInterval(1) else { - // user said "not now" recently, don't bother asking - os_log("Have a recent user response, canceling prompt", log: .autoconsentLog, type: .debug) - callback(preferences.autoconsentEnabled) // if two prompts were scheduled from the same tab, result could be true - return - } - - management.promptLastShown = now - self.delegate?.autoconsentUserScript(self, didRequestAskingUserForConsent: { result in - self.preferences.autoconsentEnabled = result - self.preferences.autoconsentPromptSeen = true - callback(result) - }) - } } extension NSNotification.Name { diff --git a/DuckDuckGo/AutoconsentSettingsViewController.swift b/DuckDuckGo/AutoconsentSettingsViewController.swift index d4a65fd3cc..172be442e2 100644 --- a/DuckDuckGo/AutoconsentSettingsViewController.swift +++ b/DuckDuckGo/AutoconsentSettingsViewController.swift @@ -68,7 +68,6 @@ final class AutoconsentSettingsViewController: UITableViewController { @IBAction private func onAutoconsentValueChanged(_ sender: Any) { appSettings.autoconsentEnabled = autoconsentToggle.isOn - appSettings.autoconsentPromptSeen = true Pixel.fire(pixel: autoconsentToggle.isOn ? .settingsAutoconsentOn : .settingsAutoconsentOff) } diff --git a/DuckDuckGo/CookieConsentDaxDialogViewModel.swift b/DuckDuckGo/CookieConsentDaxDialogViewModel.swift deleted file mode 100644 index a79fe5c023..0000000000 --- a/DuckDuckGo/CookieConsentDaxDialogViewModel.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// CookieConsentDaxDialogViewModel.swift -// DuckDuckGo -// -// Copyright © 2023 DuckDuckGo. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import Foundation - -final class CookieConsentDaxDialogViewModel: CustomDaxDialogViewModel { - - let okAction: () -> Void - let noAction: () -> Void - - init(okAction: @escaping () -> Void, noAction: @escaping () -> Void) { - self.okAction = okAction - self.noAction = noAction - } - - lazy var content: [DialogContentItem] = [.text(text: UserText.daxDialogCookieConsentFirst), - .animation(name: cookieBannerAnimationName, delay: 0.35), - .text(text: UserText.daxDialogCookieConsentSecond)] - - lazy var buttons: [DialogButtonItem] = [.bordered(label: UserText.daxDialogCookieConsentAcceptButton, action: self.okAction), - .borderless(label: UserText.daxDialogCookieConsentRejectButton, action: self.noAction)] - - private var cookieBannerAnimationName: String { - let useLightStyle = ThemeManager.shared.currentTheme.currentImageSet == .light - return useLightStyle ? "cookie-banner-illustration-animated" : "cookie-banner-illustration-animated-dark" - } -} diff --git a/DuckDuckGo/CustomDaxDialog.swift b/DuckDuckGo/CustomDaxDialog.swift deleted file mode 100644 index f8b71fae4d..0000000000 --- a/DuckDuckGo/CustomDaxDialog.swift +++ /dev/null @@ -1,181 +0,0 @@ -// -// CustomDaxDialog.swift -// DuckDuckGo -// -// Copyright © 2022 DuckDuckGo. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import SwiftUI - -struct CustomDaxDialog: View { - - @Environment(\.horizontalSizeClass) var horizontalSizeClass - @Environment(\.verticalSizeClass) var verticalSizeClass - - @State var viewModel: CustomDaxDialogViewModel - - var body: some View { - ZStack { - overlay - - VStack(alignment: .leading, spacing: .zero) { - Spacer() - - daxAndBubbleArrow - - bubbleBody - } - .padding([.leading, .trailing], Constants.Padding.dialogHorizontal) - .if(verticalSizeClass == .regular) { view in - view.padding(.bottom, Constants.Padding.dialogBottom) - } - .if(verticalSizeClass == .compact) { view in - view.padding([.leading, .trailing], Constants.Padding.dialogHorizontalWide) - } - .if(horizontalSizeClass == .regular) { view in - view.frame(width: Constants.Size.fixedDialogWidth) - } - } - } - - @ViewBuilder - private var overlay: some View { - Rectangle() - .foregroundColor(Constants.Colors.overlay) - } - - @ViewBuilder - private var daxAndBubbleArrow: some View { - VStack(spacing: Constants.Spacing.daxLogoAndArrow) { - Image.daxLogo - .resizable() - .frame(width: Constants.Size.daxLogo.width, height: Constants.Size.daxLogo.height) - Triangle() - .frame(width: Constants.Size.bubbleArrow.width, height: Constants.Size.bubbleArrow.height) - .foregroundColor(Constants.Colors.bubbleBackground) - } - .padding(.leading, Constants.Padding.daxLogoAndArrow) - } - - @ViewBuilder - private var bubbleBody: some View { - VStack { - ScrollView { - VStack(spacing: Constants.Spacing.bubbleElements) { - contentElements - - buttons - } - } - .if(verticalSizeClass != .compact) { view in - view.simultaneousGesture(DragGesture(minimumDistance: 0)) - } - .fixedSize(horizontal: false, vertical: true) - } - .padding(Constants.Padding.dialogInsets) - .background( - RoundedRectangle(cornerRadius: Constants.Size.dialogCornerRadius) - .foregroundColor(Constants.Colors.bubbleBackground) - ) - } - - @ViewBuilder - private var contentElements: some View { - ForEach(viewModel.content, id: \.self) { element in - switch element { - case .text(let text): - Text(text) - .font(Constants.Fonts.text) - .foregroundColor(Constants.Colors.text) - .lineSpacing(Constants.Spacing.textLineSpacing) - .frame(maxWidth: .infinity, alignment: .leading) - case .animation(let name, let delay): - LottieView(lottieFile: name, delay: delay) - .fixedSize() - } - } - } - - @ViewBuilder - private var buttons: some View { - ForEach(viewModel.buttons, id: \.self) { button in - switch button { - case .bordered(let label, let action): - Button(action: action, label: { - Text(label) - .font(Constants.Fonts.button) - .frame(maxWidth: .infinity, maxHeight: .infinity) - }) - .frame(height: Constants.Size.buttonHeight) - .foregroundColor(Constants.Colors.borderedButtonText) - .background(Capsule().foregroundColor(Constants.Colors.borderedButtonBackground)) - case .borderless(let label, let action): - Button(action: action, label: { - Text(label) - .font(Constants.Fonts.button) - .frame(maxHeight: .infinity) - }) - .frame(height: Constants.Size.buttonHeight) - .buttonStyle(.borderless) - .foregroundColor(Constants.Colors.borderlessButtonText) - .clipShape(Capsule()) - } - } - } - -} - -private enum Constants { - - enum Fonts { - static let text = Font(UIFont.appFont(ofSize: 17)) - static let button = Font(UIFont.boldAppFont(ofSize: 16)) - } - - enum Colors { - static let overlay = Color("CustomDaxDialogOverlayColor") - static let bubbleBackground = Color("CustomDaxDialogBubbleBackgroundColor") - static let text = Color("CustomDaxDialogTextColor") - static let borderedButtonText = Color("CustomDaxDialogBorderedButtonTextColor") - static let borderlessButtonText = Color("CustomDaxDialogBorderlessButtonTextColor") - static let borderedButtonBackground = Color("CustomDaxDialogBorderedButtonBackgroundColor") - } - - enum Spacing { - static let daxLogoAndArrow: CGFloat = 8 - static let bubbleElements: CGFloat = 16 - static let textLineSpacing: CGFloat = 5 - } - - enum Padding { - static let daxLogoAndArrow: CGFloat = 24 - static let dialogInsets = EdgeInsets(top: 24, leading: 16, bottom: 24, trailing: 16) - static let dialogHorizontal: CGFloat = 8 - static let dialogHorizontalWide: CGFloat = 70 - static let dialogBottom: CGFloat = 92 - } - - enum Size { - static let daxLogo = CGSize(width: 54, height: 54) - static let bubbleArrow = CGSize(width: 15, height: 7) - static let buttonHeight: CGFloat = 44 - static let fixedDialogWidth: CGFloat = 380 - static let dialogCornerRadius: CGFloat = 16 - } -} - -private extension Image { - static let daxLogo = Image("Logo") -} diff --git a/DuckDuckGo/CustomDaxDialogViewModel.swift b/DuckDuckGo/CustomDaxDialogViewModel.swift deleted file mode 100644 index 9a534b6de4..0000000000 --- a/DuckDuckGo/CustomDaxDialogViewModel.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// CustomDaxDialogViewModel.swift -// DuckDuckGo -// -// Copyright © 2023 DuckDuckGo. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import Foundation - -protocol CustomDaxDialogViewModel { - var content: [DialogContentItem] { get } - var buttons: [DialogButtonItem] { get } -} - -enum DialogContentItem: Hashable { - case text(text: String) - case animation(name: String, delay: TimeInterval = 0) -} - -enum DialogButtonItem: Hashable { - case bordered(label: String, action: () -> Void) - case borderless(label: String, action: () -> Void) - - func hash(into hasher: inout Hasher) { - switch self { - case .bordered(let label, _), .borderless(let label, _): - hasher.combine(label) - } - } - - static func == (lhs: DialogButtonItem, rhs: DialogButtonItem) -> Bool { - switch (lhs, rhs) { - case (.bordered(let lhsLabel, _), .bordered(let rhsLabel, _)), - (.borderless(let lhsLabel, _), .borderless(let rhsLabel, _)): - return lhsLabel == rhsLabel - default: - return false - } - } -} diff --git a/DuckDuckGo/RootDebugViewController.swift b/DuckDuckGo/RootDebugViewController.swift index 271987e51b..485c269970 100644 --- a/DuckDuckGo/RootDebugViewController.swift +++ b/DuckDuckGo/RootDebugViewController.swift @@ -110,8 +110,7 @@ class RootDebugViewController: UITableViewController { override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if tableView.cellForRow(at: indexPath)?.tag == Row.resetAutoconsentPrompt.rawValue { - AppUserDefaults().autoconsentPromptSeen = false - AppUserDefaults().autoconsentEnabled = false + AppUserDefaults().clearAutoconsentUserSetting() tableView.deselectRow(at: indexPath, animated: true) } diff --git a/DuckDuckGo/TabViewController.swift b/DuckDuckGo/TabViewController.swift index 0e58ca1c50..21e2e3925b 100644 --- a/DuckDuckGo/TabViewController.swift +++ b/DuckDuckGo/TabViewController.swift @@ -2220,38 +2220,6 @@ extension TabViewController: AutoconsentUserScriptDelegate { func autoconsentUserScript(_ script: AutoconsentUserScript, didUpdateCookieConsentStatus cookieConsentStatus: PrivacyDashboard.CookieConsentInfo) { privacyInfo?.cookieConsentManaged = cookieConsentStatus } - - // Disabled temporarily as a result of https://app.asana.com/0/1203936086921904/1204496002772588/f - private var cookieConsentDaxDialogPresentationAllowed: Bool { false } - - func autoconsentUserScript(_ script: AutoconsentUserScript, didRequestAskingUserForConsent completion: @escaping (Bool) -> Void) { - guard cookieConsentDaxDialogPresentationAllowed, - Locale.current.isRegionInEurope, - !isShowingFullScreenDaxDialog else { return } - - let viewModel = CookieConsentDaxDialogViewModel(okAction: { - completion(true) - Pixel.fire(pixel: .daxDialogsAutoconsentConfirmed) - self.dismiss(animated: true) - }, noAction: { - completion(false) - Pixel.fire(pixel: .daxDialogsAutoconsentCancelled) - self.dismiss(animated: true) - }) - - Pixel.fire(pixel: .daxDialogsAutoconsentShown) - - showCustomDaxDialog(viewModel: viewModel) - } - - private func showCustomDaxDialog(viewModel: CustomDaxDialogViewModel) { - let daxDialog = UIHostingController(rootView: CustomDaxDialog(viewModel: viewModel), ignoreSafeArea: true) - daxDialog.modalPresentationStyle = .overFullScreen - daxDialog.modalTransitionStyle = .crossDissolve - daxDialog.view.backgroundColor = .clear - - present(daxDialog, animated: true) - } } // MARK: - AdClickAttributionLogicDelegate diff --git a/DuckDuckGo/UserText.swift b/DuckDuckGo/UserText.swift index 531900ac59..8d36552646 100644 --- a/DuckDuckGo/UserText.swift +++ b/DuckDuckGo/UserText.swift @@ -859,14 +859,6 @@ But if you *do* want a peek under the hood, you can find more information about public static let omnibarNotificationCookiesManaged = NSLocalizedString("omnibar.notification.cookies-managed", value:"Cookies Managed", comment: "Text displayed on notification appearing in the address bar when the browser dismissed the cookie popup automatically rejecting it") public static let omnibarNotificationPopupHidden = NSLocalizedString("omnibar.notification.popup-hidden", value:"Pop-up Hidden", comment: "Text displayed on notification appearing in the address bar when the browser hides a cookie popup") - // MARK: Dax Dialog - - public static let daxDialogCookieConsentFirst = NSLocalizedString("dax.cookie-consent.first", value:"Looks like this site has a cookie consent pop-up👇", comment: "First part of text displayed on Dax dialog for enabling Autoconsent for Cookie Management feature") - public static let daxDialogCookieConsentSecond = NSLocalizedString("dax.cookie-consent.second", value:"Want me to handle these for you? I can try to minimize cookies, maximize privacy, and hide pop-ups like these.", comment: "Second part of text displayed on Dax dialog for enabling Autoconsent for Cookie Management feature") - - public static let daxDialogCookieConsentAcceptButton = NSLocalizedString("dax.cookie-consent.button.accept", value:"Manage Cookie Pop-ups", comment: "Button title accepting to enable feature to automatically manage cookie popups") - public static let daxDialogCookieConsentRejectButton = NSLocalizedString("dax.cookie-consent.button.reject", value:"No Thanks", comment: "Button title rejecting to enable feature to automatically manage cookie popups") - // MARK: Sync public static let syncTurnOffConfirmTitle = NSLocalizedString("sync.turn.off.confirm.title", value:"Turn Off Sync?", comment: "Title of the dialog to confirm turning off Sync") diff --git a/DuckDuckGo/cookie-banner-illustration-animated-dark.json b/DuckDuckGo/cookie-banner-illustration-animated-dark.json deleted file mode 100644 index 9db3493072..0000000000 --- a/DuckDuckGo/cookie-banner-illustration-animated-dark.json +++ /dev/null @@ -1 +0,0 @@ -{"v":"5.9.0","fr":24,"ip":0,"op":12,"w":296,"h":64,"nm":"Cookie Banner Animation (Dark)","ddd":0,"assets":[{"id":"comp_0","nm":"Banner Illustration","fr":24,"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Chips","sr":1,"ks":{"o":{"a":0,"k":80,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[37.862,32.895,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-0.864,0],[0,0.864],[0.864,0],[0,-0.864]],"o":[[0.864,0],[0,-0.864],[-0.864,0],[0,0.864]],"v":[[-3.016,-5.384],[-1.452,-6.948],[-3.016,-8.512],[-4.58,-6.948]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[-0.864,0],[0,0.864],[0.864,0],[0,-0.864]],"o":[[0.864,0],[0,-0.864],[-0.864,0],[0,0.864]],"v":[[-6.948,-1.497],[-5.384,-3.061],[-6.948,-4.625],[-8.513,-3.061]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[-0.864,0],[0,0.864],[0.864,0],[0,-0.864]],"o":[[0.864,0],[0,-0.864],[-0.864,0],[0,0.864]],"v":[[1.139,0.648],[2.703,-0.916],[1.139,-2.48],[-0.425,-0.916]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ind":3,"ty":"sh","ix":4,"ks":{"a":0,"k":{"i":[[-0.864,0],[0,0.864],[0.864,0],[0,-0.864]],"o":[[0.864,0],[0,-0.864],[-0.864,0],[0,0.864]],"v":[[7.082,4.581],[8.646,3.017],[7.082,1.453],[5.518,3.017]],"c":true},"ix":2},"nm":"Path 4","mn":"ADBE Vector Shape - Group","hd":false},{"ind":4,"ty":"sh","ix":5,"ks":{"a":0,"k":{"i":[[-0.864,0],[0,0.864],[0.864,0],[0,-0.864]],"o":[[0.864,0],[0,-0.864],[-0.864,0],[0,0.864]],"v":[[-0.782,8.512],[0.782,6.948],[-0.782,5.384],[-2.346,6.948]],"c":true},"ix":2},"nm":"Path 5","mn":"ADBE Vector Shape - Group","hd":false},{"ind":5,"ty":"sh","ix":6,"ks":{"a":0,"k":{"i":[[-0.864,0],[0,0.864],[0.864,0],[0,-0.864]],"o":[[0.864,0],[0,-0.864],[-0.864,0],[0,0.864]],"v":[[-7.082,4.536],[-5.518,2.972],[-7.082,1.408],[-8.646,2.972]],"c":true},"ix":2},"nm":"Path 6","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.352941185236,0.156862750649,0.027450980619,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Chips","np":8,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":24,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Cookie","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[37.442,32.374,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-4.971,0],[-0.116,-0.525],[0,-1.081],[8.008,0],[0,8.008],[-8.008,0],[-1.013,-0.224],[0,-0.538]],"o":[[0.538,0],[0.224,1.013],[0,8.008],[-8.008,0],[0,-8.008],[1.081,0],[0.525,0.116],[0,4.971]],"v":[[13,-4],[14.158,-3.147],[14.5,0],[0,14.5],[-14.5,0],[0,-14.5],[3.147,-14.158],[4,-13]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.758499979973,0.502933323383,0.061500012875,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2.5,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.976470589638,0.745098054409,0.101960785687,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Cookie","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":24,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Faux Text","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[141.481,18.5,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-1.105],[-1.105,0],[0,0],[0,1.105],[1.105,0]],"o":[[-1.105,0],[0,1.105],[0,0],[1.105,0],[0,-1.105],[0,0]],"v":[[-53.5,-6.5],[-55.5,-4.5],[-53.5,-2.5],[-39.5,-2.5],[-37.5,-4.5],[-39.5,-6.5]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,0],[0,-1.105],[-1.105,0],[0,0],[0,1.105],[1.105,0]],"o":[[-1.105,0],[0,1.105],[0,0],[1.105,0],[0,-1.105],[0,0]],"v":[[-31.5,-6.5],[-33.5,-4.5],[-31.5,-2.5],[-10.5,-2.5],[-8.5,-4.5],[-10.5,-6.5]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[0,1.105],[-1.105,0],[0,0],[0,-1.105],[1.105,0],[0,0]],"o":[[0,-1.105],[0,0],[1.105,0],[0,1.105],[0,0],[-1.105,0]],"v":[[3.5,-4.5],[5.5,-6.5],[53.5,-6.5],[55.5,-4.5],[53.5,-2.5],[5.5,-2.5]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ind":3,"ty":"sh","ix":4,"ks":{"a":0,"k":{"i":[[1.105,0],[0,-1.105],[-1.105,0],[0,1.105]],"o":[[-1.105,0],[0,1.105],[1.105,0],[0,-1.105]],"v":[[-2.5,-6.5],[-4.5,-4.5],[-2.5,-2.5],[-0.5,-4.5]],"c":true},"ix":2},"nm":"Path 4","mn":"ADBE Vector Shape - Group","hd":false},{"ind":4,"ty":"sh","ix":5,"ks":{"a":0,"k":{"i":[[0,1.105],[-1.105,0],[0,0],[0,-1.105],[1.105,0],[0,0]],"o":[[0,-1.105],[0,0],[1.105,0],[0,1.105],[0,0],[-1.105,0]],"v":[[-9.5,4.5],[-7.5,2.5],[10.5,2.5],[12.5,4.5],[10.5,6.5],[-7.5,6.5]],"c":true},"ix":2},"nm":"Path 5","mn":"ADBE Vector Shape - Group","hd":false},{"ind":5,"ty":"sh","ix":6,"ks":{"a":0,"k":{"i":[[0,0],[0,-1.105],[-1.105,0],[0,0],[0,1.105],[1.105,0]],"o":[[-1.105,0],[0,1.105],[0,0],[1.105,0],[0,-1.105],[0,0]],"v":[[-53.5,2.5],[-55.5,4.5],[-53.5,6.5],[-13.5,6.5],[-11.5,4.5],[-13.5,2.5]],"c":true},"ix":2},"nm":"Path 6","mn":"ADBE Vector Shape - Group","hd":false},{"ind":6,"ty":"sh","ix":7,"ks":{"a":0,"k":{"i":[[0,1.105],[-1.105,0],[0,0],[0,-1.105],[1.105,0],[0,0]],"o":[[0,-1.105],[0,0],[1.105,0],[0,1.105],[0,0],[-1.105,0]],"v":[[15.5,4.5],[17.5,2.5],[35.5,2.5],[37.5,4.5],[35.5,6.5],[17.5,6.5]],"c":true},"ix":2},"nm":"Path 7","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.033598780632,0.114138200879,0.332745105028,1],"ix":4},"o":{"a":0,"k":10,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Faux Text","np":9,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":24,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Button 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[114.981,42.5,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[58,19],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":4,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[0.033598780632,0.114138200879,0.332745105028,1],"ix":4},"o":{"a":0,"k":10,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Button","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":24,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"Button 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[180.981,42.5,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[58,19],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":4,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[0.033598780632,0.114138200879,0.332745105028,1],"ix":4},"o":{"a":0,"k":30,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Button","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":24,"st":0,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"Background Shape","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[124,32,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[246,62],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":8,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0.800000011921,0.843137264252,0.972549021244,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.898039221764,0.92549020052,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":24,"st":0,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Marks - Right","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":5,"s":[0]},{"t":9,"s":[50]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":5,"s":[274,32,0],"to":[2.333,0,0],"ti":[-2.333,0,0]},{"t":9,"s":[288,32,0]}],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":5,"s":[-50,50,100]},{"t":9,"s":[-100,100,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.502,-0.984],[-0.984,-0.502],[0,0],[-0.502,0.984],[0.984,0.502],[0,0]],"o":[[-0.502,0.984],[0,0],[0.984,0.502],[0.502,-0.984],[0,0],[-0.984,-0.502]],"v":[[-3.28,-21.036],[-2.408,-18.346],[4.717,-14.708],[7.407,-15.58],[6.536,-18.27],[-0.589,-21.908]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[-0.717,-0.841],[-0.841,0.717],[0,0],[0.717,0.841],[0.841,-0.717],[0,0]],"o":[[0.717,0.841],[0,0],[0.841,-0.717],[-0.717,-0.841],[0,0],[-0.841,0.717]],"v":[[-1.726,21.425],[1.094,21.649],[7.181,16.458],[7.405,13.639],[4.586,13.415],[-1.502,18.605]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[0,0],[0,1.105],[-1.105,0],[0,0],[0,-1.105],[1.105,0]],"o":[[-1.105,0],[0,-1.105],[0,0],[1.105,0],[0,1.105],[0,0]],"v":[[-5.883,1.16],[-7.883,-0.84],[-5.883,-2.84],[2.117,-2.84],[4.117,-0.84],[2.117,1.16]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0.329411764706,0.329411764706,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Marks","np":5,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":120,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Marks - Left","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":5,"s":[0]},{"t":9,"s":[50]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":5,"s":[20,32,0],"to":[-2,0,0],"ti":[2,0,0]},{"t":9,"s":[8,32,0]}],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":5,"s":[50,50,100]},{"t":9,"s":[100,100,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.502,-0.984],[-0.984,-0.502],[0,0],[-0.502,0.984],[0.984,0.502],[0,0]],"o":[[-0.502,0.984],[0,0],[0.984,0.502],[0.502,-0.984],[0,0],[-0.984,-0.502]],"v":[[-3.28,-21.036],[-2.408,-18.346],[4.717,-14.708],[7.407,-15.58],[6.536,-18.27],[-0.589,-21.908]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[-0.717,-0.841],[-0.841,0.717],[0,0],[0.717,0.841],[0.841,-0.717],[0,0]],"o":[[0.717,0.841],[0,0],[0.841,-0.717],[-0.717,-0.841],[0,0],[-0.841,0.717]],"v":[[-1.726,21.425],[1.094,21.649],[7.181,16.458],[7.405,13.639],[4.586,13.415],[-1.502,18.605]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[0,0],[0,1.105],[-1.105,0],[0,0],[0,-1.105],[1.105,0]],"o":[[-1.105,0],[0,-1.105],[0,0],[1.105,0],[0,1.105],[0,0]],"v":[[-5.883,1.16],[-7.883,-0.84],[-5.883,-2.84],[2.117,-2.84],[4.117,-0.84],[2.117,1.16]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0.329411764706,0.329411764706,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Marks","np":5,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":120,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":0,"nm":"Banner Illustration","refId":"comp_0","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":6,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[148,32,0],"ix":2,"l":2},"a":{"a":0,"k":[124,32,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":0,"s":[50,50,100]},{"t":6,"s":[100,100,100]}],"ix":6,"l":2}},"ao":0,"w":248,"h":64,"ip":0,"op":24,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/DuckDuckGo/cookie-banner-illustration-animated.json b/DuckDuckGo/cookie-banner-illustration-animated.json deleted file mode 100644 index 3da336c3c6..0000000000 --- a/DuckDuckGo/cookie-banner-illustration-animated.json +++ /dev/null @@ -1 +0,0 @@ -{"v":"5.9.0","fr":24,"ip":0,"op":12,"w":296,"h":64,"nm":"Cookie Banner Animation","ddd":0,"assets":[{"id":"comp_0","nm":"Banner Illustration","fr":24,"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Chips","sr":1,"ks":{"o":{"a":0,"k":80,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[37.862,32.895,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-0.864,0],[0,0.864],[0.864,0],[0,-0.864]],"o":[[0.864,0],[0,-0.864],[-0.864,0],[0,0.864]],"v":[[-3.016,-5.384],[-1.452,-6.948],[-3.016,-8.512],[-4.58,-6.948]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[-0.864,0],[0,0.864],[0.864,0],[0,-0.864]],"o":[[0.864,0],[0,-0.864],[-0.864,0],[0,0.864]],"v":[[-6.948,-1.497],[-5.384,-3.061],[-6.948,-4.625],[-8.513,-3.061]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[-0.864,0],[0,0.864],[0.864,0],[0,-0.864]],"o":[[0.864,0],[0,-0.864],[-0.864,0],[0,0.864]],"v":[[1.139,0.648],[2.703,-0.916],[1.139,-2.48],[-0.425,-0.916]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ind":3,"ty":"sh","ix":4,"ks":{"a":0,"k":{"i":[[-0.864,0],[0,0.864],[0.864,0],[0,-0.864]],"o":[[0.864,0],[0,-0.864],[-0.864,0],[0,0.864]],"v":[[7.082,4.581],[8.646,3.017],[7.082,1.453],[5.518,3.017]],"c":true},"ix":2},"nm":"Path 4","mn":"ADBE Vector Shape - Group","hd":false},{"ind":4,"ty":"sh","ix":5,"ks":{"a":0,"k":{"i":[[-0.864,0],[0,0.864],[0.864,0],[0,-0.864]],"o":[[0.864,0],[0,-0.864],[-0.864,0],[0,0.864]],"v":[[-0.782,8.512],[0.782,6.948],[-0.782,5.384],[-2.346,6.948]],"c":true},"ix":2},"nm":"Path 5","mn":"ADBE Vector Shape - Group","hd":false},{"ind":5,"ty":"sh","ix":6,"ks":{"a":0,"k":{"i":[[-0.864,0],[0,0.864],[0.864,0],[0,-0.864]],"o":[[0.864,0],[0,-0.864],[-0.864,0],[0,0.864]],"v":[[-7.082,4.536],[-5.518,2.972],[-7.082,1.408],[-8.646,2.972]],"c":true},"ix":2},"nm":"Path 6","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.352941185236,0.156862750649,0.027450980619,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Chips","np":8,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":24,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Cookie","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[37.442,32.374,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-4.971,0],[-0.116,-0.525],[0,-1.081],[8.008,0],[0,8.008],[-8.008,0],[-1.013,-0.224],[0,-0.538]],"o":[[0.538,0],[0.224,1.013],[0,8.008],[-8.008,0],[0,-8.008],[1.081,0],[0.525,0.116],[0,4.971]],"v":[[13,-4],[14.158,-3.147],[14.5,0],[0,14.5],[-14.5,0],[0,-14.5],[3.147,-14.158],[4,-13]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.758499979973,0.502933323383,0.061500012875,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2.5,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.976470589638,0.745098054409,0.101960785687,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Cookie","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":24,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Faux Text","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[141.481,18.5,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-1.105],[-1.105,0],[0,0],[0,1.105],[1.105,0]],"o":[[-1.105,0],[0,1.105],[0,0],[1.105,0],[0,-1.105],[0,0]],"v":[[-53.5,-6.5],[-55.5,-4.5],[-53.5,-2.5],[-39.5,-2.5],[-37.5,-4.5],[-39.5,-6.5]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,0],[0,-1.105],[-1.105,0],[0,0],[0,1.105],[1.105,0]],"o":[[-1.105,0],[0,1.105],[0,0],[1.105,0],[0,-1.105],[0,0]],"v":[[-31.5,-6.5],[-33.5,-4.5],[-31.5,-2.5],[-10.5,-2.5],[-8.5,-4.5],[-10.5,-6.5]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[0,1.105],[-1.105,0],[0,0],[0,-1.105],[1.105,0],[0,0]],"o":[[0,-1.105],[0,0],[1.105,0],[0,1.105],[0,0],[-1.105,0]],"v":[[3.5,-4.5],[5.5,-6.5],[53.5,-6.5],[55.5,-4.5],[53.5,-2.5],[5.5,-2.5]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ind":3,"ty":"sh","ix":4,"ks":{"a":0,"k":{"i":[[1.105,0],[0,-1.105],[-1.105,0],[0,1.105]],"o":[[-1.105,0],[0,1.105],[1.105,0],[0,-1.105]],"v":[[-2.5,-6.5],[-4.5,-4.5],[-2.5,-2.5],[-0.5,-4.5]],"c":true},"ix":2},"nm":"Path 4","mn":"ADBE Vector Shape - Group","hd":false},{"ind":4,"ty":"sh","ix":5,"ks":{"a":0,"k":{"i":[[0,1.105],[-1.105,0],[0,0],[0,-1.105],[1.105,0],[0,0]],"o":[[0,-1.105],[0,0],[1.105,0],[0,1.105],[0,0],[-1.105,0]],"v":[[-9.5,4.5],[-7.5,2.5],[10.5,2.5],[12.5,4.5],[10.5,6.5],[-7.5,6.5]],"c":true},"ix":2},"nm":"Path 5","mn":"ADBE Vector Shape - Group","hd":false},{"ind":5,"ty":"sh","ix":6,"ks":{"a":0,"k":{"i":[[0,0],[0,-1.105],[-1.105,0],[0,0],[0,1.105],[1.105,0]],"o":[[-1.105,0],[0,1.105],[0,0],[1.105,0],[0,-1.105],[0,0]],"v":[[-53.5,2.5],[-55.5,4.5],[-53.5,6.5],[-13.5,6.5],[-11.5,4.5],[-13.5,2.5]],"c":true},"ix":2},"nm":"Path 6","mn":"ADBE Vector Shape - Group","hd":false},{"ind":6,"ty":"sh","ix":7,"ks":{"a":0,"k":{"i":[[0,1.105],[-1.105,0],[0,0],[0,-1.105],[1.105,0],[0,0]],"o":[[0,-1.105],[0,0],[1.105,0],[0,1.105],[0,0],[-1.105,0]],"v":[[15.5,4.5],[17.5,2.5],[35.5,2.5],[37.5,4.5],[35.5,6.5],[17.5,6.5]],"c":true},"ix":2},"nm":"Path 7","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.033598780632,0.114138200879,0.332745105028,1],"ix":4},"o":{"a":0,"k":10,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Faux Text","np":9,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":24,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Button 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[114.981,42.5,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[58,19],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":4,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[0.033598780632,0.114138200879,0.332745105028,1],"ix":4},"o":{"a":0,"k":10,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Button","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":24,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"Button 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[180.981,42.5,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[58,19],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":4,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[0.033598780632,0.114138200879,0.332745105028,1],"ix":4},"o":{"a":0,"k":30,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Button","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":24,"st":0,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"Background Shape","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[124,32,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[246,62],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":8,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0.800000011921,0.843137264252,0.972549021244,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.898039221764,0.92549020052,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":24,"st":0,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Marks - Right","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":5,"s":[0]},{"t":9,"s":[30]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":5,"s":[274,32,0],"to":[2.333,0,0],"ti":[-2.333,0,0]},{"t":9,"s":[288,32,0]}],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":5,"s":[-50,50,100]},{"t":9,"s":[-100,100,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.502,-0.984],[-0.984,-0.502],[0,0],[-0.502,0.984],[0.984,0.502],[0,0]],"o":[[-0.502,0.984],[0,0],[0.984,0.502],[0.502,-0.984],[0,0],[-0.984,-0.502]],"v":[[-3.28,-21.036],[-2.408,-18.346],[4.717,-14.708],[7.407,-15.58],[6.536,-18.27],[-0.589,-21.908]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[-0.717,-0.841],[-0.841,0.717],[0,0],[0.717,0.841],[0.841,-0.717],[0,0]],"o":[[0.717,0.841],[0,0],[0.841,-0.717],[-0.717,-0.841],[0,0],[-0.841,0.717]],"v":[[-1.726,21.425],[1.094,21.649],[7.181,16.458],[7.405,13.639],[4.586,13.415],[-1.502,18.605]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[0,0],[0,1.105],[-1.105,0],[0,0],[0,-1.105],[1.105,0]],"o":[[-1.105,0],[0,-1.105],[0,0],[1.105,0],[0,1.105],[0,0]],"v":[[-5.883,1.16],[-7.883,-0.84],[-5.883,-2.84],[2.117,-2.84],[4.117,-0.84],[2.117,1.16]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.933333337307,0.06274510175,0.145098045468,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Marks","np":5,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":120,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Marks - Left","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":5,"s":[0]},{"t":9,"s":[30]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":5,"s":[20,32,0],"to":[-2,0,0],"ti":[2,0,0]},{"t":9,"s":[8,32,0]}],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":5,"s":[50,50,100]},{"t":9,"s":[100,100,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.502,-0.984],[-0.984,-0.502],[0,0],[-0.502,0.984],[0.984,0.502],[0,0]],"o":[[-0.502,0.984],[0,0],[0.984,0.502],[0.502,-0.984],[0,0],[-0.984,-0.502]],"v":[[-3.28,-21.036],[-2.408,-18.346],[4.717,-14.708],[7.407,-15.58],[6.536,-18.27],[-0.589,-21.908]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[-0.717,-0.841],[-0.841,0.717],[0,0],[0.717,0.841],[0.841,-0.717],[0,0]],"o":[[0.717,0.841],[0,0],[0.841,-0.717],[-0.717,-0.841],[0,0],[-0.841,0.717]],"v":[[-1.726,21.425],[1.094,21.649],[7.181,16.458],[7.405,13.639],[4.586,13.415],[-1.502,18.605]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[0,0],[0,1.105],[-1.105,0],[0,0],[0,-1.105],[1.105,0]],"o":[[-1.105,0],[0,-1.105],[0,0],[1.105,0],[0,1.105],[0,0]],"v":[[-5.883,1.16],[-7.883,-0.84],[-5.883,-2.84],[2.117,-2.84],[4.117,-0.84],[2.117,1.16]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.933333337307,0.06274510175,0.145098045468,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Marks","np":5,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":120,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":0,"nm":"Banner Illustration","refId":"comp_0","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":6,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[148,32,0],"ix":2,"l":2},"a":{"a":0,"k":[124,32,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":0,"s":[50,50,100]},{"t":6,"s":[100,100,100]}],"ix":6,"l":2}},"ao":0,"w":248,"h":64,"ip":0,"op":24,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/DuckDuckGo/en.lproj/Localizable.strings b/DuckDuckGo/en.lproj/Localizable.strings index 815afd61b6..08268ce2dc 100644 --- a/DuckDuckGo/en.lproj/Localizable.strings +++ b/DuckDuckGo/en.lproj/Localizable.strings @@ -811,18 +811,6 @@ /* Title for a section containing only items from yesterday */ "date.range.yesterday" = "Yesterday"; -/* Button title accepting to enable feature to automatically manage cookie popups */ -"dax.cookie-consent.button.accept" = "Manage Cookie Pop-ups"; - -/* Button title rejecting to enable feature to automatically manage cookie popups */ -"dax.cookie-consent.button.reject" = "No Thanks"; - -/* First part of text displayed on Dax dialog for enabling Autoconsent for Cookie Management feature */ -"dax.cookie-consent.first" = "Looks like this site has a cookie consent pop-up👇"; - -/* Second part of text displayed on Dax dialog for enabling Autoconsent for Cookie Management feature */ -"dax.cookie-consent.second" = "Want me to handle these for you? I can try to minimize cookies, maximize privacy, and hide pop-ups like these."; - /* No comment provided by engineer. */ "dax.hide.button" = "Hide Tips Forever"; diff --git a/DuckDuckGoTests/AppSettingsMock.swift b/DuckDuckGoTests/AppSettingsMock.swift index 1902cfb9fe..6158e60eff 100644 --- a/DuckDuckGoTests/AppSettingsMock.swift +++ b/DuckDuckGoTests/AppSettingsMock.swift @@ -69,6 +69,5 @@ class AppSettingsMock: AppSettings { widgetInstalled } - var autoconsentPromptSeen = true var autoconsentEnabled = true } diff --git a/DuckDuckGoTests/AppUserDefaultsTests.swift b/DuckDuckGoTests/AppUserDefaultsTests.swift index 89d6e4703f..8556b0643d 100644 --- a/DuckDuckGoTests/AppUserDefaultsTests.swift +++ b/DuckDuckGoTests/AppUserDefaultsTests.swift @@ -18,21 +18,30 @@ // import XCTest -@testable import DuckDuckGo import BrowserServicesKit +@testable import DuckDuckGo +@testable import Core + class AppUserDefaultsTests: XCTestCase { let testGroupName = "test" var internalUserDeciderStore: MockInternalUserStoring! + var customSuite: UserDefaults! override func setUp() { super.setUp() - UserDefaults(suiteName: testGroupName)?.removePersistentDomain(forName: testGroupName) + customSuite = UserDefaults(suiteName: testGroupName) + customSuite.removePersistentDomain(forName: testGroupName) internalUserDeciderStore = MockInternalUserStoring() + + // Isolate defaults for UserDefaultsWrapper + UserDefaults.app = customSuite } override func tearDown() { + UserDefaults.app = .standard + internalUserDeciderStore = nil super.tearDown() } @@ -157,6 +166,33 @@ class AppUserDefaultsTests: XCTestCase { XCTAssertEqual(appUserDefaults.autofillCredentialsEnabled, false) } + func testDefaultAutoconsentStateIsFalse_WhenNotInRollout() { + let appUserDefaults = AppUserDefaults(groupName: testGroupName) + appUserDefaults.featureFlagger = createFeatureFlagger(withSubfeatureEnabled: false) + XCTAssertFalse(appUserDefaults.autoconsentEnabled) + } + + func testDefaultAutoconsentStateIsTrue_WhenInRollout() { + let appUserDefaults = AppUserDefaults(groupName: testGroupName) + appUserDefaults.featureFlagger = createFeatureFlagger(withSubfeatureEnabled: true) + XCTAssertTrue(appUserDefaults.autoconsentEnabled) + } + + func testAutoconsentReadsUserStoredValue_RegardlessOfRolloutState() { + let appUserDefaults = AppUserDefaults(groupName: testGroupName) + + // When setting disabled by user and rollout enabled + appUserDefaults.autoconsentEnabled = false + appUserDefaults.featureFlagger = createFeatureFlagger(withSubfeatureEnabled: true) + + XCTAssertFalse(appUserDefaults.autoconsentEnabled) + + // When setting enabled by user and rollout disabled + appUserDefaults.autoconsentEnabled = true + appUserDefaults.featureFlagger = createFeatureFlagger(withSubfeatureEnabled: false) + + XCTAssertTrue(appUserDefaults.autoconsentEnabled) + } // MARK: - Mock Creation diff --git a/DuckDuckGoTests/AutoconsentMessageProtocolTests.swift b/DuckDuckGoTests/AutoconsentMessageProtocolTests.swift index aae48f81e3..3b0ce23cce 100644 --- a/DuckDuckGoTests/AutoconsentMessageProtocolTests.swift +++ b/DuckDuckGoTests/AutoconsentMessageProtocolTests.swift @@ -184,6 +184,5 @@ class MockWKScriptMessage: WKScriptMessage { } class MockAutoconsentPreferences: AutoconsentPreferences { - var autoconsentPromptSeen: Bool = true var autoconsentEnabled: Bool = true } diff --git a/IntegrationTests/AutoconsentBackgroundTests.swift b/IntegrationTests/AutoconsentBackgroundTests.swift index f4e309eca9..5b7cc496d4 100644 --- a/IntegrationTests/AutoconsentBackgroundTests.swift +++ b/IntegrationTests/AutoconsentBackgroundTests.swift @@ -158,6 +158,5 @@ class MockEmbeddedDataProvider: EmbeddedDataProvider { } class MockAutoconsentPreferences: AutoconsentPreferences { - var autoconsentPromptSeen: Bool = true var autoconsentEnabled: Bool = true }