brklja
brklja

Reputation: 151

How to prevent screen captures in the Electron app?

Due to security reasons I need to prevent taking screenshots in my app. App gets built both for windows and for macOS so it needs to be prevented on both platforms.

Upvotes: 3

Views: 5514

Answers (1)

Gael Motte
Gael Motte

Reputation: 141

Electron offers the following method of BrowserWindow : setContentProtection https://www.electronjs.org/docs/api/browser-window#winsetcontentprotectionenable-macos-windows

Call that method on your main window or any window you want protected from screenshots. Supports MacOS and Windows

Upvotes: 14

Related Questions