Pin potential sensitive clipboard content to local machine

This commit is contained in:
Michael Starke
2018-09-20 18:03:36 +02:00
parent 9f35450683
commit 2c60ba42f5

View File

@@ -105,7 +105,12 @@ NSString *const MPPasteBoardControllerDidClearClipboard = @"com.hicknhack.macpas
}
- (void)copyObjectsWithoutTimeout:(NSArray<id<NSPasteboardWriting>> *)objects {
[NSPasteboard.generalPasteboard clearContents];
if(@available(macOS 10.12, *)) {
[NSPasteboard.generalPasteboard prepareForNewContentsWithOptions:NSPasteboardContentsCurrentHostOnly];
}
else {
[NSPasteboard.generalPasteboard clearContents];
}
[NSPasteboard.generalPasteboard writeObjects:objects];
self.isEmpty = NO;
}