How to catch mouse button events globally?

I’d like to use the side-buttons of the mouse to navigate back and forward in the selection history. Just like you can do in any modern browser.

Is there some way to catch those side buttons (or any button) on a global Unity Editor level?

That doesn’t work globally.