Migrate from adblock-rs to cliqz

This commit is contained in:
TC
2020-04-12 13:23:35 +02:00
parent 6fb251f00f
commit 422c3fc28d
8 changed files with 136 additions and 418 deletions

View File

@ -1,3 +1,12 @@
const { blockWindowAds } = require("./blocker");
const { ElectronBlocker } = require("@cliqz/adblocker-electron");
const { session } = require("electron");
const fetch = require("node-fetch");
module.exports = win => blockWindowAds(win.webContents);
const SOURCES = [
"https://raw.githubusercontent.com/kbinani/adblock-youtube-ads/master/signed.txt"
];
module.exports = () =>
ElectronBlocker.fromLists(fetch, SOURCES)
.then(blocker => blocker.enableBlockingInSession(session.defaultSession))
.catch(err => console.log("Error loading adBlocker", err));