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

Add YouTube si param (JS) to copy clean link filter #33037

Closed
cadatoiva opened this issue Sep 15, 2023 · 9 comments · Fixed by brave/brave-core#24207
Closed

Add YouTube si param (JS) to copy clean link filter #33037

cadatoiva opened this issue Sep 15, 2023 · 9 comments · Fixed by brave/brave-core#24207
Assignees
Labels

Comments

@cadatoiva
Copy link

Description

SI (Source ID?) is a new query parameter found in YouTube share links when using their native share feature. I'd like to see it added to the filter for the Copy Clean Link feature.

Brave version (brave://version info)

1.58.124 Chromium: 117.0.5938.62 (Official Build) (64-bit)

Miscellaneous Information:

There is a tampermonkey script already made that also removes if from the share window entirely as if YouTube never changed the feature, for reference: https://github.com/Xenorio/YTShareAntiTrack

Is it also possible to get something similar to this included natively? Or to override the default javascript copy functions used by the copy button on the site to utilize copy clean link?

@rebron
Copy link
Collaborator

rebron commented Sep 16, 2023

cc: @fmarier

@fmarier
Copy link
Member

fmarier commented Sep 18, 2023

That's interesting, if I share a video while logged in, I get this (no si param):

https://youtu.be/dQw4w9WgXcQ?feature=shared

but if I share a video while logged out (in a private window), then I do get the si param:

https://youtu.be/dQw4w9WgXcQ?si=YjziZuccJeIE-b6z

It's a different ID if I open another private window:

https://youtu.be/dQw4w9WgXcQ?si=-L1iutc6oF6I9fkR

@cadatoiva Do you see the same thing as me or is it perhaps related to something in my Google account settings?

fmarier added a commit to brave/adblock-lists that referenced this issue Sep 18, 2023
@cadatoiva
Copy link
Author

cadatoiva commented Sep 26, 2023

@fmarier The si param shows up in all cases for me, logged in or not.

From what I've seen, the si param is meant to be some kind of unique tracking param based on who, from which page, and how the link was shared for more detailed analytics. It changes almost every time you click share.

@rebron rebron added priority/P3 The next thing for us to work on. It'll ride the trains. QA/Yes release-notes/include labels Dec 5, 2023
@rebron rebron changed the title Add youtube si param to copy clean link filter Add YouTube si param to copy clean link filter Dec 5, 2023
@fmarier fmarier added this to the 1.63.x - Nightly milestone Dec 5, 2023
@fmarier fmarier changed the title Add YouTube si param to copy clean link filter Add YouTube si param (JS) to copy clean link filter Dec 5, 2023
@fmarier
Copy link
Member

fmarier commented Dec 5, 2023

Note: this issue is about extending the copy-clean link feature to hook into the "copy to clipboard" JS code (what gets triggered when clicking YouTube's copy button instead of using regular copy/paste).

The regular copy-clean link list has already been updated in brave/adblock-lists#1317.

@fmarier
Copy link
Member

fmarier commented Jan 3, 2024

Note that this also affects Instagram: #35094

@fmarier fmarier removed this from the 1.63.x - Beta milestone Jan 26, 2024
@rebron rebron added this to General May 28, 2024
@rebron rebron moved this to On Deck in General May 28, 2024
@fmarier
Copy link
Member

fmarier commented Jun 11, 2024

Test plan is (in a private window):

  1. Open https://www.youtube.com/watch?v=G1IbRujko-A
  2. Click the Share button
  3. Click the Copy button
  4. Paste in a text editor

Actual:

  • https://youtu.be/G1IbRujko-A?si=E2YqZmvcWqjSh8cW

Expected:

  • https://youtu.be/G1IbRujko-A

The si parameter gets removed via the clean-urls list.

@rebron rebron removed their assignment Jun 11, 2024
@rebron rebron moved this from On Deck to In progress in General Jun 11, 2024
@github-project-automation github-project-automation bot moved this from In progress to Completed in General Jun 28, 2024
@brave-builds brave-builds added this to the 1.69.x - Nightly milestone Jun 28, 2024
fmarier added a commit to brave/adblock-lists that referenced this issue Jul 2, 2024
fmarier added a commit to brave/brave-core-crx-packager that referenced this issue Jul 3, 2024
@MadhaviSeelam
Copy link

MadhaviSeelam commented Jul 9, 2024

Verification PASSED using

Brave | 1.69.89 Chromium: 127.0.6533.26 (Official Build) nightly (64-bit)
-- | --
Revision | f446f85ae826780dfae5356eeec4480c0415670c
OS | Windows 11 Version 23H2 (Build 22631.3810)

Verified using the testplan from brave/brave-core#24207 (comment)

Note: currently step 4 modification is needed to pass this test as per @boocmp. Once the bug is fixed, no need to do modify the clean-urls-permissions.json file.

Normal window
  1. Installed 1.69.89
  2. launched Brave with --enable-features=BraveCopyCleanLinkFromJs
  3. close Brave
  4. changed js-api to js_api in clean-urls-permissions.json file in "AppData\Local\BraveSoftware\Brave-Browser-Nightly\User Data\afalakplffnnnlkncjhbmahjfjhmlkal\1.0.812\1" and save the file
  5. relaunched Brave
  6. loaded https://boocmp.github.io/clipboard/ in a new tab
  7. Copy the text (Cntrl +c) from the User action shouldn't be sanitized field
  8. paste the contents in the You can paste here text editor field
  9. confirmed si parameter is still shown in the text field
  10. refreshed the page
  11. Put any text (https://youtu.be/YA9VcEwVlQQ?si=TEGonZ-mQEkySIQh) in the Custom text: copy from text area and then clicked copy
  12. clicked Allow on permission prompt for Share clipboard
  13. clicked Copy again
  14. paste (Cntrl+V) in the You can paste here box
  15. confirmed contents without si parameter shown in both the Current clipboard content and You can paste here text editor fields (https://youtu.be/YA9VcEwVlQQ)
  16. clicked copy from the 3rd box - Copy from text area
  17. confirmed contents without si parameter shown in both the Current clipboard content and You can paste here text editor fields
  18. refreshed the page and clicked copy from 4th box - Navigator Clipboard API
  19. confirmed contents without si parameter shown in both the Current clipboard content and You can paste here text editor fields
  20. refreshed the page and clicked copy from 5th box - Copy from the temporary textarea
  21. confirmed contents without si parameter shown in both the Current clipboard content and You can paste here text editor fields
  22. refreshed the page and clicked copy from 6th box - Copy from div
  23. confirmed contents without si parameter shown in both the Current clipboard content and You can paste here text editor fields
step 4 step 9 step 11 step 15 step 17 step 19 step 21 step 23
image image image image image image image image
Private window

Verified using the STR from #33037 (comment)

  1. continued from Normal window testcase above
  2. opened Private window via hamburger menu
  3. visited https://www.youtube.com/watch?v=G1IbRujko-A in a new tab
  4. clicked Share button
  5. clicked Copy button (https://youtu.be/G1IbRujko-A?si=vnJbMbE1BBgcZT28)
  6. opened https://boocmp.github.io/clipboard/ in a new tab
  7. pasted in You can paste here text editor box

confirmed contents without si parameter shown in the You can paste here text editor field (https://youtu.be/G1IbRujko-A)

step 3-5 step 7
image image

@MadhaviSeelam MadhaviSeelam added QA Pass-Win64 QA/In-Progress Indicates that QA is currently in progress for that particular issue and removed QA Pass-Win64 QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Jul 11, 2024
@fmarier
Copy link
Member

fmarier commented Jul 11, 2024

Note: currently step 4 modification is needed to pass this test as per @boocmp. Once the bug is fixed, no need to do modify the clean-urls-permissions.json file.

Fix for that is here: brave/adblock-lists#1879

@MadhaviSeelam
Copy link

MadhaviSeelam commented Jul 16, 2024

Verification PASSED using

Brave | 1.69.110 Chromium: 127.0.6533.43 (Official Build) nightly (64-bit)
-- | --
Revision | b48482acae2813d6c44e4a83f48b479c56dbc116
OS | Windows 11 Version 23H2 (Build 22631.3880)

Reverified the issue with the fix brave/adblock-lists#1879

Normal window - PASSED
  1. Installed 1.69.110
  2. launched Brave with --enable-features=BraveCopyCleanLinkFromJs
  3. close Brave
  4. loaded https://boocmp.github.io/clipboard/ in a new tab
  5. Copy the text (Cntrl +c) from the User action shouldn't be sanitized field
  6. paste the contents in the You can paste here text editor field
  7. confirmed si parameter is still shown in the text field
  8. refreshed the page
  9. Put any text (https://youtu.be/YA9VcEwVlQQ?si=TEGonZ-mQEkySIQh) in the Custom text: copy from text area and then clicked copy
  10. clicked Allow on permission prompt for Share clipboard
  11. clicked Copy again
  12. paste (Cntrl+V) in the You can paste here box
  13. confirmed contents without si parameter shown in both the Current clipboard content and You can paste here text editor fields (https://youtu.be/YA9VcEwVlQQ)
  14. refreshed the page and clicked copy from the 3rd box - Copy from text area
  15. confirmed contents without si parameter shown in both the Current clipboard content and You can paste here text editor fields
  16. refreshed the page and clicked copy from 4th box - Navigator Clipboard API
  17. confirmed contents without si parameter shown in both the Current clipboard content and You can paste here text editor fields (https://youtu.be/8AHCfZTRGiI)
  18. refreshed the page and clicked copy from 5th box - Copy from the temporary textarea
  19. confirmed contents without si parameter shown in both the Current clipboard content and You can paste here text editor fields (https://youtu.be/8AHCfZTRGiI)
  20. refreshed the page and clicked copy from 6th box - Copy from div
  21. confirmed contents without si parameter shown in both the Current clipboard content and You can paste here text editor fields (https://youtu.be/8AHCfZTRGiI)
step 9 step 15 step 17 step 19 step 21
image image image image image
Private window - PASSED

Verified using the STR from #33037 (comment)

  1. continued from Normal window testcase above
  2. opened Private window via hamburger menu
  3. opened test page https://boocmp.github.io/clipboard/ in a new tab
  4. visited https://www.youtube.com/watch?v=G1IbRujko-A in a new tab
  5. clicked Share button
  6. clicked Copy button (https://youtu.be/G1IbRujko-A?si=Kb50iAdhRu2JOL7w)
  7. returned to test page pasted in You can paste here text editor box

confirmed contents without si parameter shown in the You can paste here text editor field (https://youtu.be/G1IbRujko-A)

step 3 step 4-6 step 7
image image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants