Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
fix: fix #29
Browse files Browse the repository at this point in the history
  • Loading branch information
JellyBrick committed Oct 4, 2023
1 parent 92a3a55 commit e86739c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions plugins/adblocker/blocker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,3 @@ export const loadAdBlockerEngine = (
};

export default { loadAdBlockerEngine };
if (require.main === module) {
loadAdBlockerEngine(); // Generate the engine without enabling it
}
2 changes: 1 addition & 1 deletion plugins/adblocker/inject-cliqz-preload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default () => {
const path = require.resolve('@cliqz/adblocker-electron-preload'); // prevent require hoisting
const path = '@cliqz/adblocker-electron-preload'; // prevent require hoisting
require(path);
};
4 changes: 2 additions & 2 deletions plugins/adblocker/preload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import config from './config';
import config, { blockers } from './config';
import inject from './inject';
import injectCliqzPreload from './inject-cliqz-preload';

Expand All @@ -7,7 +7,7 @@ export default async () => {
// Preload adblocker to inject scripts/styles
injectCliqzPreload();
// eslint-disable-next-line @typescript-eslint/await-thenable
} else if ((await config.get('blocker')) === config.blockers.InPlayer) {
} else if ((await config.get('blocker')) === blockers.InPlayer) {
inject();
}
};

0 comments on commit e86739c

Please sign in to comment.