1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-03 09:39:38 +02:00

Use ctrl-spacebar instead of spacebar to toggle god mode

Related feedback:
- https://github.com/gorhill/uBlock/commit/aec2f81884c5#commitcomment-39385794
This commit is contained in:
Raymond Hill 2020-05-23 09:26:21 -04:00
parent aec2f81884
commit a018937792
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1112,13 +1112,19 @@ const toggleHostnameSwitch = async function(ev) {
/*******************************************************************************
Space bar: toggle god mode
Ctrl-Space bar: toggle god mode
*/
const keyboardHandler = function(ev) {
if ( ev.keyCode === 0x20 ) {
let consumed = false;
if ( ev.ctrlKey && ev.key === ' ' ) {
document.body.classList.toggle('godMode');
consumed = true;
}
if ( consumed ) {
ev.stopPropagation();
ev.preventDefault();
}
};