From 6c3bc44490ed3f57cc10de4391faa9a873ef5559 Mon Sep 17 00:00:00 2001 From: Oleg Labudko Date: Wed, 22 Jun 2022 12:04:41 +0300 Subject: [PATCH] Pull request: AG-14894 Disable Cmd-R hotkey in UI Merge in EXTENSIONS/safari-app-extension from fix/AG-14894 to master Squashed commit of the following: commit af1efb21753f1d7a774df99c98e96d2c87c0cb4d Merge: 9429e28e 81bf89c3 Author: tvinzz Date: Wed Jun 22 11:33:40 2022 +0300 Merge branch 'master' into fix/AG-14894 commit 9429e28e2c7bf97233b73ebbe97e4806ece78ed8 Author: tvinzz Date: Tue Jun 21 21:24:20 2022 +0300 disable window refreshing by hotkey --- ElectronMainApp/main.js | 9 +++++++++ ElectronMainApp/yarn.lock | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ElectronMainApp/main.js b/ElectronMainApp/main.js index 97435105..3862add1 100644 --- a/ElectronMainApp/main.js +++ b/ElectronMainApp/main.js @@ -5,6 +5,7 @@ const { dialog, nativeTheme, nativeImage, + globalShortcut, } = require('electron'); const safariExt = require('safari-ext'); @@ -411,3 +412,11 @@ if (getChannel() === 'MAS') { log.error(`Uncaught exception: ${error}`); }); } + +// disable refreshing window by hotkey +app.on('browser-window-focus', () => { + globalShortcut.register('CommandOrControl+R', () => {}); +}); +app.on('browser-window-blur', () => { + globalShortcut.unregister('CommandOrControl+R'); +}); diff --git a/ElectronMainApp/yarn.lock b/ElectronMainApp/yarn.lock index d4941122..fce91a70 100644 --- a/ElectronMainApp/yarn.lock +++ b/ElectronMainApp/yarn.lock @@ -7733,7 +7733,7 @@ rsvp@^4.8.4: resolved "git+https://github.com/AdguardTeam/SafariConverterLib.git#1999a07ee77d0274cb66751c511e533811a66c2c" safari-ext@./safari-ext: - version "1.0.37" + version "1.0.38" dependencies: bindings "^1.2.1" nan "^2.3.3"