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

fix: change .innerHTML to .textContent for CSP compliance #111

Merged
merged 1 commit into from Nov 8, 2023

Commits on Nov 7, 2023

  1. fix: change .innerHTML to .textContent for CSP compliance

    I think we should use `textContent` to reduce CSP (Content  Security Policy) requirements. If we add CSP `require-trusted-types-for 'script'`, then it blocks `innerHTML` unless it's `TrustedHTML`, however in the case of this lib's usage, we can simply replace the `innerHTML` with `textContent` which has the exact same effect and is more CSP compliant
    
    For reference, you can see this [PR](vitejs/vite#10801) on the Vite project, they've done the exact same code change.
    ghiscoding committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    cff0b6d View commit details
    Browse the repository at this point in the history