www-googlesyndication-com_adsbygoogle.js 926 B

12345678910111213141516171819202122232425262728293031
  1. (function () {
  2. 'use strict';
  3. const init = () => {
  4. window.adsbygoogle = {
  5. loaded: true,
  6. push: function () {
  7. }
  8. };
  9. const phs = document.querySelectorAll('.adsbygoogle');
  10. const css = 'height:1px!important;max-height:1px!important;max-width:1px!important;width:1px!important;';
  11. for (let i = 0; i < phs.length; i++) {
  12. const id = `aswift_${i}`;
  13. if (document.querySelector(`iframe#${id}`) !== null) { continue; }
  14. const fr = document.createElement('iframe');
  15. fr.id = id;
  16. fr.style = css;
  17. const cfr = document.createElement('iframe');
  18. cfr.id = `google_ads_frame${i}`;
  19. fr.appendChild(cfr);
  20. phs[i].appendChild(fr);
  21. }
  22. };
  23. if (
  24. document.querySelectorAll('.adsbygoogle').length === 0 &&
  25. document.readyState === 'loading'
  26. ) {
  27. window.addEventListener('DOMContentLoaded', init, { once: true });
  28. } else {
  29. init();
  30. }
  31. })();