fix: use ghostry adblocker

This commit is contained in:
JellyBrick
2024-12-19 19:53:43 +09:00
parent a837987e70
commit be04d66aa8
5 changed files with 61 additions and 103 deletions

View File

@ -2,7 +2,7 @@
import path from 'node:path';
import fs, { promises } from 'node:fs';
import { ElectronBlocker } from '@cliqz/adblocker-electron';
import { ElectronBlocker } from '@ghostery/adblocker-electron';
import { app, net } from 'electron';
const SOURCES = [
@ -55,6 +55,7 @@ export const loadAdBlockerEngine = async (
(url: string) => net.fetch(url),
lists,
{
enableCompression: true,
// When generating the engine for caching, do not load network filters
// So that enhancing the session works as expected
// Allowing to define multiple webRequest listeners
@ -66,7 +67,7 @@ export const loadAdBlockerEngine = async (
blocker.enableBlockingInSession(session);
}
} catch (error) {
console.log('Error loading adBlocker engine', error);
console.error('Error loading adBlocker engine', error);
}
};