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

fix bug where pasting url into address bar clears its content #1166

Conversation

SabrinaTardio
Copy link
Collaborator

Task/Issue URL: https://app.asana.com/0/1177771139624306/1204464586950568/f

Description: Maintains search bar content when a URL is pasted

Steps to test this PR:

  1. Copy a URL to your clipboard
  2. Clear the contents of the address bar
  3. Type "keyword site:" and then press cmd+V should do a filtered search on duck duck go
  4. Copy link from Outlook (make sure to choose a link with name - for example 'View it on GitHub’)
  5. Paste into the address bar and make sure the URL is pasted instead of the name ('View it on GitHub’)

<!—
Tagging instructions
If this PR isn't ready to be merged for whatever reason it should be marked with the DO NOT MERGE label (particularly if it's a draft)
If it's pending Product Review/PFR, please add the Pending Product Review label.

If at any point it isn't actively being worked on/ready for review/otherwise moving forward (besides the above PR/PFR exception) strongly consider closing it (or not opening it in the first place). If you decide not to close it, make sure it's labelled to make it clear the PRs state and comment with more information.
—>

Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
When ready for review, remember to post the PR in MM

@SabrinaTardio SabrinaTardio requested review from a team and diegoreymendez and removed request for a team April 26, 2023 14:09
@SabrinaTardio SabrinaTardio changed the title fix buf where pasting url into address bar clears its content fix bug where pasting url into address bar clears its content Apr 26, 2023
Copy link
Contributor

@diegoreymendez diegoreymendez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @SabrinaTardio ! The instructions listed work as described, but I did some extra testing and I think these changes broke replacing the address bar selection when pasting.

Steps:

  1. Enter www.duckduckgo.com in the nav bar, and load the site.
  2. Copy any URL from elsewhere.
  3. Press CMD + L so that "www.duckduckgo.com" is selected.
  4. Paste

I'd expect www.duckduckgo.com to be fully replaced (previous behaviour) but instead I'm seeing that the new URL is concatenated at the end of www.duckduckgo.com.

@diegoreymendez diegoreymendez self-requested a review May 2, 2023 09:54
Copy link
Contributor

@diegoreymendez diegoreymendez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described.

@SabrinaTardio SabrinaTardio merged commit c2cd3a7 into develop May 2, 2023
@SabrinaTardio SabrinaTardio deleted the sabrina/Fix-Bug-Pasting-URL-into-address-bar-clears-its-contents branch May 2, 2023 10:04
mallexxx pushed a commit that referenced this pull request May 4, 2023
samsymons added a commit that referenced this pull request May 12, 2023
* release/1.39.0:
  Set version to 1.39.0
  Update embedded files
  Update old Dax asset (#1193)
  WebKit find in page (#1188)
  modify manage bookmarks button (#1175)
  sync update device model / poll for devices (#1191)
  Fix creating DMG images in GitHub Actions (#1185)
  Update Privacy Dashboard info on redirect (#1186)
  Update BSK with autofill 6.5.1 (#1182)
  Only use LazyVStack on home page when on macos 12 or higher (#1181)
  Update PULL_REQUEST_TEMPLATE.md (#1173)
  Sabrina/allow tabs in single tab windows to be moved to other windows (#1174)
  Version 1.38.1
  Version 1.38.0
  Embeded files updated
  Remove the Fire button pixel (#1151)
  remove duck player pixels (#1176)
  Adding a mitigation for youtube-nocookie storing data in localStorage (#1172)
  fix bug  where pasting url into address bar clears its content (#1166)
samsymons added a commit that referenced this pull request May 23, 2023
# By Alexey Martemyanov (56) and others
# Via Dominik Kapusta (6) and others
* upstream_develop: (267 commits)
  Fix creating DMG images in GitHub Actions (#1185)
  Update Privacy Dashboard info on redirect (#1186)
  Update BSK with autofill 6.5.1 (#1182)
  Only use LazyVStack on home page when on macos 12 or higher (#1181)
  Version 1.38.2
  Update PULL_REQUEST_TEMPLATE.md (#1173)
  New Dax Icons (#1179)
  fix Tab Bar disappearing in Fullscreen Split View (#1168)
  Sabrina/allow tabs in single tab windows to be moved to other windows (#1174)
  Version 1.38.1
  Version 1.38.0
  Embeded files updated
  Fix TabBar scrolling (#1178)
  Remove the Fire button pixel (#1151)
  remove duck player pixels (#1176)
  Adding a mitigation for youtube-nocookie storing data in localStorage (#1172)
  Version 1.38.1
  fix bug  where pasting url into address bar clears its content (#1166)
  Version 1.38.0
  Embeded files updated
  ...

# Conflicts:
#	.github/workflows/danger.yml
#	.github/workflows/pr.yml
#	.github/workflows/release.yml
#	.swiftlint.tests.yml
#	.swiftlint.yml
#	.xcode-version
#	Configuration/AppStoreBuildNumber.xcconfig
#	Configuration/Configuration.xcconfig
#	Configuration/Tests/IntegrationTests.xcconfig
#	Configuration/Tests/UnitTests.xcconfig
#	Configuration/Version.xcconfig
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGo Privacy Browser App Store.xcscheme
#	DuckDuckGo/API/APIHeaders.swift
#	DuckDuckGo/API/APIRequest.swift
#	DuckDuckGo/App Delegate/UpdateController.swift
#	DuckDuckGo/AppDelegate/AppDelegate.swift
#	DuckDuckGo/AppDelegate/AppIconChanger.swift
#	DuckDuckGo/AppDelegate/URLEventHandler.swift
#	DuckDuckGo/Assets.xcassets/Images/InternalChannelIcon.imageset/Contents.json
#	DuckDuckGo/Autoconsent/AutoconsentUserScript.swift
#	DuckDuckGo/Autoconsent/UI/CookieConsentPopoverManager.swift
#	DuckDuckGo/Autofill/ContentOverlayViewController.swift
#	DuckDuckGo/Bookmarks/Model/BookmarkList.swift
#	DuckDuckGo/Bookmarks/Model/BookmarkManager.swift
#	DuckDuckGo/Bookmarks/Services/BookmarkStore.swift
#	DuckDuckGo/Bookmarks/View/AddBookmarkModalViewController.swift
#	DuckDuckGo/Bookmarks/View/BookmarkListViewController.swift
#	DuckDuckGo/Bookmarks/View/BookmarkManagementDetailViewController.swift
#	DuckDuckGo/Bookmarks/View/BookmarkManagementSidebarViewController.swift
#	DuckDuckGo/Bookmarks/ViewModel/BookmarkViewModel.swift
#	DuckDuckGo/Browser Tab/Extensions/AdClickAttributionTabExtension.swift
#	DuckDuckGo/Browser Tab/Model/Tab.swift
#	DuckDuckGo/Browser Tab/ViewModel/WebViewStateObserver.swift
#	DuckDuckGo/Common/AppVersion.swift
#	DuckDuckGo/Common/Database/Database.swift
#	DuckDuckGo/Common/Extensions/FileManagerExtension.swift
#	DuckDuckGo/Common/Extensions/NSAlertExtension.swift
#	DuckDuckGo/Common/Extensions/NSApplicationExtension.swift
#	DuckDuckGo/Common/Extensions/NSColorExtension.swift
#	DuckDuckGo/Common/Extensions/NSPasteboardExtension.swift
#	DuckDuckGo/Common/Extensions/NSPasteboardItemExtension.swift
#	DuckDuckGo/Common/Extensions/WKUserContentControllerExtension.swift
#	DuckDuckGo/Common/Extensions/WKWebViewExtension.swift
#	DuckDuckGo/Common/Localizables/UserText.swift
#	DuckDuckGo/Common/Logging/Logging.swift
#	DuckDuckGo/Common/Utilities/ErrorWithParameters.swift
#	DuckDuckGo/Common/Utilities/UserDefaultsWrapper.swift
#	DuckDuckGo/Common/View/AppKit/NSSavePanelExtension.swift
#	DuckDuckGo/Configuration/ConfigurationDownloading.swift
#	DuckDuckGo/Configuration/ConfigurationStore.swift
#	DuckDuckGo/ContentBlocker/AppPrivacyConfigurationDataProvider.swift
#	DuckDuckGo/ContentBlocker/AppTrackerDataSetProvider.swift
#	DuckDuckGo/ContentBlocker/macos-config.json
#	DuckDuckGo/ContentBlocker/trackerData.json
#	DuckDuckGo/Data Import/Logins/Firefox/FirefoxBerkeleyDatabaseReader.m
#	DuckDuckGo/Favicons/Model/FaviconManager.swift
#	DuckDuckGo/Feedback/View/FeedbackPresenter.swift
#	DuckDuckGo/File Download/Model/UTType.swift
#	DuckDuckGo/FileDownload/Extensions/WKWebView+Download.swift
#	DuckDuckGo/FileDownload/Model/FileDownloadManager.swift
#	DuckDuckGo/Fire/Model/Fire.swift
#	DuckDuckGo/HomePage/Model/HomePageFavoritesModel.swift
#	DuckDuckGo/HomePage/View/FavoritesView.swift
#	DuckDuckGo/Info.plist
#	DuckDuckGo/Main/View/MainWindowController.swift
#	DuckDuckGo/Menus/MainMenu.storyboard
#	DuckDuckGo/Menus/MainMenu.swift
#	DuckDuckGo/Menus/MainMenuActions.swift
#	DuckDuckGo/Menus/SharingMenu.swift
#	DuckDuckGo/NavigationBar/PinningManager.swift
#	DuckDuckGo/NavigationBar/View/AddressBarButtonsViewController.swift
#	DuckDuckGo/NavigationBar/View/AddressBarTextField.swift
#	DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift
#	DuckDuckGo/NavigationBar/View/NavigationBar.storyboard
#	DuckDuckGo/NavigationBar/View/NavigationBarViewController.swift
#	DuckDuckGo/PasswordManager/Bitwarden/Model/BWManagement.swift
#	DuckDuckGo/PasswordManager/Bitwarden/Model/BWManager.swift
#	DuckDuckGo/PasswordManager/Bitwarden/View/BWNotRespondingAlert.swift
#	DuckDuckGo/Preferences/Model/AutofillPreferencesModel.swift
#	DuckDuckGo/Preferences/View/Preferences.swift
#	DuckDuckGo/Preferences/View/PreferencesAutofillView.swift
#	DuckDuckGo/Preferences/View/PreferencesViewController.swift
#	DuckDuckGo/Smarter Encryption/HTTPSBloomFilterSpecification.swift
#	DuckDuckGo/Smarter Encryption/HTTPSUpgrade.swift
#	DuckDuckGo/Smarter Encryption/Store/AppHTTPSUpgradeStore.swift
#	DuckDuckGo/Statistics/ATB/StatisticsLoader.swift
#	DuckDuckGo/Statistics/PixelEvent.swift
#	DuckDuckGo/Statistics/PixelParameters.swift
#	DuckDuckGo/Tab/Model/Tab+Dialogs.swift
#	DuckDuckGo/Tab/Model/Tab+UIDelegate.swift
#	DuckDuckGo/Tab/TabExtensions/TabExtensions.swift
#	DuckDuckGo/Tab/View/BrowserTabViewController.swift
#	DuckDuckGo/TabBar/View/TabBarViewController.swift
#	DuckDuckGo/TabBar/View/TabDragAndDropManager.swift
#	DuckDuckGo/TabBar/ViewModel/TabCollectionViewModel.swift
#	DuckDuckGo/Youtube Player/PrivatePlayer.swift
#	DuckDuckGo/YoutubePlayer/YoutubePlayerUserScript.swift
#	Integration Tests/Autoconsent/AutoconsentBackgroundTests.swift
#	IntegrationTests/autoconsent-test-page-banner.html
#	LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/HoverButton.swift
#	LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/TextButton.swift
#	Packages/NetworkProtectionUI/Tests/NetworkProtectionUITests/NetworkProtectionUITests.swift
#	Submodules/privacy-reference-tests
#	Unit Tests/Browser Tab/Model/TabTests.swift
#	Unit Tests/Configuration/ConfigurationDownloaderTests.swift
#	Unit Tests/User Agent/Model/UserAgentTests.swift
#	Unit Tests/Youtube Player/PrivatePlayerTests.swift
#	UnitTests/App/WindowManagerStateRestorationTests.swift
#	UnitTests/Bookmarks/Services/LocalBookmarkStoreTests.swift
#	UnitTests/Common/Extensions/FutureExtensionTests.swift
#	UnitTests/Common/FileSystemDSLTests.swift
#	UnitTests/ContentBlocker/AppPrivacyConfigurationTests.swift
#	UnitTests/HomePage/RecentlyVisitedSiteModelTests.swift
#	UnitTests/PrivacyReferenceTests/FireproofingReferenceTests.swift
#	UnitTests/PrivacyReferenceTests/PrivacyReferenceTestHelper.swift
#	fastlane/metadata/default/release_notes.txt
#	scripts/archive.sh
#	set_version.sh
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants