Widget: support CSP nonces for injected styles
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start by locating the loader and the code that creates styles for the chat panel and lazy pre-chat form; the issue does not name files or tests. Trace how script-tag installs can read the script nonce and how ESM configuration is defined, then inspect existing widget tests. Done means every created style element accepts the host nonce, nonce-based tests cover the loader, panel, and lazy pre-chat styles, and behavior without a nonce remains unchanged.
由索引模型根据 Issue 内容生成。
描述
What problem would this solve?
The widget injects <style> elements into its shadow roots for the launcher, chat panel, and pre-chat form. On sites with a strict Content Security Policy that blocks inline styles, those styles can be rejected, leaving the widget unstyled or unusable. This affects both the initial loader and styles added when the pre-chat form loads.
What would you like to happen?
Let the widget apply a host-provided CSP nonce to every style element it creates. For script-tag installs, it could use the nonce on the ChatCops script; ESM users should have a configuration option to provide one. Document the setup and add tests covering the loader, panel, and lazy pre-chat styles under a nonce-based policy. Keep the existing behavior unchanged when no nonce is configured.
Contributing
- I'd like to work on this myself
- 主要语言
- TypeScript
- 星标
- 13
- 派生
- 7
- 平均合并
- 3 小时 10 分钟
- 30 天内合并 PR
- 339
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codercops/chatcops 的其他 Issue
-
documentation
难度 3/5 1-2 天 新手友好度 72/100
codercops/chatcops#555 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 25/100
codercops/chatcops#546 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 64/100
codercops/chatcops#542 · 3 条评论 ·
维护者通常 1 天内回复
-
Server: validate `rateLimit.windowMs` before creating the limiter可能已有人在做 @ashutoshpalhare 于 2 天前认领。 未关闭
codercops/chatcops#452 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Widget: a "New reply" button when the visitor has scrolled up可能已有人在做 @srujankaleru2007 于 3 天前认领。 未关闭enhancement widget
codercops/chatcops#420 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 codercops/chatcops 的全部 Issue
相似的 Issue
-
bug low priority
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 66/100
laaielichter/Godotwright#81 ·
维护者通常 1 天内回复
-
gebied: infra
难度 2/5 1-3 小时 新手友好度 72/100
VincentSmedinga/sc-heerenveen-fansite#538 ·
维护者通常 1 天内回复
-
CI grants a token it does not need, never cancels superseded runs, and cannot fail on lint warnings未关闭good first issue help wanted type:infrastructure type:security
难度 2/5 1-3 小时 新手友好度 70/100
Open-Glassbeetle/glassbeetle#247 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复