You don’t need permission for essentials. If your side requires a JavaScript to open a window it is fine, same as css, login scripts,etc etc. Even some cookies are fine.
But there already have been rulings by EU courts in the that a script to detect adblockers is not essential. Also GDPR and the cookie regs forbid negative consequences for refusal.