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