Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap clean link to a feature flag #17673

Merged
merged 1 commit into from
Mar 21, 2023
Merged

Wrap clean link to a feature flag #17673

merged 1 commit into from
Mar 21, 2023

Conversation

spylogsster
Copy link
Contributor

@spylogsster spylogsster commented Mar 20, 2023

Resolves brave/brave-browser#29177

  • Enabled flag means we replace default Ctrl+C hotkey and it copies sanitized url.
  • Disabled flag means we DO NOT replace default Ctrl+C hotkey and it copies url as usual.

image

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run lint, npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

  • Enable feature and check that we replace Ctrl+C default hotkey
  • Disable feature and check that we do not replcae default Ctrl+C hotkey

@spylogsster spylogsster force-pushed the clean-link-flag branch 4 times, most recently from b710a99 to 7eb5671 Compare March 20, 2023 17:54
@spylogsster spylogsster marked this pull request as ready for review March 20, 2023 18:04
browser/about_flags.cc Outdated Show resolved Hide resolved
browser/brave_browser_features.cc Outdated Show resolved Hide resolved
@spylogsster spylogsster merged commit 002f825 into master Mar 21, 2023
@spylogsster spylogsster deleted the clean-link-flag branch March 21, 2023 05:06
@github-actions github-actions bot added this to the 1.51.x - Nightly milestone Mar 21, 2023
@LaurenWags
Copy link
Member

LaurenWags commented Mar 21, 2023

Verified with

Brave | 1.51.51 Chromium: 112.0.5615.29 (Official Build) nightly (x86_64)
-- | --
Revision | 8a59304c62e066962363d2fd8edd8e7b459c42bd-refs/branch-heads/5615@{#497}
OS | macOS Version 12.6.3 (Build 21G419)

Confirmed flag is available with 1.51.51. Note, flag name/title is different than PR description. Confirmed it is as expected with @rebron:

Screen Shot 2023-03-21 at 3 21 20 PM

Default - PASSED

Ran through the below steps to confirm expected locations of "Copy clean link" option from macOS app menu, context menu, share menu, and keyboard shortcut (Cmd + C on macOS):

  1. Confirmed value of "Default" for brave://flags/#brave-copy-clean-link-by-default
  2. Visited https://dev-pages.bravesoftware.com/clean-urls/?brave_testing1=foo&brave_testing2=bar&brave_testing3=keep&&;b&d&utm_content=removethis&e=&f=g&=end
  3. Clicked the URL bar and confirmed "Copy clean link" available from macOS app menu and has the cmd + C keyboard shortcut (⌘C) listed next to it
  4. Right-clicked the URL and confirmed "Copy clean link" is in the context menu
  5. Confirmed "Copy clean link" is displayed in the share menu from URL bar
  6. Used "Cmd + C" while the URL bar is in focus to copy the URL
  7. Opened a new tab and pasted the copied URL
  8. Confirmed link is https://dev-pages.bravesoftware.com/clean-urls/?brave_testing3=keep&&;b&d&e=&f=g&=end as per the original issue verification from "Copy clean URL" feature brave-browser#23315
  9. Opened a new tab and visited https://twitter.com/LBC/status/1577628501364146176?s=20&t=fpVMBMSfgI_pNGQxxpV6bw
  10. Used "Cmd + C" while the URL bar is in focus to copy the URL
  11. Opened a new tab and pasted the copied link
  12. Confirmed link pasted is https://twitter.com/LBC/status/1577628501364146176 as per the original issue verification from "Copy clean URL" feature brave-browser#23315
Step 0 Step 2 Step 3 Step 4 Step 7 Step 8 Step 11
0 2 3 4 7 8 11
Disabled - PASSED

Case A: Ran through appropriate cases on https://fmarier.github.io/brave-testing/copy-clean-link.html to confirm functionality still works with the keyboard shortcut disabled. (spot check of "Copy clean link" functionality)

Case B: Ran through the below steps to confirm expected locations of "Copy clean link" option and confirm that keyboard shortcut (Cmd + C on macOS) is not used for "Copy clean link":

  1. Confirmed value of "Disabled" for brave://flags/#brave-copy-clean-link-by-default
  2. Visited https://dev-pages.bravesoftware.com/clean-urls/?brave_testing1=foo&brave_testing2=bar&brave_testing3=keep&&;b&d&utm_content=removethis&e=&f=g&=end
  3. Clicked the URL bar and confirmed "Copy clean link" available from macOS app menu and it does NOT have the cmd + C keyboard shortcut (⌘C) listed next to it, this is listed next to "Copy" as expected
  4. Right-clicked the URL and confirmed "Copy clean link" is in the context menu
  5. Confirmed "Copy clean link" is displayed in the share menu from URL bar
  6. Used "Cmd + C" while the URL bar is in focus to copy the URL
  7. Opened a new tab and pasted the copied URL
  8. Confirmed link pasted is the original URL with all parameters: https://dev-pages.bravesoftware.com/clean-urls/?brave_testing1=foo&brave_testing2=bar&brave_testing3=keep&&;b&d&utm_content=removethis&e=&f=g&=end
  9. Opened a new tab and visited https://twitter.com/LBC/status/1577628501364146176?s=20&t=fpVMBMSfgI_pNGQxxpV6bw
  10. Used "Cmd + C" while the URL bar is in focus to copy the URL
  11. Opened a new tab and pasted the copied link
  12. Confirmed link pasted is the original URL with all parameters https://twitter.com/LBC/status/1577628501364146176?s=20&t=fpVMBMSfgI_pNGQxxpV6bw
Step 0 Step 2 Step 3 Step 4 Step 7 Step 8 Step 11
0 2 3 4 7 8 11
Enabled - PASSED

Case A: Ran through appropriate cases on https://fmarier.github.io/brave-testing/copy-clean-link.html to confirm functionality works as expected with the keyboard shortcut enabled. (spot check of "Copy clean link" functionality)

Case B: Ran through the below steps to confirm expected locations of "Copy clean link" option and confirm that keyboard shortcut (Cmd + C on macOS) is used for "Copy clean link":

  1. Confirmed value of "Default" for brave://flags/#brave-copy-clean-link-by-default
  2. Visited https://dev-pages.bravesoftware.com/clean-urls/?brave_testing1=foo&brave_testing2=bar&brave_testing3=keep&&;b&d&utm_content=removethis&e=&f=g&=end
  3. Clicked the URL bar and confirmed "Copy clean link" available from macOS app menu and has the cmd + C keyboard shortcut (⌘C) listed next to it
  4. Right-clicked the URL and confirmed "Copy clean link" is in the context menu
  5. Confirmed "Copy clean link" is displayed in the share menu from URL bar
  6. Used "Cmd + C" while the URL bar is in focus to copy the URL
  7. Opened a new tab and pasted the copied URL
  8. Confirmed link is https://dev-pages.bravesoftware.com/clean-urls/?brave_testing3=keep&&;b&d&e=&f=g&=end as per the original issue verification from "Copy clean URL" feature brave-browser#23315
  9. Opened a new tab and visited https://twitter.com/LBC/status/1577628501364146176?s=20&t=fpVMBMSfgI_pNGQxxpV6bw
  10. Used "Cmd + C" while the URL bar is in focus to copy the URL
  11. Opened a new tab and pasted the copied link
  12. Confirmed link pasted is https://twitter.com/LBC/status/1577628501364146176 as per the original issue verification from "Copy clean URL" feature brave-browser#23315
Step 0 Step 2 Step 3 Step 4 Step 7 Step 8 Step 11
0 2 3 4 7 8 11

kjozwiak pushed a commit that referenced this pull request Mar 22, 2023
kjozwiak pushed a commit that referenced this pull request Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrap copy clean link hotkey replacement to a feature flag
4 participants