I have been looking forward to use Brave as main browser for a Year now and wasn't able to as I wanted to keep using my OS hotkeys for switching workspace Ctrl+[1-9] which Brave takes over when in focus for tab-switching.
Following the Issue brave/browser-laptop#1374 I didn't got the impression that this will be fixable via the config ui soon. So I took a look at the code, to see if there is a simple workaround and turns out there is.
-
Find and backup the
app.asar
in your local Brave installation -
Install the asar tool via npm:
npm install asar
- Unpack the
app.asar
archive in to a directory:
mkdir /tmp/app
asar e /usr/lib/brave/resources/app.asar /tmp/app/
- Edit and delete or comment out the Hotkeys that interfer with your OS Hotkeys in
/tmp/app/app/localShortcuts.js
In my case for Ctrl+[1-9] I did the following:
delete this entire line (line 26):
['CmdOrCtrl+9', messages.SHORTCUT_SET_ACTIVE_FRAME_TO_LAST],
comment out the following block:
...
/*
// Tab ordering shortcuts
Array.from(new Array(8), (x, i) => i).reduce((list, i) => {
list.push([`CmdOrCtrl+${String(i + 1)}`, messages.SHORTCUT_SET_ACTIVE_FRAME_BY_INDEX, i])
return list
}, simpleWebContentEvents)
*/
...
- Put it back together, by packing the directory to its original location within the Brave installation:
asar p /tmp/app /usr/lib/brave/resources/app.asar
- Start Brave again and test. Now I can finally start using Brave ;)
Nice! Thank you.