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

[JENKINS-73974] Remove empty script tags for CSP compatibility #349

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

yaroslavafenkin
Copy link
Contributor

https://issues.jenkins.io/browse/JENKINS-73974

Testing done

Going to the configuration page of a freestyle job and adding node and/or label parameters is enough to trigger the violation.

https://www.loom.com/share/1919640546d84ad8a66946cd4f587951

https://www.loom.com/share/7e88064256f44aaab8de09fdb7ea9c51?sid=9c2b9edd-4af1-4254-a133-112df6afaee6

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@yaroslavafenkin yaroslavafenkin requested a review from a team as a code owner October 18, 2024 11:01
@yaroslavafenkin
Copy link
Contributor Author

Regarding the error in console that appears on the screen recording. At the time when

document.querySelector('input[type="radio"][name$=triggerIfResult]').addEventListener('change', function () {
is executed the element that is selected does not exist yet. This ready function
function ready(fn) {
if (document.readyState != 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
};
is not good enough in case when elements are added dynamically to the page (e.g. hetero-list), because document is already in a state of complete and DOMContentLoaded has probably fired long time ago.

@MarkEWaite MarkEWaite changed the title [JENKINS-73974] Clean up empty script tags for CSP compatibility [JENKINS-73974] Remove empty script tags for CSP compatibility Oct 18, 2024
Copy link
Member

@basil basil left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@basil
Copy link
Member

basil commented Oct 18, 2024

@MarkEWaite Can this please be merged and released for ATH?

@MarkEWaite MarkEWaite added the bug Incorrect or flawed behavior label Oct 18, 2024
@MarkEWaite MarkEWaite merged commit c930b63 into jenkinsci:master Oct 18, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect or flawed behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants