Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit 99f8049

Browse files
authored
Fixed address bar cleared/losing focus on Navigation (#2157)
Task/Issue URL: https://app.asana.com/0/1177771139624306/1206506638670996/f - Fixed user input overwritten in the Address Bar on Web View navigation
1 parent edcf036 commit 99f8049

23 files changed

+1443
-467
lines changed

Configuration/UITests/UITests.xcconfig

+12-7
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,22 @@
1515

1616
#include "../Common.xcconfig"
1717

18-
CODE_SIGN_STYLE = Automatic
1918
CODE_SIGN_IDENTITY[config=CI][sdk=macosx*] =
20-
19+
CODE_SIGN_STYLE[config=CI][sdk=macosx*] = Manual
20+
CODE_SIGNING_ALLOWED[config=CI][sdk=macosx*] = NO
21+
COPY_PHASE_STRIP = NO
2122
DEAD_CODE_STRIPPING = YES
23+
DEVELOPMENT_TEAM[config=CI][sdk=macosx*] =
24+
ENABLE_USER_SCRIPT_SANDBOXING = YES
25+
GCC_NO_COMMON_BLOCKS = YES
26+
GENERATE_INFOPLIST_FILE = YES
27+
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks
28+
LOCALIZATION_PREFERS_STRING_CATALOGS = YES
2229

2330
MACOSX_DEPLOYMENT_TARGET = 11.4
2431

25-
INFOPLIST_FILE = UI Tests/Info.plist
2632
PRODUCT_BUNDLE_IDENTIFIER = com.duckduckgo.UI-Tests
2733
PRODUCT_NAME = $(TARGET_NAME)
28-
29-
TEST_TARGET_NAME = DuckDuckGo
30-
31-
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks
34+
PROVISIONING_PROFILE_SPECIFIER[config=CI][sdk=macosx*] =
35+
SWIFT_EMIT_LOC_STRINGS = NO
36+
TEST_TARGET_NAME = DuckDuckGo Privacy Browser

DuckDuckGo.xcodeproj/project.pbxproj

+29-27
Original file line numberDiff line numberDiff line change
@@ -2624,6 +2624,7 @@
26242624
B6080BC82B21E78100B418EF /* DataImportErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6080BC42B21E78100B418EF /* DataImportErrorView.swift */; };
26252625
B6085D062743905F00A9C456 /* CoreDataStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6085D052743905F00A9C456 /* CoreDataStore.swift */; };
26262626
B6085D092743AAB600A9C456 /* FireproofDomains.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = B6085D072743993C00A9C456 /* FireproofDomains.xcdatamodeld */; };
2627+
B60C5F232B86189800FFA1D2 /* TestsURLExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6EC37FB29B83E99001ACE79 /* TestsURLExtension.swift */; };
26272628
B60C6F7729B0E286007BFAA8 /* SearchNonexistentDomainNavigationResponder.swift in Sources */ = {isa = PBXBuildFile; fileRef = B60C6F7629B0E286007BFAA8 /* SearchNonexistentDomainNavigationResponder.swift */; };
26282629
B60C6F7829B0E286007BFAA8 /* SearchNonexistentDomainNavigationResponder.swift in Sources */ = {isa = PBXBuildFile; fileRef = B60C6F7629B0E286007BFAA8 /* SearchNonexistentDomainNavigationResponder.swift */; };
26292630
B60C6F7E29B1B41D007BFAA8 /* TestRunHelperInitializer.m in Sources */ = {isa = PBXBuildFile; fileRef = B60C6F7D29B1B41D007BFAA8 /* TestRunHelperInitializer.m */; };
@@ -2683,7 +2684,6 @@
26832684
B630794226731F5400DCEE41 /* WKDownloadMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = B630794126731F5400DCEE41 /* WKDownloadMock.swift */; };
26842685
B630E7FE29C887ED00363609 /* NSErrorAdditionalInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B630E7FD29C887ED00363609 /* NSErrorAdditionalInfo.swift */; };
26852686
B630E7FF29C887ED00363609 /* NSErrorAdditionalInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B630E7FD29C887ED00363609 /* NSErrorAdditionalInfo.swift */; };
2686-
B630E80029C887ED00363609 /* NSErrorAdditionalInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B630E7FD29C887ED00363609 /* NSErrorAdditionalInfo.swift */; };
26872687
B630E80129C887ED00363609 /* NSErrorAdditionalInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B630E7FD29C887ED00363609 /* NSErrorAdditionalInfo.swift */; };
26882688
B630E80229C887ED00363609 /* NSErrorAdditionalInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B630E7FD29C887ED00363609 /* NSErrorAdditionalInfo.swift */; };
26892689
B634DBDF293C8F7F00C3C99E /* Tab+UIDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B634DBDE293C8F7F00C3C99E /* Tab+UIDelegate.swift */; };
@@ -2704,8 +2704,6 @@
27042704
B63ED0E026AFE32F00A9DAD1 /* GeolocationProviderMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = B63ED0DF26AFE32F00A9DAD1 /* GeolocationProviderMock.swift */; };
27052705
B63ED0E326B3E7FA00A9DAD1 /* CLLocationManagerMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = B63ED0E226B3E7FA00A9DAD1 /* CLLocationManagerMock.swift */; };
27062706
B63ED0E526BB8FB900A9DAD1 /* SharingMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = B63ED0E426BB8FB900A9DAD1 /* SharingMenu.swift */; };
2707-
B63FCB3529B5B2680022C61A /* TestRunHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B60C6F8029B1B4AD007BFAA8 /* TestRunHelper.swift */; };
2708-
B63FCB3629B5B2730022C61A /* FileManagerTempDirReplacement.swift in Sources */ = {isa = PBXBuildFile; fileRef = B60C6F8329B1BAD3007BFAA8 /* FileManagerTempDirReplacement.swift */; };
27092707
B642738227B65BAC0005DFD1 /* SecureVaultErrorReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = B642738127B65BAC0005DFD1 /* SecureVaultErrorReporter.swift */; };
27102708
B643BF1427ABF772000BACEC /* NSWorkspaceExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B643BF1327ABF772000BACEC /* NSWorkspaceExtension.swift */; };
27112709
B644B43D29D56829003FA9AB /* SearchNonexistentDomainTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B644B43929D565DB003FA9AB /* SearchNonexistentDomainTests.swift */; };
@@ -2724,6 +2722,9 @@
27242722
B64C853826944B880048FEBE /* StoredPermission.swift in Sources */ = {isa = PBXBuildFile; fileRef = B64C853726944B880048FEBE /* StoredPermission.swift */; };
27252723
B64C853D26944B940048FEBE /* PermissionStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B64C853C26944B940048FEBE /* PermissionStore.swift */; };
27262724
B64C85422694590B0048FEBE /* PermissionButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B64C85412694590B0048FEBE /* PermissionButton.swift */; };
2725+
B64CE01C2B861B4F00126CA5 /* BrowserServicesKit in Frameworks */ = {isa = PBXBuildFile; productRef = B64CE01B2B861B4F00126CA5 /* BrowserServicesKit */; };
2726+
B64CE01E2B8622D700126CA5 /* AddressBarTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B64CE01D2B8622D700126CA5 /* AddressBarTests.swift */; };
2727+
B64CE01F2B8622D700126CA5 /* AddressBarTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B64CE01D2B8622D700126CA5 /* AddressBarTests.swift */; };
27272728
B65211252B29A42C00B30633 /* BookmarkStoreMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA652CDA25DDAB32009059CC /* BookmarkStoreMock.swift */; };
27282729
B65211262B29A42E00B30633 /* BookmarkStoreMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA652CDA25DDAB32009059CC /* BookmarkStoreMock.swift */; };
27292730
B65211272B29A43000B30633 /* BookmarkStoreMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA652CDA25DDAB32009059CC /* BookmarkStoreMock.swift */; };
@@ -2744,7 +2745,6 @@
27442745
B65CD8CD2B316DFC00A595BB /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = B65CD8CC2B316DFC00A595BB /* SnapshotTesting */; };
27452746
B65CD8CF2B316E0200A595BB /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = B65CD8CE2B316E0200A595BB /* SnapshotTesting */; };
27462747
B65CD8D12B316E0C00A595BB /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = B65CD8D02B316E0C00A595BB /* SnapshotTesting */; };
2747-
B65CD8D32B316E1700A595BB /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = B65CD8D22B316E1700A595BB /* SnapshotTesting */; };
27482748
B65CD8D52B316FCA00A595BB /* __Snapshots__ in Resources */ = {isa = PBXBuildFile; fileRef = B65CD8D42B316FCA00A595BB /* __Snapshots__ */; };
27492749
B65CD8D62B316FCA00A595BB /* __Snapshots__ in Resources */ = {isa = PBXBuildFile; fileRef = B65CD8D42B316FCA00A595BB /* __Snapshots__ */; };
27502750
B65DA5EF2A77CC3A00CBEE8D /* Bundle+NetworkProtectionExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B602E81F2A1E2603006D261F /* Bundle+NetworkProtectionExtensions.swift */; };
@@ -3224,6 +3224,13 @@
32243224
remoteGlobalIDString = AA585D7D248FD31100E9A3E2;
32253225
remoteInfo = DuckDuckGo;
32263226
};
3227+
B696E8182B8619D6008368F0 /* PBXContainerItemProxy */ = {
3228+
isa = PBXContainerItemProxy;
3229+
containerPortal = AA585D76248FD31100E9A3E2 /* Project object */;
3230+
proxyType = 1;
3231+
remoteGlobalIDString = B6EC37E729B5DA2A001ACE79;
3232+
remoteInfo = "tests-server";
3233+
};
32273234
B6EC37F129B5DA8F001ACE79 /* PBXContainerItemProxy */ = {
32283235
isa = PBXContainerItemProxy;
32293236
containerPortal = AA585D76248FD31100E9A3E2 /* Project object */;
@@ -3802,7 +3809,6 @@
38023809
7B3618C12ADE75C8000D6154 /* NetworkProtectionNavBarPopoverManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionNavBarPopoverManager.swift; sourceTree = "<group>"; };
38033810
7B430EA02A71411A00BAC4A1 /* NetworkProtectionSimulateFailureMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionSimulateFailureMenu.swift; sourceTree = "<group>"; };
38043811
7B4CE8DA26F02108009134B1 /* UI Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UI Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
3805-
7B4CE8DE26F02108009134B1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
38063812
7B4CE8E626F02134009134B1 /* TabBarTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarTests.swift; sourceTree = "<group>"; };
38073813
7B5291882A1697680022E406 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
38083814
7B5291892A169BC90022E406 /* DeveloperID.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DeveloperID.xcconfig; sourceTree = "<group>"; };
@@ -4221,6 +4227,7 @@
42214227
B64C853726944B880048FEBE /* StoredPermission.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoredPermission.swift; sourceTree = "<group>"; };
42224228
B64C853C26944B940048FEBE /* PermissionStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PermissionStore.swift; sourceTree = "<group>"; };
42234229
B64C85412694590B0048FEBE /* PermissionButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PermissionButton.swift; sourceTree = "<group>"; };
4230+
B64CE01D2B8622D700126CA5 /* AddressBarTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddressBarTests.swift; sourceTree = "<group>"; };
42244231
B65349A9265CF45000DCC645 /* DispatchQueueExtensionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DispatchQueueExtensionsTests.swift; sourceTree = "<group>"; };
42254232
B6553691268440D700085A79 /* WKProcessPool+GeolocationProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WKProcessPool+GeolocationProvider.swift"; sourceTree = "<group>"; };
42264233
B65536962684413900085A79 /* WKGeolocationProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKGeolocationProvider.h; sourceTree = "<group>"; };
@@ -4643,7 +4650,7 @@
46434650
isa = PBXFrameworksBuildPhase;
46444651
buildActionMask = 2147483647;
46454652
files = (
4646-
B65CD8D32B316E1700A595BB /* SnapshotTesting in Frameworks */,
4653+
B64CE01C2B861B4F00126CA5 /* BrowserServicesKit in Frameworks */,
46474654
);
46484655
runOnlyForDeploymentPostprocessing = 0;
46494656
};
@@ -6148,7 +6155,6 @@
61486155
isa = PBXGroup;
61496156
children = (
61506157
7B4CE8E626F02134009134B1 /* TabBarTests.swift */,
6151-
7B4CE8DE26F02108009134B1 /* Info.plist */,
61526158
);
61536159
path = UITests;
61546160
sourceTree = "<group>";
@@ -7880,6 +7886,7 @@
78807886
children = (
78817887
B644B43929D565DB003FA9AB /* SearchNonexistentDomainTests.swift */,
78827888
B693766D2B6B5F26005BD9D4 /* ErrorPageTests.swift */,
7889+
B64CE01D2B8622D700126CA5 /* AddressBarTests.swift */,
78837890
);
78847891
path = Tab;
78857892
sourceTree = "<group>";
@@ -8650,12 +8657,11 @@
86508657
buildRules = (
86518658
);
86528659
dependencies = (
8653-
B6080B9B2B20AF6400B418EF /* PBXTargetDependency */,
8654-
7B4CE8E026F02108009134B1 /* PBXTargetDependency */,
8660+
B696E8192B8619D6008368F0 /* PBXTargetDependency */,
86558661
);
86568662
name = "UI Tests";
86578663
packageProductDependencies = (
8658-
B65CD8D22B316E1700A595BB /* SnapshotTesting */,
8664+
B64CE01B2B861B4F00126CA5 /* BrowserServicesKit */,
86598665
);
86608666
productName = "UI Tests";
86618667
productReference = 7B4CE8DA26F02108009134B1 /* UI Tests.xctest */;
@@ -10574,6 +10580,7 @@
1057410580
3706FEA5293F662100E42796 /* CoreDataEncryptionTesting.xcdatamodeld in Sources */,
1057510581
B603973D29BF1D7D00902A34 /* AutoconsentIntegrationTests.swift in Sources */,
1057610582
B60C6F8729B1CAB2007BFAA8 /* TestRunHelper.swift in Sources */,
10583+
B64CE01F2B8622D700126CA5 /* AddressBarTests.swift in Sources */,
1057710584
B603972D29BEDF2100902A34 /* ExpectedNavigationExtension.swift in Sources */,
1057810585
3706FEA6293F662100E42796 /* EncryptionKeyStoreTests.swift in Sources */,
1057910586
B6F5656A299A414300A04298 /* WKWebViewMockingExtension.swift in Sources */,
@@ -10615,6 +10622,7 @@
1061510622
B644B43D29D56829003FA9AB /* SearchNonexistentDomainTests.swift in Sources */,
1061610623
B603973C29BF1D7D00902A34 /* AutoconsentIntegrationTests.swift in Sources */,
1061710624
B60C6F8629B1CAB0007BFAA8 /* TestRunHelper.swift in Sources */,
10625+
B64CE01E2B8622D700126CA5 /* AddressBarTests.swift in Sources */,
1061810626
B603972C29BEDF2100902A34 /* ExpectedNavigationExtension.swift in Sources */,
1061910627
4B1AD8D525FC38DD00261379 /* EncryptionKeyStoreTests.swift in Sources */,
1062010628
B6F56568299A414300A04298 /* WKWebViewMockingExtension.swift in Sources */,
@@ -11489,9 +11497,7 @@
1148911497
buildActionMask = 2147483647;
1149011498
files = (
1149111499
7B4CE8E726F02135009134B1 /* TabBarTests.swift in Sources */,
11492-
B63FCB3529B5B2680022C61A /* TestRunHelper.swift in Sources */,
11493-
B630E80029C887ED00363609 /* NSErrorAdditionalInfo.swift in Sources */,
11494-
B63FCB3629B5B2730022C61A /* FileManagerTempDirReplacement.swift in Sources */,
11500+
B60C5F232B86189800FFA1D2 /* TestsURLExtension.swift in Sources */,
1149511501
);
1149611502
runOnlyForDeploymentPostprocessing = 0;
1149711503
};
@@ -12596,10 +12602,6 @@
1259612602
target = AA585D7D248FD31100E9A3E2 /* DuckDuckGo Privacy Browser */;
1259712603
targetProxy = AA585D91248FD31400E9A3E2 /* PBXContainerItemProxy */;
1259812604
};
12599-
B6080B9B2B20AF6400B418EF /* PBXTargetDependency */ = {
12600-
isa = PBXTargetDependency;
12601-
productRef = B6080B9A2B20AF6400B418EF /* SwiftLintPlugin */;
12602-
};
1260312605
B6080B9D2B20AF7700B418EF /* PBXTargetDependency */ = {
1260412606
isa = PBXTargetDependency;
1260512607
productRef = B6080B9C2B20AF7700B418EF /* SwiftLintPlugin */;
@@ -12632,6 +12634,11 @@
1263212634
isa = PBXTargetDependency;
1263312635
productRef = B692D0DE2B209FB7003F2548 /* SwiftLintPlugin */;
1263412636
};
12637+
B696E8192B8619D6008368F0 /* PBXTargetDependency */ = {
12638+
isa = PBXTargetDependency;
12639+
target = B6EC37E729B5DA2A001ACE79 /* tests-server */;
12640+
targetProxy = B696E8182B8619D6008368F0 /* PBXContainerItemProxy */;
12641+
};
1263512642
B69D06142A4C0AC50032D14D /* PBXTargetDependency */ = {
1263612643
isa = PBXTargetDependency;
1263712644
productRef = B69D06132A4C0AC50032D14D /* SwiftLintPlugin */;
@@ -14102,11 +14109,6 @@
1410214109
package = AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */;
1410314110
productName = Sparkle;
1410414111
};
14105-
B6080B9A2B20AF6400B418EF /* SwiftLintPlugin */ = {
14106-
isa = XCSwiftPackageProductDependency;
14107-
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
14108-
productName = "plugin:SwiftLintPlugin";
14109-
};
1411014112
B6080B9C2B20AF7700B418EF /* SwiftLintPlugin */ = {
1411114113
isa = XCSwiftPackageProductDependency;
1411214114
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
@@ -14142,6 +14144,11 @@
1414214144
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
1414314145
productName = "plugin:SwiftLintPlugin";
1414414146
};
14147+
B64CE01B2B861B4F00126CA5 /* BrowserServicesKit */ = {
14148+
isa = XCSwiftPackageProductDependency;
14149+
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
14150+
productName = BrowserServicesKit;
14151+
};
1414514152
B65CD8CA2B316DF100A595BB /* SnapshotTesting */ = {
1414614153
isa = XCSwiftPackageProductDependency;
1414714154
package = B65CD8C92B316DF100A595BB /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */;
@@ -14162,11 +14169,6 @@
1416214169
package = B65CD8C92B316DF100A595BB /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */;
1416314170
productName = SnapshotTesting;
1416414171
};
14165-
B65CD8D22B316E1700A595BB /* SnapshotTesting */ = {
14166-
isa = XCSwiftPackageProductDependency;
14167-
package = B65CD8C92B316DF100A595BB /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */;
14168-
productName = SnapshotTesting;
14169-
};
1417014172
B692D0DE2B209FB7003F2548 /* SwiftLintPlugin */ = {
1417114173
isa = XCSwiftPackageProductDependency;
1417214174
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;

DuckDuckGo/Application/AppDelegate.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate, FileDownloadManagerDel
240240

241241
startupSync()
242242

243-
stateRestorationManager.applicationDidFinishLaunching()
243+
if [.normal, .uiTests].contains(NSApp.runType) {
244+
stateRestorationManager.applicationDidFinishLaunching()
245+
}
244246

245247
BWManager.shared.initCommunication()
246248

DuckDuckGo/Common/Extensions/NSViewExtension.swift

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ extension NSView {
8484
os_log("%s: Window not available", type: .error, className)
8585
return
8686
}
87+
// prevent all text selection on repeated Address Bar activation
88+
guard window.firstResponder !== (self as? NSControl)?.currentEditor() ?? self else { return }
8789

8890
window.makeFirstResponder(self)
8991
}

DuckDuckGo/Common/Localizables/UserText.swift

+3
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ struct UserText {
236236
static let addressBarVisitSuffix = NSLocalizedString("address.bar.visit.suffix",
237237
value: "Visit",
238238
comment: "Address bar suffix of possibly visited website. Example: spreadprivacy.com . Visit spreadprivacy.com")
239+
static let addressBarPlaceholder = NSLocalizedString("address.bar.placeholder",
240+
value: "Search or enter address",
241+
comment: "Empty Address Bar placeholder text displayed on the new tab page.")
239242

240243
static let navigateBack = NSLocalizedString("navigate.back", value: "Back", comment: "Context menu item")
241244
static let closeAndReturnToParentFormat = NSLocalizedString("close.tab.on.back.format",

DuckDuckGo/Localizable.xcstrings

+12
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,18 @@
235235
"Address:" : {
236236
"comment" : "Add Bookmark dialog bookmark url field heading"
237237
},
238+
"address.bar.placeholder" : {
239+
"comment" : "Empty Address Bar placeholder text displayed on the new tab page.",
240+
"extractionState" : "extracted_with_value",
241+
"localizations" : {
242+
"en" : {
243+
"stringUnit" : {
244+
"state" : "new",
245+
"value" : "Search or enter address"
246+
}
247+
}
248+
}
249+
},
238250
"address.bar.search.suffix" : {
239251
"comment" : "Suffix of searched terms in address bar. Example: best watching machine . Search DuckDuckGo",
240252
"extractionState" : "extracted_with_value",

DuckDuckGo/MainWindow/MainView.swift

-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ final class MainView: NSView {
6161
bookmarksBarHeightConstraint = bookmarksBarContainerView.heightAnchor.constraint(equalToConstant: 34)
6262

6363
navigationBarTopConstraint = navigationBarContainerView.topAnchor.constraint(equalTo: topAnchor, constant: 38)
64-
addressBarHeightConstraint = navigationBarContainerView.heightAnchor.constraint(equalToConstant: 42)
6564

6665
NSLayoutConstraint.activate([
6766
tabBarContainerView.topAnchor.constraint(equalTo: topAnchor),
@@ -82,7 +81,6 @@ final class MainView: NSView {
8281
navigationBarTopConstraint,
8382
navigationBarContainerView.leadingAnchor.constraint(equalTo: leadingAnchor),
8483
navigationBarContainerView.trailingAnchor.constraint(equalTo: trailingAnchor),
85-
addressBarHeightConstraint,
8684

8785
webContainerView.topAnchor.constraint(equalTo: bookmarksBarContainerView.bottomAnchor),
8886
webContainerView.bottomAnchor.constraint(equalTo: bottomAnchor),

0 commit comments

Comments
 (0)