DEV Community

LG
LG

Posted on

Content-Security-Policy (CSP) warning in Electron – how to disable it?

There might be plenty of reasons why we do not want to defined stuff within package.json one one them – flexibility, dedication for yoga ? Hmm maybe , whichever the reason would be let's go remove CSP warning – there least two ways to do so :


Disable through CLI

Consider running Electron's app source file main.js within CLI as so: ELECTRON_DISABLE_SECURITY_WARNINGS=true npx electron main.js

Hereby using npx I did consider you was clever and installed Electron locally beforehand .

Disable through the process

Define anywhere (top-level would be at best) the following

process.env['ELECTRON_DISABLE_SECURITY_WARNINGS']=true
Enter fullscreen mode Exit fullscreen mode

Useful references

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)