diff --git a/src/web_accessible_resources/googlesyndication_adsbygoogle.js b/src/web_accessible_resources/googlesyndication_adsbygoogle.js index 5a6fc82bc..387a821e3 100644 --- a/src/web_accessible_resources/googlesyndication_adsbygoogle.js +++ b/src/web_accessible_resources/googlesyndication_adsbygoogle.js @@ -36,14 +36,14 @@ const phs = document.querySelectorAll('.adsbygoogle'); const css = 'height:1px!important;max-height:1px!important;max-width:1px!important;width:1px!important;'; for ( let i = 0; i < phs.length; i++ ) { - const fr = document.createElement('iframe'); const id = `aswift_${(i+1)}`; if ( document.querySelector(`iframe#${id}`) !== null ) { continue; } + const fr = document.createElement('iframe'); fr.id = id; fr.style = css; const cfr = document.createElement('iframe'); cfr.id = `google_ads_frame${i}`; fr.appendChild(cfr); - document.body.appendChild(fr); + phs[i].appendChild(fr); } })();