解决 Cursor Debugger 模式在 Electron 项目中无法使用问题
项目是 electron 写的,使用 Cursor 调试模式遇到了日志无法上报问题,报错如下
Refused to connect to 'h customslashMenu.tsx:53ttp://127.0.0.1:7242/ingest/459a74c4-d46f-4699-6894-d4f3106d294c' because it violates the document'sContent security Policy |
原因是: renderer 进程的 Content-Security-Policy 禁止连接 http://127.0.0.1:7242
解决方法很简单,设置为允许连接就好了,在 index.html 中加一行说明
<!-- connect-src 含 http://127.0.0.1:7242 以便 Debug 模式向本地日志服务发送 fetch --> |
本文标题:解决 Cursor Debugger 模式在 Electron 项目中无法使用问题
文章作者:Canace
发布时间:2026-02-05
最后更新:2026-02-05
原始链接:https://canace.site/cursor-debugger/
版权声明:转载请注明出处
分享