adsbygoogle adds height: auto important to all its ancestors

adsbygoogle adds height: auto important to all its ancestors

Today, I have just found that the adsbygoogle library add all of the ads element ancestors height: auto !important style.

c && (e.setProperty("height", "auto", "important")
excerpt of show_ads_impl.js

This library iterates all ancestors of the ads element and set their style to style="height: auto !important;".

If this styling affects other elements and removing it does not affect the appearance of the ads, you can remove it after the ads initialization.

;(window.adsbygoogle || []).push({})
window.document.getElementById('root')?.removeAttribute('style')
Buy Me A Coffee