In Firefox there is a permission for "keyboard shortcuts" or something similar. I've set the default value to disabled.
To do so:
- Open about:config
- Find or create permissions.default.shortcuts
- Set the value to 2 (BLOCKED) or 3 (PROMPT, not sure if that even works)
The changes should take effect immediately. If they don't, try restarting your browser.
You can then go into the page information dialogue (ctrl+I) and turn it back on for individual sites that need shortcuts to work well (like Google docs, maybe Discord).
Note that this might also affect shortcuts that do not conflict with your browser's shortcuts.