Skip to content

Commit

Permalink
Migrate from adblock-rs to cliqz
Browse files Browse the repository at this point in the history
  • Loading branch information
th-ch committed Apr 12, 2020
1 parent 6fb251f commit 422c3fc
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 418 deletions.
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
"build": "yarn run clean && build --win --mac --linux",
"build:mac": "yarn run clean && build --mac",
"build:win": "yarn run clean && build --win",
"plugins": "yarn run plugin:autoconfirm && yarn run plugin:adblock",
"plugin:adblock": "node plugins/adblocker/downloader.js && electron-build-env neon build adblock-rs",
"plugins": "yarn run plugin:autoconfirm",
"plugin:autoconfirm": "yarn run generate:package YoutubeNonStop",
"release:linux": "yarn run clean && build --linux -p always",
"release:mac": "yarn run clean && build --mac -p always",
Expand All @@ -46,22 +45,21 @@
"npm": "Please use yarn and not npm"
},
"dependencies": {
"@cliqz/adblocker-electron": "^1.14.1",
"YoutubeNonStop": "git:/lawfx/YoutubeNonStop.git#v0.7.1",
"adblock-rs": "^0.2.7",
"electron-debug": "^2.2.0",
"electron-is": "^3.0.0",
"electron-localshortcut": "^3.2.1",
"electron-store": "^3.1.0",
"electron-updater": "^4.2.2"
"electron-updater": "^4.2.2",
"node-fetch": "^2.6.0"
},
"devDependencies": {
"devtron": "^1.4.0",
"electron": "^8.2.1",
"electron-build-env": "^0.2",
"electron-builder": "^20.40.2",
"electron-devtools-installer": "^2.2.4",
"electron-icon-maker": "0.0.4",
"neon-cli": "^0.1.17",
"rimraf": "^2.6.3",
"xo": "^0.24.0"
},
Expand Down
2 changes: 0 additions & 2 deletions plugins/adblocker/.gitignore

This file was deleted.

13 changes: 11 additions & 2 deletions plugins/adblocker/back.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
const { blockWindowAds } = require("./blocker");
const { ElectronBlocker } = require("@cliqz/adblocker-electron");
const { session } = require("electron");
const fetch = require("node-fetch");

module.exports = win => blockWindowAds(win.webContents);
const SOURCES = [
"https://raw.githubusercontent.com/kbinani/adblock-youtube-ads/master/signed.txt"
];

module.exports = () =>
ElectronBlocker.fromLists(fetch, SOURCES)
.then(blocker => blocker.enableBlockingInSession(session.defaultSession))
.catch(err => console.log("Error loading adBlocker", err));
8 changes: 0 additions & 8 deletions plugins/adblocker/blocker.js

This file was deleted.

32 changes: 0 additions & 32 deletions plugins/adblocker/contains-ads.js

This file was deleted.

37 changes: 0 additions & 37 deletions plugins/adblocker/downloader.js

This file was deleted.

Empty file.
Loading

0 comments on commit 422c3fc

Please sign in to comment.