From b9ea98c1156b672b79724573a77d90d81abdf4db Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 3 Oct 2023 12:56:49 +0900 Subject: [PATCH] fix(in-app-menu): remove unused observer --- plugins/in-app-menu/front.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/plugins/in-app-menu/front.ts b/plugins/in-app-menu/front.ts index 9ef50c06..a5a13b99 100644 --- a/plugins/in-app-menu/front.ts +++ b/plugins/in-app-menu/front.ts @@ -7,9 +7,6 @@ import { createPanel } from './menu/panel'; import { ElementFromFile } from '../utils'; import { isEnabled } from '../../config/plugins'; -type ElectronCSSStyleDeclaration = CSSStyleDeclaration & { webkitAppRegion: 'drag' | 'no-drag' }; -type ElectronHTMLElement = HTMLElement & { style: ElectronCSSStyleDeclaration }; - function $(selector: string) { return document.querySelector(selector); } @@ -68,7 +65,6 @@ export default () => { // Increases the right margin of Navbar background when the scrollbar is visible to avoid blocking it (z-index doesn't affect it) document.addEventListener('apiLoaded', () => { - setupSearchOpenObserver(); const htmlHeadStyle = $('head > div > style'); if (htmlHeadStyle) { // HACK: This is a hack to remove the scrollbar width @@ -76,16 +72,3 @@ export default () => { } }, { once: true, passive: true }); }; - -function setupSearchOpenObserver() { - const searchOpenObserver = new MutationObserver((mutations) => { - const navBarBackground = $('#nav-bar-background'); - if (navBarBackground) { - navBarBackground.style.webkitAppRegion = (mutations[0].target as HTMLElement & { opened: boolean }).opened ? 'no-drag' : 'drag'; - } - }); - const searchBox = $('ytmusic-search-box'); - if (searchBox) { - searchOpenObserver.observe(searchBox, { attributeFilter: ['opened'] }); - } -}