diff options
author | Vijay A <avijayr@protonmail.com> | 2021-07-17 12:34:51 +0530 |
---|---|---|
committer | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-07-17 07:08:14 +0000 |
commit | 6804f13a8246eb47f09d9887a9d172ed15eda611 (patch) | |
tree | 3c67943a0b3cf1209acf9ee1da74e8f6c2be8c48 /src/webview/contextMenuBuilder.js | |
parent | 5.6.0-nightly.88 (diff) | |
download | ferdium-app-6804f13a8246eb47f09d9887a9d172ed15eda611.tar.gz ferdium-app-6804f13a8246eb47f09d9887a9d172ed15eda611.tar.zst ferdium-app-6804f13a8246eb47f09d9887a9d172ed15eda611.zip |
Fixed issue where the 'copy page url' didn't honor silent notifications for clipboard events.
Diffstat (limited to 'src/webview/contextMenuBuilder.js')
-rw-r--r-- | src/webview/contextMenuBuilder.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/webview/contextMenuBuilder.js b/src/webview/contextMenuBuilder.js index 500a1a653..63eed2ebe 100644 --- a/src/webview/contextMenuBuilder.js +++ b/src/webview/contextMenuBuilder.js | |||
@@ -22,6 +22,7 @@ function matchesWord(string) { | |||
22 | return string.match(regex); | 22 | return string.match(regex); |
23 | } | 23 | } |
24 | 24 | ||
25 | // TODO: Need to externalize for i18n | ||
25 | const contextMenuStringTable = { | 26 | const contextMenuStringTable = { |
26 | lookUpDefinition: ({ word }) => `Look Up "${word}"`, | 27 | lookUpDefinition: ({ word }) => `Look Up "${word}"`, |
27 | cut: () => 'Cut', | 28 | cut: () => 'Cut', |
@@ -217,7 +218,7 @@ module.exports = class ContextMenuBuilder { | |||
217 | this.addSeparator(menu); | 218 | this.addSeparator(menu); |
218 | this.goBack(menu); | 219 | this.goBack(menu); |
219 | this.goForward(menu); | 220 | this.goForward(menu); |
220 | this.copyPageUrl(menu); | 221 | this.copyPageUrl(menu, menuInfo); |
221 | this.goToHomePage(menu, menuInfo); | 222 | this.goToHomePage(menu, menuInfo); |
222 | this.openInBrowser(menu, menuInfo); | 223 | this.openInBrowser(menu, menuInfo); |
223 | 224 | ||
@@ -514,13 +515,13 @@ module.exports = class ContextMenuBuilder { | |||
514 | /** | 515 | /** |
515 | * Adds the 'copy page url' menu item. | 516 | * Adds the 'copy page url' menu item. |
516 | */ | 517 | */ |
517 | copyPageUrl(menu) { | 518 | copyPageUrl(menu, menuInfo) { |
518 | menu.append(new MenuItem({ | 519 | menu.append(new MenuItem({ |
519 | label: this.stringTable.copyPageUrl(), | 520 | label: this.stringTable.copyPageUrl(), |
520 | enabled: true, | 521 | enabled: true, |
521 | click: () => { | 522 | click: () => { |
522 | clipboard.writeText(window.location.href); | 523 | clipboard.writeText(window.location.href); |
523 | this._sendNotificationOnClipboardEvent(menu.clipboardNotifications, () => `Page URL copied: ${window.location.href}`); | 524 | this._sendNotificationOnClipboardEvent(menuInfo.clipboardNotifications, () => `Page URL copied: ${window.location.href}`); |
524 | }, | 525 | }, |
525 | })); | 526 | })); |
526 | 527 | ||