www: Correct UX of the copy button#2398
Conversation
|
Our CSP is defined in I'd prefer not to tweak the CSP: we intentionally made it as strict as possible, and this PR allows way more stuff than necessary (including var buttons = document.querySelectorAll(".copy-button");
for (int i = 0; i < buttons.length; i++) {
buttons[i].addEventListener("click", handle_copy_button_click);
} |
bbabdbd to
1de72ba
Compare
I've tried out @pietroalbini's suggestion, and tested locally using "test" keyword to validate the style & functionality of the copy button. platform-instructions-unixplatform-instructions-win32platform-instructions-win64platform-instructions-unknownplatform-instructions-default |
1de72ba to
4f4ca06
Compare
|
So, I personally have no reason to believe this won't work, providing @BeniCheni has checked it on both chrome and firefox, and via an HTTP service with a similar CSP to the one on rustup.rs. @pietroalbini do you think this is OK? |
|
Yeah this looks correct. |
www: Correct UX of the copy button





Fixes #2397.
Triaged. It seems that the click on the copy button would run into a console error about CSP (Content Security Policy) Unsafe_inline_script:
Attempt to fix by a JavaScript solution