aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-15 20:27:45 +0530
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-08-15 15:13:35 +0000
commit59e503fdc61802bd9f9fac2c030c2192bd95c4ce (patch)
treeb19096beb9125baf9a3ed14e3197908a190eb308 /src/webview
parentDowngraded 'sqlite3' back to '5.0.0' since it doesn't compile on macos (in de... (diff)
downloadferdium-app-59e503fdc61802bd9f9fac2c030c2192bd95c4ce.tar.gz
ferdium-app-59e503fdc61802bd9f9fac2c030c2192bd95c4ce.tar.zst
ferdium-app-59e503fdc61802bd9f9fac2c030c2192bd95c4ce.zip
fix: Fix issue with shortcut accelerators not working on macos where symbols were used for shift/alt keys
Diffstat (limited to 'src/webview')
-rw-r--r--src/webview/contextMenuBuilder.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/webview/contextMenuBuilder.js b/src/webview/contextMenuBuilder.js
index 126fa4086..8c39e6d04 100644
--- a/src/webview/contextMenuBuilder.js
+++ b/src/webview/contextMenuBuilder.js
@@ -8,7 +8,7 @@
8 */ 8 */
9import { clipboard, ipcRenderer, nativeImage } from 'electron'; 9import { clipboard, ipcRenderer, nativeImage } from 'electron';
10import { Menu, MenuItem } from '@electron/remote'; 10import { Menu, MenuItem } from '@electron/remote';
11import { shortcutKey, isMac } from '../environment'; 11import { cmdOrCtrlShortcutKey, isMac } from '../environment';
12 12
13import { SEARCH_ENGINE_NAMES, SEARCH_ENGINE_URLS } from '../config'; 13import { SEARCH_ENGINE_NAMES, SEARCH_ENGINE_URLS } from '../config';
14import { openExternalUrl } from '../helpers/url-helpers'; 14import { openExternalUrl } from '../helpers/url-helpers';
@@ -375,7 +375,7 @@ module.exports = class ContextMenuBuilder {
375 const webContents = this.getWebContents(); 375 const webContents = this.getWebContents();
376 menu.append(new MenuItem({ 376 menu.append(new MenuItem({
377 label: this.stringTable.cut(), 377 label: this.stringTable.cut(),
378 accelerator: `${shortcutKey()}+X`, 378 accelerator: `${cmdOrCtrlShortcutKey()}+X`,
379 enabled: menuInfo.editFlags.canCut, 379 enabled: menuInfo.editFlags.canCut,
380 click: () => webContents.cut(), 380 click: () => webContents.cut(),
381 })); 381 }));
@@ -390,7 +390,7 @@ module.exports = class ContextMenuBuilder {
390 const webContents = this.getWebContents(); 390 const webContents = this.getWebContents();
391 menu.append(new MenuItem({ 391 menu.append(new MenuItem({
392 label: this.stringTable.copy(), 392 label: this.stringTable.copy(),
393 accelerator: `${shortcutKey()}+C`, 393 accelerator: `${cmdOrCtrlShortcutKey()}+C`,
394 enabled: menuInfo.editFlags.canCopy, 394 enabled: menuInfo.editFlags.canCopy,
395 click: () => webContents.copy(), 395 click: () => webContents.copy(),
396 })); 396 }));
@@ -405,7 +405,7 @@ module.exports = class ContextMenuBuilder {
405 const webContents = this.getWebContents(); 405 const webContents = this.getWebContents();
406 menu.append(new MenuItem({ 406 menu.append(new MenuItem({
407 label: this.stringTable.paste(), 407 label: this.stringTable.paste(),
408 accelerator: `${shortcutKey()}+V`, 408 accelerator: `${cmdOrCtrlShortcutKey()}+V`,
409 enabled: menuInfo.editFlags.canPaste, 409 enabled: menuInfo.editFlags.canPaste,
410 click: () => webContents.paste(), 410 click: () => webContents.paste(),
411 })); 411 }));
@@ -423,7 +423,7 @@ module.exports = class ContextMenuBuilder {
423 menu.append( 423 menu.append(
424 new MenuItem({ 424 new MenuItem({
425 label: this.stringTable.pasteAndMatchStyle(), 425 label: this.stringTable.pasteAndMatchStyle(),
426 accelerator: `${shortcutKey()}+Shift+V`, 426 accelerator: `${cmdOrCtrlShortcutKey()}+Shift+V`,
427 click: () => webContents.pasteAndMatchStyle(), 427 click: () => webContents.pasteAndMatchStyle(),
428 }), 428 }),
429 ); 429 );
@@ -489,7 +489,7 @@ module.exports = class ContextMenuBuilder {
489 const webContents = this.getWebContents(); 489 const webContents = this.getWebContents();
490 menu.append(new MenuItem({ 490 menu.append(new MenuItem({
491 label: this.stringTable.goBack(), 491 label: this.stringTable.goBack(),
492 accelerator: `${shortcutKey()}+left`, 492 accelerator: `${cmdOrCtrlShortcutKey()}+left`,
493 enabled: webContents.canGoBack(), 493 enabled: webContents.canGoBack(),
494 click: () => webContents.goBack(), 494 click: () => webContents.goBack(),
495 })); 495 }));
@@ -504,7 +504,7 @@ module.exports = class ContextMenuBuilder {
504 const webContents = this.getWebContents(); 504 const webContents = this.getWebContents();
505 menu.append(new MenuItem({ 505 menu.append(new MenuItem({
506 label: this.stringTable.goForward(), 506 label: this.stringTable.goForward(),
507 accelerator: `${shortcutKey()}+right`, 507 accelerator: `${cmdOrCtrlShortcutKey()}+right`,
508 enabled: webContents.canGoForward(), 508 enabled: webContents.canGoForward(),
509 click: () => webContents.goForward(), 509 click: () => webContents.goForward(),
510 })); 510 }));
@@ -535,7 +535,7 @@ module.exports = class ContextMenuBuilder {
535 const baseURL = new URL(menuInfo.pageURL); 535 const baseURL = new URL(menuInfo.pageURL);
536 menu.append(new MenuItem({ 536 menu.append(new MenuItem({
537 label: this.stringTable.goToHomePage(), 537 label: this.stringTable.goToHomePage(),
538 accelerator: `${shortcutKey()}+Home`, 538 accelerator: `${cmdOrCtrlShortcutKey()}+Home`,
539 enabled: true, 539 enabled: true,
540 click: () => { 540 click: () => {
541 // webContents.loadURL(baseURL.origin); 541 // webContents.loadURL(baseURL.origin);