mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
This issue is caused by the renderer's adblocker being loaded before the main process's adblocker.
20 lines
517 B
TypeScript
20 lines
517 B
TypeScript
import { BrowserWindow } from 'electron';
|
|
|
|
import { loadAdBlockerEngine } from './blocker';
|
|
import { shouldUseBlocklists } from './config';
|
|
|
|
import type { ConfigType } from '../../config/dynamic';
|
|
|
|
type AdBlockOptions = ConfigType<'adblocker'>;
|
|
|
|
export default async (win: BrowserWindow, options: AdBlockOptions) => {
|
|
if (shouldUseBlocklists()) {
|
|
await loadAdBlockerEngine(
|
|
win.webContents.session,
|
|
options.cache,
|
|
options.additionalBlockLists,
|
|
options.disableDefaultLists,
|
|
);
|
|
}
|
|
};
|