From fbdeb5dc7bedad294ba7444d745d0103997b9037 Mon Sep 17 00:00:00 2001 From: Sneed Group Holder Date: Thu, 21 Nov 2024 14:08:59 -0600 Subject: [PATCH] no one's sure what devops really means --- main.js | 7 ++++--- package-lock.json | 30 ++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index ac98f67..fee658e 100644 --- a/main.js +++ b/main.js @@ -3,10 +3,9 @@ const {app, BrowserWindow, session, ipcMain} = require('electron') const path = require('path') const fetch = require("cross-fetch") const { ElectronChromeExtensions } = require('electron-chrome-extensions') -const { ElectronBlocker } = require('@cliqz/adblocker-electron'); +const { ElectronBlocker } = require('@ghostery/adblocker-electron'); const http = require('http'); const { createProxy } = require('proxy'); -const extensions = new ElectronChromeExtensions() ipcMain.on('windowmaker', (event, arg) => { createWindow(); @@ -16,6 +15,7 @@ const proxy = createProxy(http.createServer()); proxy.listen(3129) //Function to enable AD Blocking... let blocker = undefined +let extensions = undefined async function enableGoodies(s) { blocker = await ElectronBlocker.fromLists(fetch, [ 'https://easylist.to/easylist/easylist.txt', @@ -178,7 +178,7 @@ app.whenReady().then(() => { // for applications and their menu bar to stay active until the user quits // explicitly with Cmd + Q. app.on('window-all-closed', function () { - if (process.platform !== 'darwin') app.quit() + if (process.platform !== 'darwin') { app.quit() } }) // In this file you can include the rest of your app's specific main process @@ -186,6 +186,7 @@ app.on('window-all-closed', function () { // Set DNS app.on('ready', () => { + extensions = new ElectronChromeExtensions() app.configureHostResolver({ mode: 'secure', dohServers: [ diff --git a/package-lock.json b/package-lock.json index 3ad4669..14031e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "SPL-R5", "dependencies": { "@cliqz/adblocker-electron": "^1.31.3", + "@ghostery/adblocker": "^2.1.1", "cross-fetch": "^3.1.5", "electron-chrome-extensions": "^3.10.0", "electron-squirrel-startup": "^1.0.1", @@ -824,6 +825,35 @@ "dev": true, "license": "MIT" }, + "node_modules/@ghostery/adblocker": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@ghostery/adblocker/-/adblocker-2.1.1.tgz", + "integrity": "sha512-FL4yWrpNTCmtbAfeLotUoo94ZyNqHdZpZRo4Qlk0guPzDGcOtW4/c84UzS9D/Z9Z4H3nWSCrW0q38pjwAbDykA==", + "license": "MPL-2.0", + "dependencies": { + "@ghostery/adblocker-content": "^2.1.1", + "@ghostery/adblocker-extended-selectors": "^2.1.1", + "@remusao/guess-url-type": "^1.3.0", + "@remusao/small": "^1.2.1", + "@remusao/smaz": "^1.9.1", + "tldts-experimental": "^6.0.14" + } + }, + "node_modules/@ghostery/adblocker-content": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@ghostery/adblocker-content/-/adblocker-content-2.1.1.tgz", + "integrity": "sha512-1DKHmPnlQleXapaL36xZOwwZmpdbjMP/IcWdTTzyriyCDIFlSwBDT1DJ3xg0TK61ahZMEwz1MnTGM6X99z/5rQ==", + "license": "MPL-2.0", + "dependencies": { + "@ghostery/adblocker-extended-selectors": "^2.1.1" + } + }, + "node_modules/@ghostery/adblocker-extended-selectors": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@ghostery/adblocker-extended-selectors/-/adblocker-extended-selectors-2.1.1.tgz", + "integrity": "sha512-jEHjU2CarS2MtRYfm/6iTKMS1DVzepuwXSMKg1zTyHl+u4ZKvKNYFK7plD0nUlL5a8akyRkYwLheXnKsW3nChQ==", + "license": "MPL-2.0" + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", diff --git a/package.json b/package.json index 95a881a..27e4b9e 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ }, "dependencies": { "@cliqz/adblocker-electron": "^1.31.3", + "@ghostery/adblocker": "^2.1.1", "cross-fetch": "^3.1.5", "electron-chrome-extensions": "^3.10.0", "electron-squirrel-startup": "^1.0.1",