From b161db064e267194366355eddeb9e02a41dd18c2 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 30 Jun 2019 21:34:19 +0200 Subject: [PATCH] choose only desired context menu items --- electron.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/electron.js b/electron.js index 2fe700529..189e691a4 100644 --- a/electron.js +++ b/electron.js @@ -25,7 +25,11 @@ let mainWindow; require('electron-dl')({ saveAs: true }); contextMenu({ - prepend: (defaultActions, params, browserWindow) => [ + menu: (actions, params, browserWindow) => [ + actions.cut(), + actions.copy(), + actions.copyLink(), + actions.paste(), { label: 'Search DuckDuckGo for “{selection}”', // Only show it when right-clicking text @@ -35,7 +39,8 @@ contextMenu({ shell.openExternal(`https://duckduckgo.com?q=${encodeURIComponent(params.selectionText)}`); } - } + }, + actions.inspect() ] });