aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview
diff options
context:
space:
mode:
authorLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-05-12 01:26:51 +0530
committerLibravatar GitHub <noreply@github.com>2021-05-11 21:56:51 +0200
commit80d7ef19dbb4271416bd8b5bbf938e180c57e5f3 (patch)
treeec99db3b3b0727d7ac81c1ead70e17db0c1bb6b3 /src/webview
parentFixing issue with icons being garbled due to misconfiguration of gulp (diff)
downloadferdium-app-80d7ef19dbb4271416bd8b5bbf938e180c57e5f3.tar.gz
ferdium-app-80d7ef19dbb4271416bd8b5bbf938e180c57e5f3.tar.zst
ferdium-app-80d7ef19dbb4271416bd8b5bbf938e180c57e5f3.zip
Method reuse (#1379)
* Used already exported common functions to avoid the same logic being repeated. * Use a different package to retrieve the os-name for the 'About Dialog'.
Diffstat (limited to 'src/webview')
-rw-r--r--src/webview/contextMenuBuilder.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/webview/contextMenuBuilder.js b/src/webview/contextMenuBuilder.js
index 7980e5344..f7d552ddd 100644
--- a/src/webview/contextMenuBuilder.js
+++ b/src/webview/contextMenuBuilder.js
@@ -6,6 +6,8 @@
6 * 6 *
7 * Source: https://github.com/electron-userland/electron-spellchecker/blob/master/src/context-menu-builder.js 7 * Source: https://github.com/electron-userland/electron-spellchecker/blob/master/src/context-menu-builder.js
8 */ 8 */
9import { isMac } from '../environment';
10
9const { 11const {
10 clipboard, nativeImage, remote, shell, 12 clipboard, nativeImage, remote, shell,
11} = require('electron'); 13} = require('electron');
@@ -261,7 +263,7 @@ module.exports = class ContextMenuBuilder {
261 return menu; 263 return menu;
262 } 264 }
263 265
264 if (process.platform === 'darwin') { 266 if (isMac) {
265 const webContents = this.getWebContents(); 267 const webContents = this.getWebContents();
266 268
267 const lookUpDefinition = new MenuItem({ 269 const lookUpDefinition = new MenuItem({