Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@raethlein
Copy link
Collaborator

Describe your changes

Follow-up of #11948 and #12087
Allows configuring the crossorigin attribute also for the img element used by the st.logo command.

GitHub Issue Link (if applicable)

Testing Plan

  • Explanation of why no additional tests are needed
  • Unit Tests (JS and/or Python)
    • Added JavaScript unit tests
  • E2E Tests
  • Any manual testing needed?

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@raethlein raethlein requested a review from lukasmasuch August 15, 2025 10:13
@snyk-io
Copy link
Contributor

snyk-io bot commented Aug 15, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@github-actions
Copy link
Contributor

github-actions bot commented Aug 15, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-12226/streamlit-1.48.1-py3-none-any.whl
🕹️ Preview app pr-12226.streamlit.app (☁️ Deploy here if not accessible)

@raethlein raethlein added area:frontend Related to frontend aspects security-assessment-completed Security assessment has been completed for PR change:other PR contains other type of change impact:users PR changes affect end users feature:st.logo Related to `st.logo` command labels Aug 15, 2025
Copy link
Collaborator

@lukasmasuch lukasmasuch 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 +72 to +75
const crossOrigin = getCrossOriginAttribute(
libConfig.resourceCrossOriginMode,
displayImage
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: isn't useCrossOriginAttribute also usable here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, I used that first but since hooks have to be called unconditionally, it has to be above the if check and the useCrossOriginAttribute hook takes the URL, so the displayImage block would have to be moved up as well and the if condition changed which made it a little bit messier, so I switched to this option here to keep the rest the same

@raethlein raethlein merged commit 5860779 into develop Aug 15, 2025
40 of 41 checks passed
@raethlein raethlein deleted the raethlein-crossorigin-logo branch August 15, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Related to frontend aspects change:other PR contains other type of change feature:st.logo Related to `st.logo` command impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants