Skip to content

vite-ssg 生成 inline script 产生的问题 #49

@tshemeng

Description

@tshemeng

我使用vite-ssg生成.html,然后打包为浏览器扩展,在feat: Add Initial State这个commit之后,vite-ssg会在生成的.html文件末尾插入一段inline script,这会触发浏览器CSP错误,因为浏览器认为扩展中存在inline script是不安全的,是否可以添加选项选择是否启用这个特性呢

<script>window.__INITIAL_STATE__ = "{}"</script>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions