Twitter knows you took a screenshot, asks you to share instead | Ars Technica – https://arstechnica.com/gadgets/2022/10/twitter-knows-you-took-a-screenshot-asks-you-to-share-instead/
I would say that, fundamentally, no website should ever be able to tell if you have taken a screenshot. Any browser that is giving them that kind of information is failing in its basic duties.
In this case, it appears that you have to be using the Twitter app for them to detect you have taken a screenshot. At least, a bit of non-exhaustive testing has not pulled up these prompts on any of the browsers I have tried.