Skip to content

Commit

Permalink
TW-1459 Add a frontend part of demo for Cyren API
Browse files Browse the repository at this point in the history
  • Loading branch information
keshan3262 committed Jun 25, 2024
1 parent 843c878 commit 9b063df
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/replaceAds.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import axios from 'axios';
import browser from 'webextension-polyfill';

import { configureAds } from 'lib/ads/configure-ads';
Expand Down Expand Up @@ -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);
})
Expand Down

0 comments on commit 9b063df

Please sign in to comment.