Ad publishers have been in a war with adblockers for a decade now, were it trivial to detect adblockers, they would have already won. This is the sole reason Google has introduced the idea of DRM for websites.
In fact, the only trivial thing is bypassing anti-adblock. There is no anti-adblock that relies upon Javascript that cannot be bypassed without issue. The way Javascript is executed on the user’s computer, unobfuscated, means it can be altered in whatever way you want before it is ran.
Ad publishers have been in a war with adblockers for a decade now, were it trivial to detect adblockers, they would have already won. This is the sole reason Google has introduced the idea of DRM for websites.
In fact, the only trivial thing is bypassing anti-adblock. There is no anti-adblock that relies upon Javascript that cannot be bypassed without issue. The way Javascript is executed on the user’s computer, unobfuscated, means it can be altered in whatever way you want before it is ran.