Content protection
Here Core provides features that can give platform developers enhanced control over the security of content in windows and view. These features help prevent sensitive information from being shared outside of authorized applications. They can be implemented as part of a company's broader strategy for data loss prevention (DLP).
The content protection features comprise the following:
- Screen capture protection
- Secure clipboard operations
- Printing restrictions
- Drag and drop restrictions
Configure domain-based settings
Content protection features are configured through domain-based permissions.
All options are nested under the contentProtection
property in domain settings of an application manifest.
In all cases except paste behavior, the default setting is 'allow'
.
The following example shows the type definition for the options of the contentProtection
property:
type contentProtection = {
screenCapture?: 'allow' | 'block';
print?: 'allow' | 'block';
drag?: 'allow' | 'block';
clipboard?: {
copy?: {
behavior: 'allow' | 'block' | 'protect';
options?: {
replacementText?: string; // Text that is pasted in place of blocked content
}
},
paste?: {
behavior: 'non-protected-content' | 'all-content';
}
},
}
Example configuration
The following sample shows an excerpt of a manifest file, for content protection options.
"domainSettings": {
"rules": [{
"match": ["*://*.here.io/*"],
"options": {
"contentProtection": {
"screenCapture": "block",
"clipboard": {
"copy": {
"behavior": "protect",
"options": {
"replacementText": "This content is protected by organization policy"
}
},
"paste": {
"behavior": "all-content"
}
},
"print": "block",
"drag": "block"
}
}
}]
}
Screen capture protection
The screen capture protection feature prevents windows containing sensitive content from appearing in screenshots or screen sharing applications.
Behavior
-
When
screenCapture
is set toblock
for a domain, any window containing content from that domain is blocked from screen capture. -
The appearance of blocked windows in screenshots and screen sharing depends on the operating system. On Microsoft Windows, they appear black. On macOS, they are invisible.
-
Protection applies at the window level; individual views or iframes cannot be selectively blocked. If the content in a view or iframe is blocked, the entire window containing it is blocked.
-
Protection remains active even if protected content is hidden or out of view.
Get protection status
You can check the current set of screen capture permissions by calling getScreenCapturePermissions()
on the Window or View object.
The structure of the permissions object is shown below.
type ScreenCapturePermission = {
permission: 'allow' | 'block';
permissions: [{
behavior: 'allow' | 'block':
info: { // what entity is determining the behavior?
entityType: 'window' | 'iframe' | 'external connection' | 'view' | 'unknown' ;
name: string;
uuid: string;
};
url: string //URL of the content involved
}]
}
Secure clipboard operations
The secure clipboard feature prevents protected content from being pasted into unauthorized applications.
Copy protection modes
-
allow
: Normal clipboard operation (default) -
block
: Prevents all copy operations -
protect
: Encrypts copied content with a token that can be decrypted only by authorized applications
Protected clipboard content is stored in a secure buffer separate from the system clipboard. When protected content is copied, the system clipboard contains replacement text and a token. When the user attempts to paste protected content, if the destination is allowed to receive it, the content is decrypted and pasted; otherwise, the replacement text is pasted. Tokens are invalidated when new content is copied or when the platform is closed. Iframes inherit clipboard settings from their parent window or view.
Paste protection modes
-
'non-protected-content'
: This content can receive pasted content that is not subject to content protection -
'all-content'
: This content can receive all pasted content, including protected content.
If the content being pasted is protected and 'all-content'
is set, then the content is decrypted and pasted.
If the content being pasted is protected and 'non-protected-content'
is set, then the replacement text is pasted instead of the actual content.