How to use the @cliqz/adblocker-electron.ElectronBlocker.parse function in @cliqz/adblocker-electron

To help you get started, we’ve selected a few @cliqz/adblocker-electron examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Jelmerro / Vieb / app / index.js View on Github external
const createAdblocker = sessionList => {
    const blocklistsFolder = path.join(app.getPath("appData"), "blocklists")
    // Read all filter files from the blocklists folder (including user added)
    let filters = ""
    try {
        for (const file of fs.readdirSync(blocklistsFolder)) {
            if (file.endsWith(".txt")) {
                filters += loadBlocklist(file)
            }
        }
    } catch (e) {
        console.log("Failed to read the files from blocklists folder", e)
    }
    blocker = ElectronBlocker.parse(filters)
    enableAdblocker(sessionList)
}
ipcMain.on("adblock-enable", (_, sessionList) => {

@cliqz/adblocker-electron

Cliqz adblocker Electron wrapper

MPL-2.0
Latest version published 8 days ago

Package Health Score

79 / 100
Full package analysis

Similar packages