Improve neutered `adsbygoogle` scriptlet

This commit is contained in:
Raymond Hill 2021-01-21 10:13:16 -05:00
parent e9863f7787
commit 0934779f4b
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}
})();