Disallow arbitrary objects in clipboard.write. (#13595)

This commit is contained in:
Roman
2017-01-04 22:16:58 +01:00
committed by Andy
parent 844164f7c0
commit 6d6e460e2a
2 changed files with 2 additions and 6 deletions

View File

@@ -95,6 +95,7 @@ clipboard.clear();
clipboard.write({
html: '<html></html>',
text: 'Hello World!',
bookmark: "Bookmark name",
image: clipboard.readImage()
});

7
electron/index.d.ts vendored
View File

@@ -1864,12 +1864,7 @@ declare namespace Electron {
/**
* Writes data to the clipboard.
*/
write(data: {
text?: string;
rtf?: string;
html?: string;
image?: NativeImage;
}, type?: ClipboardType): void;
write(data: { text: string; bookmark?: string; } | { rtf: string; } | { html: string; } | { image: NativeImage; }, type?: ClipboardType): void;
/**
* @returns An Object containing title and url keys representing the bookmark in the clipboard.
*