Compare commits

...

2 commits

2 changed files with 450 additions and 305 deletions

View file

@ -6,6 +6,7 @@ const { ElectronChromeExtensions } = require('electron-chrome-extensions')
const { ElectronBlocker } = require('@cliqz/adblocker-electron'); const { ElectronBlocker } = require('@cliqz/adblocker-electron');
const http = require('http'); const http = require('http');
const { createProxy } = require('proxy'); const { createProxy } = require('proxy');
const extensions = new ElectronChromeExtensions()
ipcMain.on('windowmaker', (event, arg) => { ipcMain.on('windowmaker', (event, arg) => {
createWindow(); createWindow();
@ -13,9 +14,8 @@ ipcMain.on('windowmaker', (event, arg) => {
const proxy = createProxy(http.createServer()); const proxy = createProxy(http.createServer());
proxy.listen(3129) proxy.listen(3129)
//Function to enable AD Blocking and extensions... //Function to enable AD Blocking...
let blocker = undefined let blocker = undefined
let extensions = undefined
async function enableGoodies(s) { async function enableGoodies(s) {
blocker = await ElectronBlocker.fromLists(fetch, [ blocker = await ElectronBlocker.fromLists(fetch, [
'https://easylist.to/easylist/easylist.txt', 'https://easylist.to/easylist/easylist.txt',
@ -26,9 +26,6 @@ async function enableGoodies(s) {
'https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/pro.plus.txt' 'https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/pro.plus.txt'
]) ])
blocker.enableBlockingInSession(s); blocker.enableBlockingInSession(s);
extensions = new ElectronChromeExtensions({
session: s
})
} }
// 0.0.0.0 day fix // 0.0.0.0 day fix
@ -58,7 +55,7 @@ function createWindow () {
} }
}) })
mainWindow.removeMenu() extensions.addTab(mainWindow.webContents, mainWindow)
mainWindow.setMinimumSize(1000, 300) mainWindow.setMinimumSize(1000, 300)

746
package-lock.json generated

File diff suppressed because it is too large Load diff