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

🙏 Change SVG icon loading format #3125

Open
corocoto opened this issue Mar 20, 2025 · 3 comments
Open

🙏 Change SVG icon loading format #3125

corocoto opened this issue Mar 20, 2025 · 3 comments
Labels
🙏feature request 新需求支持

Comments

@corocoto
Copy link
Contributor

Describe the feature / 功能描述

Hello,

I would like to propose a change in the way SVG icons are loaded in the S2 library. Currently, SVG icons are embedded using the data:image format. While this approach is convenient, it poses a challenge for applications that have a strict Content Security Policy (CSP) in place, specifically when the image-src 'self' directive is used.

The data:image format is not compatible with the image-src 'self' directive, leading to issues where SVG icons fail to load unless the CSP is relaxed. However, weakening the CSP configuration is not a desirable solution due to security concerns.

Image

Image

To address this, I suggest modifying the process of loading SVG icons in a way that is compatible with strict CSP settings.

Implementing this change would enhance the library's compatibility with secure web applications and allow developers to maintain robust CSP configurations without compromising on functionality.

Design the API / API 设计

name type default description
- - - -

Are you willing to contribute? / 是否愿意参与贡献?

Please select / 请选择

@corocoto corocoto added the 🙏feature request 新需求支持 label Mar 20, 2025
Copy link
Contributor

你好 @corocoto:

🌟 我们需要你的支持!

AntV/S2 的成长离不开社区的力量,期待您用以下方式与我们同行:

1. 点亮星星标记 ✨

如果 S2 为您的项目创造价值,请为我们点亮 GitHub Star!
这个简单的动作将:

  • 提升项目在开源生态的可见度
  • 激励维护团队持续优化
  • 吸引更多开发者参与共建

⭐ 立即点亮 Star

2. 加入用户荣誉墙 🏆

我们正在建立「S2 用户案例」展示墙,欢迎留下公司或产品名,您的回复将成为维护者、社区用户和观望者的信心来源 💪🏻

📝 登记使用案例

提 Issue 须知

⚠️ 在提出问题前,请确保你已经仔细阅读👓/搜索🔍过 官方文档常见问题 以及 图表示例, 并且已经搜索查阅过相关 Issues 列表Discussions 列表. 当你确定自己的问题没有解决方案时,请提交 issue。 ⚠️

如果是使用问题,不知道怎么用,移步 Discussions 讨论区 并提供 有效信息 进行 提问

参与社区共建

这是一个开源项目, 我们也有繁忙的业务要做, 是用自己的业余时间在维护, 为爱发电, 精力有限, 所以有时候 issue 响应速度不是那么及时, 如果你遇到了问题, 或者对 IssuesDiscussions 列表的问题感兴趣, 可以直接认领并尝试修复 (贡献指南),帮助 S2 变得更好

Copy link

Thank you for your suggestion regarding the change in SVG icon loading format in the S2 library. Your proposal to modify the process to be compatible with strict Content Security Policy (CSP) settings is noted. This change could indeed enhance the library's compatibility with secure web applications, allowing developers to maintain robust CSP configurations without compromising functionality.

Your feature request will be considered by the team. If you have any further questions or need assistance, feel free to reach out.

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

@Alexzjt
Copy link
Contributor

Alexzjt commented Mar 21, 2025

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙏feature request 新需求支持
Projects
None yet
Development

No branches or pull requests

2 participants