mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-16 12:42:06 +00:00
hotfix: hotfix for #1267
This commit is contained in:
@ -1,3 +1,5 @@
|
|||||||
|
import { blockers } from '../plugins/adblocker/blocker-types';
|
||||||
|
|
||||||
export interface WindowSizeConfig {
|
export interface WindowSizeConfig {
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
@ -72,7 +74,7 @@ const defaultConfig = {
|
|||||||
'adblocker': {
|
'adblocker': {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
cache: true,
|
cache: true,
|
||||||
blocker: 'With blocklists',
|
blocker: blockers.InPlayer as string,
|
||||||
additionalBlockLists: [], // Additional list of filters, e.g "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt"
|
additionalBlockLists: [], // Additional list of filters, e.g "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt"
|
||||||
disableDefaultLists: false,
|
disableDefaultLists: false,
|
||||||
},
|
},
|
||||||
|
|||||||
4
plugins/adblocker/blocker-types.ts
Normal file
4
plugins/adblocker/blocker-types.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export const blockers = {
|
||||||
|
WithBlocklists: 'With blocklists',
|
||||||
|
InPlayer: 'In player',
|
||||||
|
} as const;
|
||||||
@ -1,15 +1,12 @@
|
|||||||
/* eslint-disable @typescript-eslint/await-thenable */
|
/* eslint-disable @typescript-eslint/await-thenable */
|
||||||
/* renderer */
|
/* renderer */
|
||||||
|
|
||||||
|
import { blockers } from './blocker-types';
|
||||||
|
|
||||||
import { PluginConfig } from '../../config/dynamic';
|
import { PluginConfig } from '../../config/dynamic';
|
||||||
|
|
||||||
const config = new PluginConfig('adblocker', { enableFront: true });
|
const config = new PluginConfig('adblocker', { enableFront: true });
|
||||||
|
|
||||||
export const blockers = {
|
|
||||||
WithBlocklists: 'With blocklists',
|
|
||||||
InPlayer: 'In player',
|
|
||||||
};
|
|
||||||
|
|
||||||
export const shouldUseBlocklists = async () => await config.get('blocker') !== blockers.InPlayer;
|
export const shouldUseBlocklists = async () => await config.get('blocker') !== blockers.InPlayer;
|
||||||
|
|
||||||
export default Object.assign(config, {
|
export default Object.assign(config, {
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
import config, { blockers } from './config';
|
import config from './config';
|
||||||
|
|
||||||
|
import { blockers } from './blocker-types';
|
||||||
|
|
||||||
import { MenuTemplate } from '../../menu';
|
import { MenuTemplate } from '../../menu';
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import config, { blockers } from './config';
|
import config from './config';
|
||||||
import inject from './inject';
|
import inject from './inject';
|
||||||
import injectCliqzPreload from './inject-cliqz-preload';
|
import injectCliqzPreload from './inject-cliqz-preload';
|
||||||
|
|
||||||
|
import { blockers } from './blocker-types';
|
||||||
|
|
||||||
export default async () => {
|
export default async () => {
|
||||||
if (await config.shouldUseBlocklists()) {
|
if (await config.shouldUseBlocklists()) {
|
||||||
// Preload adblocker to inject scripts/styles
|
// Preload adblocker to inject scripts/styles
|
||||||
|
|||||||
Reference in New Issue
Block a user