Skip to content

Commit

Permalink
Merge branch 'main' into sam/fix-vpn-app-store-agent-compilation
Browse files Browse the repository at this point in the history
# By Dominik Kapusta (16) and others
# Via Dominik Kapusta (2) and others
* main: (67 commits)
  Increase polling interval for captcha solver (#2071)
  Add a link to help page in location permission popup (#2017)
  Add bookmark popover in SwiftUI (#2036)
  Better detection of AMP pages (#2001)
  UI adjustments for improved VPN user control (#2043)
  Don't override drop operation if source view is webView (#2058)
  Bump version to 1.71.0 (104)
  Set marketing version to 1.71.0
  Update embedded files
  VPN Geoswitching - look and feel tweaks + Pixels (#2045)
  fix Bookmarks Manager empty state constraint (#2034)
  Add Folder modal in SwiftUI (#2033)
  Fix serverlocation in connection notification (#2053)
  Use GRDB.swift 2.23.0 (upstream 6.32.0, SQLCipher 4.5.5) (#2021)
  Bump version to 1.70.0 (103)
  Update embedded files
  macOS: Fix issue with not being able to add favorites for existing bookmarks in the latest 1.70.0 internal (#2059)
  Bump version to 1.70.0 (102)
  Update embedded files
  Remove observer from DataBrokerProtectionViewController (#2057)
  ...

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	LocalPackages/BuildToolPlugins/Plugins/InputFilesChecker/InputFilesChecker.swift
  • Loading branch information
samsymons committed Jan 17, 2024
2 parents 2859149 + d9264be commit a785cd6
Show file tree
Hide file tree
Showing 179 changed files with 6,601 additions and 4,595 deletions.
2 changes: 1 addition & 1 deletion .xcode-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15.0
15.1
10 changes: 5 additions & 5 deletions Configuration/App/DBP/DuckDuckGoDBPAgent.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
#include "../../DeveloperID.xcconfig"

// Override AppTargetsBase.xcconfig until we resolve bundle IDs.
PRODUCT_BUNDLE_IDENTIFIER[sdk=*] = $(DBP_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[config=Debug][sdk=*] = $(DBP_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[config=CI][sdk=*] = $(DBP_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[config=Review][sdk=*] = $(DBP_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[sdk=*] = $(DBP_BACKGROUND_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[config=Debug][sdk=*] = $(DBP_BACKGROUND_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[config=CI][sdk=*] = $(DBP_BACKGROUND_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[config=Review][sdk=*] = $(DBP_BACKGROUND_AGENT_BUNDLE_ID)

INFOPLIST_FILE = DuckDuckGoDBPBackgroundAgent/Info.plist
GENERATE_INFOPLIST_FILE = YES
Expand All @@ -40,7 +40,7 @@ CODE_SIGN_IDENTITY[sdk=macosx*] = Developer ID Application
CODE_SIGN_IDENTITY[config=Debug][sdk=macosx*] = Apple Development
CODE_SIGN_IDENTITY[config=CI][sdk=macosx*] =

PRODUCT_NAME = $(DBP_AGENT_PRODUCT_NAME)
PRODUCT_NAME = $(DBP_BACKGROUND_AGENT_PRODUCT_NAME)

PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] =
PROVISIONING_PROFILE_SPECIFIER[config=Review][sdk=macosx*] = macOS DBP Agent - Review
Expand Down
10 changes: 5 additions & 5 deletions Configuration/App/DBP/DuckDuckGoDBPAgentAppStore.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
#include "../../AppStore.xcconfig"

// Override AppTargetsBase.xcconfig until we resolve bundle IDs.
PRODUCT_BUNDLE_IDENTIFIER[sdk=*] = $(DBP_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[config=Debug][sdk=*] = $(DBP_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[config=CI][sdk=*] = $(DBP_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[config=Review][sdk=*] = $(DBP_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[sdk=*] = $(DBP_BACKGROUND_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[config=Debug][sdk=*] = $(DBP_BACKGROUND_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[config=CI][sdk=*] = $(DBP_BACKGROUND_AGENT_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[config=Review][sdk=*] = $(DBP_BACKGROUND_AGENT_BUNDLE_ID)

INFOPLIST_FILE = DuckDuckGoDBPBackgroundAgent/Info.plist
GENERATE_INFOPLIST_FILE = YES
Expand All @@ -40,7 +40,7 @@ CODE_SIGN_IDENTITY[sdk=macosx*] = Developer ID Application
CODE_SIGN_IDENTITY[config=Debug][sdk=macosx*] = Apple Development
CODE_SIGN_IDENTITY[config=CI][sdk=macosx*] =

PRODUCT_NAME = $(DBP_AGENT_PRODUCT_NAME)
PRODUCT_NAME = $(DBP_BACKGROUND_AGENT_PRODUCT_NAME)

PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] =
PROVISIONING_PROFILE_SPECIFIER[config=Review][sdk=macosx*] = macOS DBP Agent - Review
Expand Down
2 changes: 1 addition & 1 deletion Configuration/BuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 97
CURRENT_PROJECT_VERSION = 104
14 changes: 4 additions & 10 deletions Configuration/DeveloperID.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ NOTIFICATIONS_AGENT_PRODUCT_NAME = DuckDuckGo Notifications

AGENT_BUNDLE_ID_BASE[sdk=*] = com.duckduckgo.macos.vpn

DBP_AGENT_BUNDLE_ID[sdk=*] = com.duckduckgo.macos.DBP.backgroundAgent
DBP_AGENT_BUNDLE_ID[config=Debug][sdk=*] = com.duckduckgo.macos.DBP.backgroundAgent.debug
DBP_AGENT_BUNDLE_ID[config=CI][sdk=*] = com.duckduckgo.macos.DBP.backgroundAgent.debug
DBP_AGENT_BUNDLE_ID[config=Review][sdk=*] = com.duckduckgo.macos.DBP.backgroundAgent.review
DBP_AGENT_PRODUCT_NAME = DuckDuckGoDBPBackgroundAgent

DBP_BASE_APP_GROUP = $(DEVELOPMENT_TEAM).com.duckduckgo.macos.browser.dbp
DBP_APP_GROUP[config=CI][sdk=*] = $(DBP_BASE_APP_GROUP).debug
DBP_APP_GROUP[config=Review][sdk=*] = $(DBP_BASE_APP_GROUP).review
Expand All @@ -78,8 +72,8 @@ AGENT_BUNDLE_ID[config=Review][sdk=*] = $(AGENT_BUNDLE_ID_BASE).review
AGENT_PRODUCT_NAME = DuckDuckGo VPN

DBP_BACKGROUND_AGENT_BUNDLE_ID[sdk=*] = com.duckduckgo.macos.DBP.backgroundAgent
DBP_BACKGROUND_AGENT_BUNDLE_ID[config=Debug][sdk=*] = com.duckduckgo.macos.DBP.backgroundAgent.debug
DBP_BACKGROUND_AGENT_BUNDLE_ID[config=CI][sdk=*] = com.duckduckgo.macos.DBP.backgroundAgent.debug
DBP_BACKGROUND_AGENT_BUNDLE_ID[config=Review][sdk=*] = com.duckduckgo.macos.DBP.backgroundAgent.review
DBP_BACKGROUND_AGENT_BUNDLE_ID[config=Debug][sdk=*] = $(DBP_BACKGROUND_AGENT_BUNDLE_ID).debug
DBP_BACKGROUND_AGENT_BUNDLE_ID[config=CI][sdk=*] = $(DBP_BACKGROUND_AGENT_BUNDLE_ID).debug
DBP_BACKGROUND_AGENT_BUNDLE_ID[config=Review][sdk=*] = $(DBP_BACKGROUND_AGENT_BUNDLE_ID).review

DBP_BACKGROUND_AGENT_PRODUCT_NAME = DuckDuckGoDBPBackgroundAgent
DBP_BACKGROUND_AGENT_PRODUCT_NAME = DuckDuckGo Personal Information Removal
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 1.69.0
MARKETING_VERSION = 1.71.0
319 changes: 217 additions & 102 deletions DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,35 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "e9c344c15d550112d02853c07efeaa154e911e2b",
"version" : "100.0.1"
"revision" : "44569e233945c099887266c1d7b8e07b25558a02",
"version" : "101.1.2"
}
},
{
"identity" : "content-scope-scripts",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/content-scope-scripts",
"state" : {
"revision" : "b7ad9843e70cede0c2ca9c4260d970f62cb28156",
"version" : "4.52.0"
"revision" : "bb027f14bec7fbb1a85d308139e7a66686da160e",
"version" : "4.59.0"
}
},
{
"identity" : "duckduckgo-autofill",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/duckduckgo-autofill.git",
"state" : {
"revision" : "5597bc17709c8acf454ecaad4f4082007986242a",
"version" : "10.0.2"
"revision" : "b972bc0ab6ee1d57a0a18a197dcc31e40ae6ac57",
"version" : "10.0.3"
}
},
{
"identity" : "grdb.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/GRDB.swift.git",
"state" : {
"revision" : "77d9a83191a74e319a5cfa27b0e3145d15607573",
"version" : "2.2.0"
"revision" : "9f049d7b97b1e68ffd86744b500660d34a9e79b8",
"version" : "2.3.0"
}
},
{
Expand Down Expand Up @@ -122,8 +122,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
"version" : "509.0.2"
"revision" : "43c802fb7f96e090dde015344a94b5e85779eff1",
"version" : "509.1.0"
}
},
{
Expand All @@ -147,7 +147,7 @@
{
"identity" : "trackerradarkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/TrackerRadarKit",
"location" : "https://github.com/duckduckgo/TrackerRadarKit.git",
"state" : {
"revision" : "a6b7ba151d9dc6684484f3785293875ec01cc1ff",
"version" : "1.2.2"
Expand Down
47 changes: 45 additions & 2 deletions DuckDuckGo/Application/URLEventHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import Foundation
import NetworkProtection
#endif

#if DBP
import DataBrokerProtection
#endif

@MainActor
final class URLEventHandler {

Expand Down Expand Up @@ -100,9 +104,19 @@ final class URLEventHandler {

private static func openURL(_ url: URL) {
#if NETWORK_PROTECTION
if url.scheme == "networkprotection" {
if url.scheme?.isNetworkProtectionScheme == true {
handleNetworkProtectionURL(url)
} else {
}
#endif

#if DBP
if url.scheme?.isDataBrokerProtectionScheme == true {
handleDataBrokerProtectionURL(url)
}
#endif

#if NETWORK_PROTECTION || DBP
if url.scheme?.isNetworkProtectionScheme == false && url.scheme?.isDataBrokerProtectionScheme == false {
WaitlistModalDismisser.dismissWaitlistModalViewControllerIfNecessary(url)
WindowControllersManager.shared.show(url: url, source: .appOpenUrl, newTab: true)
}
Expand Down Expand Up @@ -132,4 +146,33 @@ final class URLEventHandler {

#endif

#if DBP
/// Handles DBP URLs
///
private static func handleDataBrokerProtectionURL(_ url: URL) {
switch url {
case DataBrokerProtectionNotificationCommand.showDashboard.url:
NotificationCenter.default.post(name: DataBrokerProtectionNotifications.shouldReloadUI, object: nil)

WindowControllersManager.shared.showTab(with: .dataBrokerProtection)
default:
return
}
}

#endif

}

private extension String {
static let dataBrokerProtectionScheme = "databrokerprotection"
static let networkProtectionScheme = "networkprotection"

var isDataBrokerProtectionScheme: Bool {
return self == String.dataBrokerProtectionScheme
}

var isNetworkProtectionScheme: Bool {
return self == String.networkProtectionScheme
}
}
1 change: 1 addition & 0 deletions DuckDuckGo/Application/UpdateController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Foundation
import Combine
import Sparkle
import BrowserServicesKit
import SwiftUIExtensions

#if SPARKLE

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.500",
"blue" : "0xFF",
"green" : "0xDA",
"red" : "0xCC"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.500",
"blue" : "0x69",
"green" : "0x39",
"red" : "0x24"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Location-16-Solid.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
2 changes: 1 addition & 1 deletion DuckDuckGo/Bookmarks/Model/Bookmark.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import Cocoa
import Bookmarks

internal class BaseBookmarkEntity {
internal class BaseBookmarkEntity: Identifiable {

static func singleEntity(with uuid: String) -> NSFetchRequest<BookmarkEntity> {
let request = BookmarkEntity.fetchRequest()
Expand Down
32 changes: 32 additions & 0 deletions DuckDuckGo/Bookmarks/Model/WebsiteInfo.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// WebsiteInfo.swift
//
// Copyright © 2024 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

struct WebsiteInfo {
let url: URL
let title: String?

init?(_ tab: Tab) {
guard case let .url(url, _, _) = tab.content else {
return nil
}
self.url = url
self.title = tab.title
}
}
67 changes: 67 additions & 0 deletions DuckDuckGo/Bookmarks/View/AddBookmarkFolderModalView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// AddBookmarkFolderModalView.swift
//
// Copyright © 2024 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 AddBookmarkFolderModalView: ModalView {

@State var model: AddBookmarkFolderModalViewModel = .init()
@Environment(\.dismiss) private var dismiss

var body: some View {
VStack(alignment: .leading, spacing: 16) {
Text(model.title)
.fontWeight(.semibold)

HStack(spacing: 16) {
Text(UserText.newBookmarkDialogBookmarkNameTitle)
.frame(height: 22)

TextField("", text: $model.folderName)
.accessibilityIdentifier("Title Text Field")
.textFieldStyle(.roundedBorder)
.disableAutocorrection(true)
}
.padding(.bottom, 4)

HStack {
Spacer()

Button(UserText.cancel) {
model.cancel(dismiss: dismiss.callAsFunction)
}
.keyboardShortcut(.cancelAction)

Button(model.addButtonTitle) {
model.addFolder(dismiss: dismiss.callAsFunction)
}
.keyboardShortcut(.defaultAction)
.disabled(model.isAddButtonDisabled)

}
}
.font(.system(size: 13))
.padding()
.frame(width: 450, height: 131)
}

}

#Preview {
AddBookmarkFolderModalView()
}
Loading

0 comments on commit a785cd6

Please sign in to comment.