Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Widget: support CSP nonces for injected styles

未關閉
#460 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@piyusshhjangid 已經在處理了。

開始於 2026年10月29日。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
55/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
typescript
領域
frontend, security

研究方向

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 內容生成。

描述

enhancement
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 小時 39 分鐘
30 天內合併 PR
275

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

codercops/chatcops 的其他 Issue

查看 codercops/chatcops 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。