Preventing Chrome, Firefox and Edge to react to media keys

Are you getting annoyed by the fact that the music and videos are controlled by the media keys of your keyboard or mouse as well? I am often listening to the music streaming service of my choice and want only that to react to the media keys; not some random website embed. And apparently there is a solution that you can find in various places on the Internet.

Careful! This feature is actually labelled “experimental” for the browsers listed. In my experience it is safe to use though.

For Firefox: Open about:config and set media.hardwaremediakeys.enabled to false. This works as of version 81.0.1.

For Chrome/Chromium/Vivaldi (Chromium-based): Open chrome://flags/#global-media-controls and set #hardware-media-key-handling to disabled. Please note that this feature is experimental and some report that it has even been removed in Chrome 85, though it is still there in Vivaldi as of version 85.0.4183.123.

For Edge: Open edge://flags/#global-media-controls and set #global-media-controls to disabled. Then restart Edge. This is for the newish Chromium-based version of Edge (85.0.564.70)., which is why it is so similar to the Chromium-type browsers above.