sneedium/adblock.ts
2023-03-02 18:20:58 -06:00

6 lines
No EOL
318 B
TypeScript

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);