@s_katala

КАк переписать методом react?

Есть скрипт который обнаруживает блокировщика рекламы, как переписать его методом реакт?
<script>
  $(function(){
  setTimeout(function() {
  var abcount = 0;
  var adblockActive = $.cookie('adblockActive');
  if (typeof $.ab == 'undefined' || $.ab === undefined) { $.ab = true; }
  if ($.ab == true) { abcount = abcount + 1; console.log("method 1"); }
  if( !$(".adblockDetect").is(":visible") ){ abcount = abcount + 1; console.log("method 2"); }
  if( window.gabchecker == "bingo" ){ abcount = abcount + 1; console.log("method 3"); }
  if( abcount == 3 ){
  if (adblockActive == undefined) {
  $.cookie('adblockActive', 1, { expires: 1, path: '/' });
  } else {
  $.cookie('adblockActive', parseInt(adblockActive) + 1, { expires: 1, path: '/' });
  }
  if (adblockActive > 1) {
  $("html").addClass("m-blurry");
  $(".b-feed-adblock").removeAttr("style");
  ga('send', 'event', 'adblock-blur', 'hit', 'adblock-warning');
  }
  console.log("adblock enabled");
  } else {
  if ($.cookie('adblockActive') != undefined) {
  $.removeCookie('adblockActive', { path: '/' });
  ga('send', 'event', 'adblock-blur', 'hit', 'adblock-turn-off');
  }
  console.log("adblock disabled");
  }
  console.log("abcount: " + abcount)
  }, 500);
  $("body").on("click", ".b-feed-adblock__buy", function(){
  ga('send', 'event', 'adblock-blur', 'click', 'button-buy');
  });
  $("body").on("click", ".b-feed-adblock__help", function(){
  ga('send', 'event', 'adblock-blur', 'click', 'button-help');
  });
  });
</script>
  • Вопрос задан
  • 64 просмотра
Пригласить эксперта
Ответы на вопрос 1
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
19 мар. 2024, в 11:29
1200 руб./за проект
19 мар. 2024, в 11:28
50000 руб./за проект
19 мар. 2024, в 11:26
50000 руб./за проект