Windows is absolutely guilty of this, and it is trivial to reproduce.

Reproduction steps:

- Start a reply to this comment in your browser, type some example words.

- Create a BAT file with the following contents:

         @echo off
         timeout /t 15 /nobreak >nul       
         start notepad.exe         

  - Run the BAT file.   

  - Immediately switch back to the browser tab, and place your focus into the HN reply box. Type a word. 

  - Wait for notepad to open   

  - Continue typing. Your typing will go into Notepad and not the browser tab you had focused last.   
This occurs commonly and continuously on Windows, it is damn obnoxious. The OS should never ever change focus, it should however flash the window/taskbar, that is acceptable, but not shift my typing into whatever arbitrary program opened. This used to be fixable via "ForegroundLockTimeout" which is what classic TweakUI altered, but was killed in Vista.

If you're a Visual Studio user, it is a daily annoyance. You hit Start/Play, go about your work, and then suddenly some time later focus shifts out from under you.

I'm running Windows (25H2, 26200.7462). I used the batch file you pasted and tried your repro steps, multiple times (I started writing this comment, in fact). It didn't steal focus. (Edit: See below). I'm quite sure that I haven't had a steal-focus issue at the OS level for many years, and I use Windows all day, every day. I'm also a Visual Studio user.

Edit: I tried it with Firefox and got a repro there. No stealing with Edge.