Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const downloadFilters = async () => {
// Load lists to perform ads and tracking blocking:
//
// - https://easylist.to/easylist/easylist.txt
// - https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&showintro=1&mimetype=plaintext
// - https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/resource-abuse.txt
// - https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badware.txt
// - https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt
// - https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/unbreak.txt
//
// - https://easylist.to/easylist/easyprivacy.txt
// - https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/privacy.txt
engine = await ElectronBlocker.fromPrebuiltAdsAndTracking(fetch);
try {
await fs.writeFile(path, engine.serialize());
} catch (err) {
if (err) return console.error(err);
}
};
const downloadFilters = async () => {
// Load lists to perform ads and tracking blocking:
//
// - https://easylist.to/easylist/easylist.txt
// - https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&showintro=1&mimetype=plaintext
// - https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/resource-abuse.txt
// - https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badware.txt
// - https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt
// - https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/unbreak.txt
//
// - https://easylist.to/easylist/easyprivacy.txt
// - https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/privacy.txt
engine = await ElectronBlocker.fromPrebuiltAdsAndTracking(fetch);
try {
await fs.writeFile(path, engine.serialize());
} catch (err) {
if (err) return console.error(err);
}
};
const {width, height} = electron.screen.getPrimaryDisplay().size
youtubeWindow = new BrowserWindow({
height: height * 0.50,
width: width * 0.5,
frame: false,
transparent: false,
icon: path.join(__dirname, 'app/build/icon.png'),
alwaysOnTop: false,
show: false
})
youtubeWindow.loadURL('file://' + __dirname + '/app/index.html')
ElectronBlocker.fromPrebuiltAdsAndTracking(fetch).then((blocker) => {
blocker.enableBlockingInSession(session.defaultSession)
})
youtubeWindow.once('ready-to-show', () => {
ipcMain.on('can-show', (event, arg) => {
youtubeWindow.show()
})
})
})