ublock origin (not to be confused with the lite version) can also do this, and is more flexible. But it's easy to miss this functionality because you have to know about and read some documentation to learn how to turn ublock's "medium" mode on and how the controls work.
It is javascript that allows corporate interests to pop up and nag screen you, and otherwise control your web browsing experience to their favor.
I have an app in my browser that allows me to toggle off javascript and vanquish most pop ups and nag screens.