Reputation: 151
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
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