DEV Community

Discussion on: How to detect AdBlock in plain JavaScript with a few lines of code

Collapse
 
ravavyr profile image
Ravavyr • Edited

computed style is the "final" style applied. You could have 20 css rules targeting the same elements plus javascript modifying it after that too. Computed gives you the final applied styling.

Collapse
 
decker67 profile image
decker • Edited

Yes I understand but if you requests the real node in the DOM itself, means the JavaScript object it should say the same or am I wrong? So no need to use getComputedStyle from window.

I did not want to know what style is applied, I want to no the actual style and that counts.

Thread Thread
 
ravavyr profile image
Ravavyr

i believe that is correct, i was just answering your question :)