Skip to content

macOS 15+: ScreenCaptureKit ignores setContentProtection / NSWindow.sharingType #14200

@columbusux

Description

@columbusux

Background

On macOS 15.x and later, Apple introduced changes to the window compositing and screen capture system. As a result, traditional methods for preventing window capture (including win.setContentProtection(true) in Electron or setting NSWindow.sharingType = .none in native apps) no longer work against the new ScreenCaptureKit framework.

Technical Details

  • Window Compositing in macOS 15+
    All NSWindow contents are fully composited into a single framebuffer before being sent to the display.
    ScreenCaptureKit captures this framebuffer, meaning any visible window content is recorded regardless of flags or levels.

  • NSWindow.sharingType
    On macOS ≤14, setting sharingType = .none could block capture.
    On macOS 15+, Apple confirms via developer forums that this flag is ignored by ScreenCaptureKit.

  • Legacy techniques
    Hacks like CGShieldingWindowLevel or overlay windows are ineffective since the compositor merges all visible content.

  • Implication for Tauri
    Even if Tauri sets NSWindow.sharingType = .none or similar protection flags, the window is still captured by ScreenCaptureKit on macOS 15+.
    This matches behavior reported in Electron:

    🔗 Electron Issue #48258 – ScreenCaptureKit and setContentProtection

[Related tauri issue]
(#10213)

Summary

  • On macOS 15+, ScreenCaptureKit captures all visible content.
  • setContentProtection / sharingType = .none only block legacy CoreGraphics APIs, not ScreenCaptureKit.
  • This is a deliberate change by Apple and currently has no known workaround.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: macOSstatus: upstreamThis issue is blocked by upstream dependencies and we need to wait or contribute upstream fixestype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions