Repository navigation
Conversation
|
π This pull request has been automatically marked as stale because it has been inactive for 30 days. It will be closed in 7 days if no further activity occurs. If you're still working on this PR, please:
Thank you for your contribution! π |
|
Rebased onto current @ibrahimcesar this is my first contribution here, so the Actions workflows (PR Title Check, Coverage Tests, etc.) are waiting for your one-click approval before they can run. Happy to adjust anything if you'd like it done differently. Fixes #331. |
209f2f7 to
29dd5ba
Compare
|
π This pull request has been automatically marked as stale because it has been inactive for 30 days. It will be closed in 7 days if no further activity occurs. If you're still working on this PR, please:
Thank you for your contribution! π |
YouTube's in-player "Copy link" and "Share" controls call the Clipboard and Web Share APIs from inside the cross-origin iframe. Permissions Policy grants those features to cross-origin frames only when the embedding <iframe> delegates them via its allow attribute, so with the current list the copy button fails with "Unable to copy link to clipboard" and Chrome logs "Permissions policy violation: The Clipboard API has been blocked". Align the allow list with YouTube's official embed snippet, which includes clipboard-write and web-share.
29dd5ba to
d6d56e1
Compare
|
Still relevant, so keeping this open. Rebased onto current Checked locally after the rebase on Node 24: lint, type-check, the 55 tests and the build all pass, and both @ibrahimcesar two small things when you have a moment:
Happy to change anything. Fixes #331. |
Summary
Adds
clipboard-writeandweb-shareto the player iframe'sallowattribute so YouTube's in-player Copy link and Share controls work. The new list matches YouTube's official embed snippet exactly:Fixes #331
Why
Permissions Policy grants
clipboard-writeandweb-shareto a cross-origin frame only when the embedding<iframe>delegates them. Without the tokens the player shows "Unable to copy link to clipboard" and Chrome logs a Permissions Policy violation (https://crbug.com/414348233). Mux'syoutube-video-elementhad the identical gap, fixed in muxinc/media-elements#248.Changes
src/lib/index.tsx: two tokens added to the hardcodedallowstring.src/lib/index.test.tsx: one test asserting both tokens are present after activation.Risk
Low. Single attribute string change, no logic touched, backward compatible. Both tokens are standard Permissions Policy features supported by Chromium, Firefox and Safari; browsers that do not recognise a token ignore it.
Verification