sneedium/adblock.ts

6 lines
318 B
TypeScript
Raw Normal View History

2023-03-02 18:20:58 -06:00
const fetchr = require("cross-fetch")
const { ElectronBlocker, fullLists, Requests } = require('@cliqz/adblocker-electron')
let mainWindow: BrowserWindow | null = null;
let blocker = await ElectronBlocker.fromPrebuiltAdsAndTracking(fetchr);
blocker.enableBlockingInSession(mainWindow.webContents.defaultSession);