Comment by KPGv2
Anki has AnkiConnect which is exactly this, I think
https://ankiweb.net/shared/info/2055492159
IIRC Yomichan (been a long time since I needed tools like that) is a Chrome extension that lets you mouseover words and it'll show you the meaning. I think you can invoke something in Chrome that will trigger the Anki Connect API and send the info to Anki to create a card.
I've never bothered with this, but I think that's what you're looking for.