(function PlaybarButton() { if (!Spicetify.Platform.History) { setTimeout(PlaybarButton, 300); return; } const button = new Spicetify.Playbar.Button( "Lyrics Plus", ``, () => Spicetify.Platform.History.location.pathname !== "/lyrics-plus" ? Spicetify.Platform.History.push("/lyrics-plus") : Spicetify.Platform.History.goBack(), false, Spicetify.Platform.History.location.pathname === "/lyrics-plus", false ); const style = document.createElement("style"); style.innerHTML = ` .main-nowPlayingBar-lyricsButton { display: none !important; } li[data-id="/lyrics-plus"] { display: none; } `; style.classList.add("lyrics-plus:visual:playbar-button"); if (Spicetify.LocalStorage.get("lyrics-plus:visual:playbar-button") === "true") setPlaybarButton(); window.addEventListener("lyrics-plus", event => { if (event.detail?.name === "playbar-button") event.detail.value ? setPlaybarButton() : removePlaybarButton(); }); Spicetify.Platform.History.listen(location => { button.active = location.pathname === "/lyrics-plus"; }); function setPlaybarButton() { document.head.appendChild(style); button.register(); } function removePlaybarButton() { style.remove(); button.deregister(); } })();