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 "do not track" query parameter to vimeo links in the video widget to ensure tracking/analytics cookies don't get set. #795

Merged
merged 3 commits into from
Nov 14, 2023

Conversation

ioanacrant
Copy link
Member

Summary:

Issue: https://khanacademy.atlassian.net/browse/INFRA-9620

Test plan:

  • tested that parameter got added in video widget in storybook

… to ensure tracking/analytics cookies don't get set.

Issue: https://khanacademy.atlassian.net/browse/INFRA-9620

Test plan:
- tested that parameter got added in video widget in storybook
@ioanacrant ioanacrant self-assigned this Nov 8, 2023
@khan-actions-bot khan-actions-bot requested a review from a team November 8, 2023 21:25
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Nov 8, 2023

Gerald

Required Reviewers
  • @Khan/perseus for changes to .changeset/olive-shrimps-marry.md, packages/perseus/src/widgets/video.tsx, packages/perseus/src/widgets/__stories__/video.stories.tsx, packages/perseus/src/widgets/__testdata__/video.testdata.ts, packages/perseus/src/widgets/__tests__/video.test.ts

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

Copy link
Contributor

github-actions bot commented Nov 8, 2023

npm Snapshot: Published

🎉 Good news!! We've packaged up the latest commit from this PR (d936786) and published it to npm. You
can install it using the tag PR795.

Example:

yarn add @khanacademy/perseus@PR795

Copy link
Contributor

github-actions bot commented Nov 8, 2023

Size Change: +174 B (0%)

Total Size: 863 kB

Filename Size Change
packages/perseus/dist/es/index.js 404 kB +174 B (0%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 38.1 kB
packages/kmath/dist/es/index.js 4.25 kB
packages/math-input/dist/es/index.js 108 kB
packages/perseus-core/dist/es/index.js 907 B
packages/perseus-editor/dist/es/index.js 269 kB
packages/perseus-error/dist/es/index.js 878 B
packages/perseus-linter/dist/es/index.js 21.8 kB
packages/pure-markdown/dist/es/index.js 3.77 kB
packages/simple-markdown/dist/es/index.js 12.4 kB

compressed-size-action

Copy link

codecov bot commented Nov 8, 2023

Codecov Report

Merging #795 (d936786) into main (f124ef9) will increase coverage by 1.25%.
Report is 2 commits behind head on main.
The diff coverage is 81.81%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #795      +/-   ##
==========================================
+ Coverage   60.68%   61.93%   +1.25%     
==========================================
  Files         483      485       +2     
  Lines      105876   105881       +5     
  Branches     6225     8920    +2695     
==========================================
+ Hits        64249    65577    +1328     
+ Misses      41627    40304    -1323     

Impacted file tree graph

Files Coverage Δ
packages/perseus/src/widgets/video.tsx 87.40% <81.81%> (+0.31%) ⬆️

... and 34 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f124ef9...d936786. Read the comment docs.

Copy link
Collaborator

@jeremywiebe jeremywiebe left a comment

Choose a reason for hiding this comment

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

Could you add a unit test or two for this change? You should be able to use the tests in video.test.ts as a guide and then assert with something like:

expect(document.getElementsByTagName("iframe")[0].src).toContain(
    "dnt=1",
);

Copy link
Contributor

@handeyeco handeyeco left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +83 to +87
if (url.indexOf("?") === -1) {
url += "?dnt=1";
} else {
url += "&dnt=1";
}
Copy link
Contributor

Choose a reason for hiding this comment

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

No action needed: I think this is fine to ship as-is, but there's also the URLSearchParams API now.

@ioanacrant ioanacrant merged commit 2adb82b into main Nov 14, 2023
12 checks passed
@ioanacrant ioanacrant deleted the video-widget-vimeo branch November 14, 2023 18:10
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.

4 participants