If your computer is compromised whatever token/cookie you will get from the authentication will be also compromised.
Assuming the computer is compromised also open a lot more issues, privilege escalation can be done in a lot of ways depending of what is being installed (even sudo was hit by such issues https://www.cve.org/CVERecord?id=CVE-2021-3156 )
Sorry I had in mind you login in from a computer that was compromised (without your knowledge), I didn’t had in mind a computer compromised without being in use.
EDIT : store your 2FA in the browser from the extension would not be ‘like an idiot’ as it is encrypted.
EDIT 2 : no forget everything, this whole situation is absurd. If your computer is compromised your password are not (do you store in clear text?!). If you use it to login you are owned already.