diff --git a/src/plugins/navigation/index.ts b/src/plugins/navigation/index.ts index ed339a8e..3c23092b 100644 --- a/src/plugins/navigation/index.ts +++ b/src/plugins/navigation/index.ts @@ -10,18 +10,21 @@ import backHTML from './templates/back.html?raw'; export default createPlugin({ name: () => t('plugins.navigation.name'), description: () => t('plugins.navigation.description'), - restartNeeded: true, + restartNeeded: false, config: { enabled: true, }, stylesheets: [style], - renderer() { - const forwardButton = ElementFromHtml(forwardHTML); - const backButton = ElementFromHtml(backHTML); - const menu = document.querySelector('#right-content'); - - if (menu) { - menu.prepend(backButton, forwardButton); - } + renderer: { + start() { + const forwardButton = ElementFromHtml(forwardHTML); + const backButton = ElementFromHtml(backHTML); + const menu = document.querySelector('#right-content'); + menu?.prepend(backButton, forwardButton); + }, + stop() { + document.querySelector('[tab-id=FEmusic_back]')?.remove(); + document.querySelector('[tab-id=FEmusic_next]')?.remove(); + }, }, });