Skip to content

🙏 Change SVG icon loading format #3125

@corocoto

Description

@corocoto

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 / 请选择

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions