begin work on big rewrite

This commit is contained in:
The Ghost of FOSS' Past 2024-11-21 13:55:06 -06:00
parent d16aa9b3f3
commit 5dada52da5

View file

@ -13,9 +13,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 +25,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
@ -43,6 +39,7 @@ function isLocal(url) {
function createWindow () { function createWindow () {
const extensions = new ElectronChromeExtensions()
const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({
width: 1100, width: 1100,
height: 600, height: 600,
@ -58,7 +55,7 @@ function createWindow () {
} }
}) })
mainWindow.removeMenu() extensions.addTab(browserWindow.webContents, browserWindow)
mainWindow.setMinimumSize(1000, 300) mainWindow.setMinimumSize(1000, 300)