Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Electron’s BrowserWindow.setContentProtection(true) in the main process for each window you want to protect. Electron documents capture exclusion for macOS and Windows, but it is not a universal screenshot switch: Windows versions differ, newer macOS apps using ScreenCaptureKit can still capture protected windows, and Electron does not document an equivalent method for Linux.

Enable content protection on a BrowserWindow

Call setContentProtection(true) after creating the window, from Electron’s main process:

const { app, BrowserWindow } = require('electron')

app.whenReady().then(() => {
  const win = new BrowserWindow({
    width: 1000,
    height: 700
  })

  win.setContentProtection(true)
})

Electron defines this method as preventing window contents from being captured by other apps. The setting applies to that specific BrowserWindow; create several windows and enable it on each one that displays sensitive material.

Check whether protection is enabled

Use win.isContentProtected() when you need to verify the window’s configured state:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Magicmoon 2-Pack 24 Inch Computer Privacy Screen Filter for 16:9 Monitor
  • Compatible Model(s): Magicmoon brand filter only for 24 inch -diagonally measured - widescreen monitor - aspect ratio 16:9 - filter size: width: 20 15/16", Height: 11 13/16" (531mm x 298mm)
  • Superior Privacy: The computer privacy filter makes the screen appear dark when looking at it from an angle (the angle is about 30 to 60 degree), but bright when looking directly at it. To change the privacy level - simply adjust your monitor’s brightness accordingly
  • Eye and Screen Protection: Privacy Filter does not only protect your private life but also protects your eyes by blocking 30% of blue light , blocking the harmful blue light between 380 to 495 nm, it filters out the blue light and relieves eye strain
  • Perfect For Open Workspaces: Great for maintaining screen privacy in open work spaces
  • Includes Two Options: Option 1 uses clear adhesive strips that securely attach to any computer screen. Option 2 (for computer screens with a raised bezel only) uses slide mount tabs that easily stick to the display frame, allowing you to slide the privacy screen filter on and off as needed
const protectedNow = win.isContentProtected()
console.log(`Content protection enabled: ${protectedNow}`)

This reports Electron’s setting. It does not prove that every operating-system capture path or recorder will honor it.

Disable it deliberately

If your product has a user-controlled privacy mode, turn it off with win.setContentProtection(false). Keep the decision in the main process rather than exposing unrestricted window access to untrusted renderer code.

What happens on each operating system

The documented behavior is platform- and version-dependent. Treat “disable screenshots” as shorthand for capture exclusion where the operating system supports Electron’s request.

Platform Documented support What a capture application receives Important qualification
Windows 10 version 2004 and later Yes The protected window is removed from capture. Electron uses SetWindowDisplayAffinity with WDA_EXCLUDEFROMCAPTURE.
Older Windows versions Yes, with older behavior Captures show a black window. The behavior is equivalent to WDA_MONITOR, rather than complete removal.
macOS Yes, through the documented window-sharing setting Many capture paths should honor the exclusion. Newer Mac applications that use ScreenCaptureKit can still capture the window despite protection being enabled.
Linux No equivalent documented in the cited Electron API Not established by this API documentation. Do not advertise cross-platform screenshot blocking based on setContentProtection.

On macOS Electron maps the request to NSWindowSharingNone. Electron explicitly warns that newer applications using ScreenCaptureKit can capture the window anyway. Therefore, do not promise customers that screenshots or recordings are impossible.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Protect every relevant window

Protection belongs on the window that renders confidential content. If your app opens a settings window, modal, preview, or detached document in another BrowserWindow, configure that instance too.

Rank #2
SightPro 24 Inch 16:9 Computer Privacy Screen Filter for Monitor - Privacy Shield and Anti-Glare Protector
  • 【Privacy Filter Dimensions】- Width: 20 15/16" (532 mm), Height: 11 13/16" (299 mm), Diagonal: 24" (609.6 mm) - SightPro Blackout Privacy Screen Filter is engineered to be compatible with HP, Dell, Samsung, Lenovo, LG, Acer, ASUS, ViewSonic, and other monitor brands. Please verify your computer screen's width and height measurements before ordering. It's not recommended to make your selection based solely on your computer screen's diagonal size.
  • 【Two Attachment Options】- Installs in minutes. Option 1 uses clear adhesive strips that securely attach to any computer screen. Option 2 (for computer screens with a raised bezel only) uses slide mount tabs that easily stick to the display frame, allowing you to slide the privacy screen filter on and off as needed.
  • 【Superior Privacy and Anti Glare】- Our advanced multi-layered film filter blacks out your computer screen when viewing from the side, while maintaining a crystal clear screen straight-on. It also protects your eyes from harmful glare, UV, and blue light. [Note: It does not block visibility directly behind you, regardless of the distance.]
  • 【Perfect for Travel and Open Workspaces】- Our computer screen privacy filter is the ideal solution for healthcare providers, mobile workers, commuters, students, and business travelers. Now you can stay compliant and safeguard sensitive corporate information while working in airplanes, subways, airports and public areas.
  • 【Package Contents】- Each package includes one privacy screen shield filter, two sets of clear adhesive strips, two sets of slide mount tabs, and a microfiber cleaning cloth. Buy with confidence – located in the US, Sight Pro specializes in providing best-in-class privacy solutions to individuals, small businesses, corporations, government, and educational institutions. Our privacy screens are Section 889 and TAA compliant.
function createProtectedWindow(options = {}) {
  const win = new BrowserWindow({
    width: 1000,
    height: 700,
    ...options
  })

  win.setContentProtection(true)
  return win
}

app.whenReady().then(() => {
  const mainWindow = createProtectedWindow()
  mainWindow.loadFile('index.html')
})

Apply the setting before sensitive content appears

Create the window, set protection, and then load or reveal confidential UI. This ordering avoids briefly displaying protected content before the window’s capture policy is configured. It is still prudent to render a redacted or locked state until authentication and authorization complete.

Use a main-process policy for multiple window types

Centralizing window creation prevents a newly added window from accidentally omitting the setting:

const protectedWindowKinds = new Set(['main', 'document', 'payment'])

function makeWindow(kind) {
  const win = new BrowserWindow({ width: 1000, height: 700 })
  if (protectedWindowKinds.has(kind)) {
    win.setContentProtection(true)
  }
  return win
}

The set is application policy, not an Electron feature. Keep it close to the code that creates windows and review it whenever a new window type is introduced.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Expose a privacy toggle safely

If users may turn protection on or off, send a narrow command through a preload bridge. Do not give a remote or untrusted page direct access to the entire BrowserWindow object.

// main.js
const { app, BrowserWindow, ipcMain } = require('electron')

let win

app.whenReady().then(() => {
  win = new BrowserWindow({
    width: 1000,
    height: 700,
    webPreferences: {
      preload: require('path').join(__dirname, 'preload.js'),
      contextIsolation: true,
      nodeIntegration: false
    }
  })

  win.setContentProtection(true)
})

ipcMain.handle('privacy:set-content-protection', (_event, enabled) => {
  if (typeof enabled !== 'boolean' || !win || win.isDestroyed()) {
    return false
  }
  win.setContentProtection(enabled)
  return win.isContentProtected()
})
// preload.js
const { contextBridge, ipcRenderer } = require('electron')

contextBridge.exposeInMainWorld('privacy', {
  setContentProtection: (enabled) =>
    ipcRenderer.invoke('privacy:set-content-protection', enabled)
})

Validate the value in the main process even if the renderer already checks it. A compromised renderer should not be able to invoke arbitrary IPC channels or change unrelated windows.

Rank #3
[2 Pack] 24 Inch Computer Privacy Screen Filter for 16:9 Widescreen Monitor
  • 【24 PRIVACY FILTER DIMENSIONS】 Width: 20 15/16" (20.9 inches/532 mm), Height: 11 13/16" (11.8 inches/299 mm) - 16:9 Aspect Ratio. Mamol computer privacy filters are designed to be perfectly compatible with HP, Samsung, Dell, Lenovo, Acer, Asus, LG, ViewSonic and other brands of monitors. Please check the width and height dimensions of your computer screen before ordering. If you have any questions about the dimensions, please contact us.
  • 【ENHANCED PRIVACY PROTECTION】Mamol 24 inch computer privacy filter keeps your electronic information confidential, making it excellent for use in high traffic areas. the computer privacy screen 24 inch is designed with advanced microlouver technology to block visibility at around 30 degrees and black out screens completely near 60 degrees.
  • 【EYES PROTECTION】 This blackout privacy screen greatly reduces eye strain and minimizes potential hazards to vision. It filters 99.9% of UV rays and suppresses 98% of blue light. As a reversible 24-inch privacy screen filter: The glossy side of the protector provides extra clarity and greater privacy, and the matte side minimizes glare and distracting reflections. Satisfy your different daily uses as needed.
  • 【BETTER HD CLARTIY】Mamol 24 inch computer privacy screen Shield adds an extra layer of AR Ultra HD light transmission compared to others. It maintains the high definition of the screen without sacrificing too much screen brightness. It won't reduce the brightness and cause eye fatigue because of the privacy screen installed on the screen.
  • 【ANTI SCRATCH & WASHABLE 】Our privacy anti-glare Monitor film has a surface enhancement layer to protect the privacy filter from scratches and fingerprints. It is washable and reusable. Even after prolonged use, you will get a brand new privacy screen for your desktop computer monitor after cleaning. Very Durable!

Do not confuse protection with desktopCapturer

Electron’s desktopCapturer API obtains desktop audio and video sources for capture. It is intended to help an application capture media; it is not the API that prevents other applications from capturing your window. Use setContentProtection for the window policy, and treat any in-app recording feature as a separate design.

Limitations you should state in product documentation

  • It is not DRM. The setting does not encrypt pixels, prevent a camera pointed at the screen, or stop a user from copying information manually.
  • macOS has a documented exception. Newer capture applications using ScreenCaptureKit may capture a protected window.
  • Linux coverage is not established. Electron’s documented method is annotated for macOS and Windows; do not infer equivalent Linux behavior.
  • OS updates can change capture behavior. Validate the Electron and operating-system versions your support policy names.
  • Protection is per window. A protected main window does not automatically protect another BrowserWindow.

For especially sensitive workflows, combine capture exclusion with short-lived sessions, least-privilege authorization, server-side access checks, redaction, and an audit trail. Electron’s security guidance also recommends leaving webSecurity enabled in production and avoiding remote code with Node.js integration enabled.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Test the behavior you actually promise

  1. Record the Electron version, operating-system edition, and OS build used for the test.
  2. Open the protected window and confirm win.isContentProtected() returns true.
  3. On Windows 10 version 2004 or later, test a supported screen-capture application and verify that the window is excluded.
  4. On an older Windows system, verify whether the captured region is black rather than visible.
  5. On macOS, test the capture applications your customers use, including any that rely on ScreenCaptureKit.
  6. If Linux is supported by your product, document the behavior you observe separately; do not attribute an unverified result to Electron’s API.

Describe the result as “capture exclusion where supported” or “protected against supported OS capture paths,” not “screenshots are impossible.”

Troubleshooting

The window still appears in a recording on macOS

Check whether the recorder uses ScreenCaptureKit. Electron documents that newer Mac applications using this framework can capture a window despite setContentProtection(true). There is no code-side assertion that overrides that operating-system behavior; communicate the limitation and add application-level redaction for the most sensitive fields.

The Windows capture is black instead of missing

That is the expected older-Windows behavior described by Electron. On Windows 10 version 2004 and later, the window should be removed from capture; on older versions, the capture can show black content.

Rank #4
Computer Privacy Screen Filter for 24 Inch 16:9 Aspect Ratio Monitor
  • Privacy Screen Filter Size: If the visible area of your display has the following dimension: Width x Height (Exclude Frame/Arrow 1 to 3 mm errors): 20 15/16" x 11 13/16" (532 mm x 299 mm), then this filter is good for you. Very Important to double check your screen's Width and Height excluding frame before ordering. It's not recommended to make your selection based solely on your screen's diagonal size
  • Left and Right Privacy: Not block visibility directly behind you, regardless of distance. The privacy filter makes the screen appear dark when looking at it from an angle (left and right 30 to 180 degree), but clear when looking directly at it. To change the privacy levels, simply adjust your monitor's brightness level accordingly
  • Matte and Glossy Sides: It's a reversible privacy screen filter, giving you the flexibility to choose glossy or matte finish. The matte side will have less glare, however the glossy side will have stronger privacy
  • Perfect for Open Workspaces: Ensure your working space is bright and well lit. Privacy screens do not work in dimly lit areas
  • Two Installation Option: Option 1 uses clear double side adhesive strips that securely attach to any computer screen. Option 2 (for computer screens with a raised bezel only) uses slide mount tabs that easily stick to the display frame, allowing you to take out the privacy screen filter easily as needed

Protection works for one window but not a dialog

Find the code path that creates the dialog’s BrowserWindow and call setContentProtection(true) on that instance as well. The setting does not cascade between windows.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

isContentProtected() returns false

Confirm that the call runs in the main process, that it executes after the window is constructed, and that no later code calls setContentProtection(false). Log the result immediately after setting it and check that you are querying the same window object.

A renderer call throws or has no effect

BrowserWindow methods are main-process APIs. Route a narrowly defined request through a preload bridge and validate the argument in an ipcMain handler, as shown above.

Linux users ask why capture is not blocked

Explain that the cited Electron API documentation covers macOS and Windows and does not establish an equivalent supported Linux method. Do not ship a platform promise that your implementation cannot verify.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and maintenance

Electron’s documentation does not provide a numeric performance overhead or a universal effectiveness percentage for this setting. The call changes the native window’s capture policy; it is not a pixel-by-pixel filter. Measure startup and rendering behavior in your own supported Electron and OS matrix, and retest after upgrading Electron or the operating system.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
[2-Pack] 24 Inch Computer Privacy Screen Filter for 16:9 Widescreen Monitor
  • 【Improved Privacy Filter】Protescreen 24 inch privacy screen filter after 200 times updates,Use revolutionary micro-louver technology. The 24 inch computer privacy filter limits viewing angle to +/- 28° and provide clear vision on the front. If see from the sides, the greater the angle the darker the screen.Anyone who tries to peek over the side will only see a dark screen! So with a computer privacy screen protector 24 inch, the privacy of your computer screen will never be leaked.
  • 【Package Content】You can get 2pcs 24 inch computer monitor privacy screen filter for a better price! Each package includes 24 inch privacy screen film x2, adhesive strips x2, slide mount tabs x2, alcohol x2, cleaning cloth x2. We are a factory that integrates production, processing and sales, We guarantee that all of our products are premium privacy screen protector. If anything happens, we will send you a new 24 inch monitor privacy screen at absolutely no cost. So you can buy with confidence!
  • 【Eyes Protection & Anti scratch】Computer screen privacy shield 24 inch monitor use filtering optical materials imported from Japan can reduce 92% of blue light and 98% of UV light, and filter all harmful light emitted from the screen.The high-transparent and reinforced built-in protective layer not only presents high-definition picture quality, but also protects your screen from scratches.Hurry up and place an order, Own privacy screen for computer monitor 24 inch, Protect your screen and eyes.
  • 【Brilliant Anti-glare & Function Options】Our privacy screen protector for computer 24 inch monitor protects your eyes by blocking 95% of reflected light. Create a clear and transparent visual space and reduce eye damage by glare. And It is a reversible privacy screen filter. A matte surface effectively prevents blue light and glare, while a glossy is more privacy-resistant. You can choose flexibly according to your needs. In addition to this it also protects your screen from dust and scratches.
  • 【Easy to Install & Reusable】Our 24 inch privacy screen for monitor has 2 uniquely designed installation methods: ① Permanent installation- double sided adhesive tape. Suitable for all computers with a screen aspect ratio of 16:9 and a size of 24 inches. ② Removable installation- slide mount tab. Suitable for computer with raised frame, you can slide the filter in and out of the screen as needed, it provide a quick and easy way to remove your monitor privacy filter when you don't need.

Keep a small compatibility note in your release documentation with the Electron version, Windows minimum build, macOS capture caveat, and Linux status. If protection is a compliance requirement, make the app fail closed by withholding sensitive data when the required platform cannot provide the policy, rather than assuming the API succeeded everywhere.

Or skip the browser setup

If your goal is to create clean screenshots of websites for documentation, tests, or previews—not to protect an Electron window—ScreenshotNeo provides a website screenshot API and MCP server. It accepts the consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.

One request is enough:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the complete parameter list and response details in the ScreenshotNeo documentation.

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://stripe.com'
})
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`)
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`)
const buffer = Buffer.from(await res.arrayBuffer())
require('fs').writeFileSync('shot.webp', buffer)

ScreenshotNeo also supports full-page captures with lazy images loaded, CSS-selector element captures, dark mode, 12 device presets plus custom viewports, retina scale, PDF output with paper and margin controls, custom CSS and JavaScript, click-before-capture actions, hidden selectors, selector/delay/network-idle waits, request and resource blocking, custom headers, cookies, user agents and Authorization, timezone and geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameters used by other screenshot APIs also work, easing migrations.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. Plans include 1,000 shots per month free with no card, Starter at $5 for 3,000, Growth at $15 for 15,000, Pro at $39 for 60,000, Scale at $99 for 250,000, and Business at $249 for 1,000,000; yearly billing gives two months free, and every feature is available on every plan. Create a free ScreenshotNeo account to start with 1,000 screenshots a month and no card.

Frequently Asked Questions

Can I tell which application captured a protected Electron window?

No universal detector is provided by this API. You can query Electron’s configured state with isContentProtected(), but that does not identify a recorder or prove that every capture path honored the policy.

Does setContentProtection protect data copied to the clipboard?

No. It controls window capture behavior, not clipboard permissions, downloads, screen photography, or data already sent to another process. Protect those channels separately.

Should I use this as the only control for regulated information?

No. Treat it as one platform capability and combine it with authorization, redaction, secure session handling, and a documented fallback when the target operating system cannot provide the required capture policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.