From 6d6e460e2ae87f6726ae6b0281b313bfd69385b8 Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 4 Jan 2017 22:16:58 +0100 Subject: [PATCH] Disallow arbitrary objects in clipboard.write. (#13595) --- electron/github-electron-renderer-tests.ts | 1 + electron/index.d.ts | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/electron/github-electron-renderer-tests.ts b/electron/github-electron-renderer-tests.ts index 1d1da23069..108e9fa1a8 100644 --- a/electron/github-electron-renderer-tests.ts +++ b/electron/github-electron-renderer-tests.ts @@ -95,6 +95,7 @@ clipboard.clear(); clipboard.write({ html: '', text: 'Hello World!', + bookmark: "Bookmark name", image: clipboard.readImage() }); diff --git a/electron/index.d.ts b/electron/index.d.ts index 7a0a018666..1812c1cc7a 100644 --- a/electron/index.d.ts +++ b/electron/index.d.ts @@ -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. *