Skip to content

Commit

Permalink
replaced node-fetch with cross-fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajaniraiyn committed Sep 2, 2021
1 parent e89a063 commit 93fe878
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 97 deletions.
4 changes: 2 additions & 2 deletions main/adblock/adblock.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { ElectronBlocker, fullLists } = require("@cliqz/adblocker-electron");
const { readFileSync, writeFileSync } = require("fs");
const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args));
const fetch = require('cross-fetch')

const adBlocker = ElectronBlocker.fromLists(
fetch,
Expand All @@ -9,7 +9,7 @@ const adBlocker = ElectronBlocker.fromLists(
enableCompression: true,
},
{
path: "./main/adblock/adblockCache.bin",
path: (__dirname + "/adblockCache.bin"),
read: async (...args) => readFileSync(...args),
write: async (...args) => writeFileSync(...args),
}
Expand Down
120 changes: 26 additions & 94 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
},
"dependencies": {
"@cliqz/adblocker-electron": "^1.22.5",
"cross-fetch": "^3.1.4",
"electron-context-menu": "^3.1.1",
"electron-download-manager": "^2.1.2",
"electron-squirrel-startup": "^1.0.0",
"node-fetch": "^3.0.0",
"v8-compile-cache": "^2.3.0"
},
"config": {
Expand Down

0 comments on commit 93fe878

Please sign in to comment.