1. Don't.
2. If the user blocks your advertisements, then the user doesn't want them. You should respect the user's desires.
3. If the user blocks your scripts, then the user doesn't want them. You should respect the user's desires.
4. If your site breaks because of things, then your site sucks. You should build your site to fail gracefully.
It's their site, they pay for the resources, provide the work, if they want to block people who block their ads, they have that right.
You are not entitled to my website because I put it up.
> You are not entitled to my website because I put it up.
Yup, I absolutely agree. But if you want people to pay for your site, then you must force users to log in to use your content.
If you put your site up without a login portal then your site is free. Advertisements sent to anonymous users are not a valid option: they are easily gamed, easily abused, and easily contain malicious content. If you want to serve advertisements, that's your business, but do it to users who have clearly opted into it.
If users don't want that then they won't sign up to your site. It's a win-win on both sides.
Do you know a reliable way to do it?
Of course, this doesn't detect element hiding.
To do so, you'd need to setup a bunch of mutation observers https://developer.mozilla.org/en-US/docs/Web/API/MutationObs... , and detect that your ad's container or div/image was removed. It's a bit annoying, but doable.
Lastly, you could try to detect the adblocking scripts as well.
If you are trying to subvert people's ad block, you are doing it wrong.
Do you know a way to do it?
If you're just looking for statistics, why not go for a survey? It'd be more reliable than trying to detect something designed to avoid detection.