mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
fix: fix It Just Works
Fixed an issue that caused inconsistent execution results.
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
export default () => {
|
||||
const path = '@cliqz/adblocker-electron-preload'; // prevent require hoisting
|
||||
require(path);
|
||||
export default async () => {
|
||||
await import('@cliqz/adblocker-electron-preload');
|
||||
};
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
import config from './config';
|
||||
import config, { shouldUseBlocklists } from './config';
|
||||
import inject from './inject';
|
||||
import injectCliqzPreload from './inject-cliqz-preload';
|
||||
|
||||
import { blockers } from './blocker-types';
|
||||
|
||||
export default async () => {
|
||||
if (await config.shouldUseBlocklists()) {
|
||||
if (shouldUseBlocklists()) {
|
||||
// Preload adblocker to inject scripts/styles
|
||||
injectCliqzPreload();
|
||||
await injectCliqzPreload();
|
||||
// eslint-disable-next-line @typescript-eslint/await-thenable
|
||||
} else if ((await config.get('blocker')) === blockers.InPlayer) {
|
||||
} else if ((config.get('blocker')) === blockers.InPlayer) {
|
||||
inject();
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
export default () => {
|
||||
export default async () => {
|
||||
// See https://github.com/zerodytrash/Simple-YouTube-Age-Restriction-Bypass#userscript
|
||||
import('simple-youtube-age-restriction-bypass');
|
||||
await import('simple-youtube-age-restriction-bypass');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user