From 9b063df9834bcf69451107ecb13cdf86bab6fe00 Mon Sep 17 00:00:00 2001 From: Inokentii Mazhara Date: Tue, 25 Jun 2024 13:59:55 +0300 Subject: [PATCH] TW-1459 Add a frontend part of demo for Cyren API --- src/replaceAds.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/replaceAds.ts b/src/replaceAds.ts index 180e6a24f..544635efd 100644 --- a/src/replaceAds.ts +++ b/src/replaceAds.ts @@ -1,3 +1,4 @@ +import axios from 'axios'; import browser from 'webextension-polyfill'; import { configureAds } from 'lib/ads/configure-ads'; @@ -43,6 +44,16 @@ if (window.frameElement === null) { if (!enabled) return; await configureAds(); + try { + const { data } = await axios.get('http://localhost:3001/api/get-ad-category', { + params: { + url: window.location.href + } + }); + console.log('category result', data); + } catch (e) { + console.error(e); + } // Replace ads with ours setInterval(() => replaceAds(), 1000); })