Skip to content

Commit

Permalink
Pull request: AG-14894 Disable Cmd-R hotkey in UI
Browse files Browse the repository at this point in the history
Merge in EXTENSIONS/safari-app-extension from fix/AG-14894 to master

Squashed commit of the following:

commit af1efb2
Merge: 9429e28 81bf89c
Author: tvinzz <o.labudko@adguard.com>
Date:   Wed Jun 22 11:33:40 2022 +0300

    Merge branch 'master' into fix/AG-14894

commit 9429e28
Author: tvinzz <o.labudko@adguard.com>
Date:   Tue Jun 21 21:24:20 2022 +0300

    disable window refreshing by hotkey
  • Loading branch information
Oleg Labudko committed Jun 22, 2022
1 parent 81bf89c commit 6c3bc44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions ElectronMainApp/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const {
dialog,
nativeTheme,
nativeImage,
globalShortcut,
} = require('electron');
const safariExt = require('safari-ext');

Expand Down Expand Up @@ -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');
});
2 changes: 1 addition & 1 deletion ElectronMainApp/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6c3bc44

Please sign in to comment.