mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 02:31:45 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 22c7f70c93 |
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "youtube-music",
|
||||
"productName": "YouTube Music",
|
||||
"version": "1.7.2",
|
||||
"version": "1.7.3",
|
||||
"description": "YouTube Music Desktop App - including custom plugins",
|
||||
"license": "MIT",
|
||||
"repository": "th-ch/youtube-music",
|
||||
|
||||
@ -3,5 +3,6 @@ module.exports = (win, options) =>
|
||||
loadAdBlockerEngine(
|
||||
win.webContents.session,
|
||||
options.cache,
|
||||
options.additionalBlockLists
|
||||
options.additionalBlockLists,
|
||||
options.disableDefaultLists
|
||||
);
|
||||
|
||||
@ -11,7 +11,8 @@ const SOURCES = [
|
||||
const loadAdBlockerEngine = (
|
||||
session = undefined,
|
||||
cache = true,
|
||||
additionalBlockLists = []
|
||||
additionalBlockLists = [],
|
||||
disableDefaultLists = false
|
||||
) => {
|
||||
// Only use cache if no additional blocklists are passed
|
||||
const cachingOptions =
|
||||
@ -22,13 +23,12 @@ const loadAdBlockerEngine = (
|
||||
write: promises.writeFile,
|
||||
}
|
||||
: undefined;
|
||||
const lists = [
|
||||
...(disableDefaultLists ? [] : SOURCES),
|
||||
...additionalBlockLists,
|
||||
];
|
||||
|
||||
ElectronBlocker.fromLists(
|
||||
fetch,
|
||||
[...SOURCES, ...additionalBlockLists],
|
||||
{},
|
||||
cachingOptions
|
||||
)
|
||||
ElectronBlocker.fromLists(fetch, lists, {}, cachingOptions)
|
||||
.then((blocker) => {
|
||||
if (session) {
|
||||
blocker.enableBlockingInSession(session);
|
||||
|
||||
Reference in New Issue
Block a user