Explorar o código

feat: extra toggle feature autoCloseToasts

Sv443 hai 5 horas
pai
achega
f7a02f2118

+ 9 - 9
assets/translations/README.md

@@ -16,15 +16,15 @@ To submit or edit a translation, please follow [this guide](../../contributing.m
 ### Translation progress:
 |   | Locale | Translated keys | Based on |
 | :----: | ------ | --------------- | :------: |
-|  | [`en-US`](./en-US.json) | `366` (default locale) |  |
-| ✅ | [`de-DE`](./de-DE.json) | `366/366` (100%) | ─ |
-|  | [`en-GB`](./en-GB.json) | `366/366` (100%) | `en-US` |
-| ‼️ | [`es-ES`](./es-ES.json) | `342/366` (93.4%) | ─ |
-| ‼️ | [`fr-FR`](./fr-FR.json) | `342/366` (93.4%) | ─ |
-| ‼️ | [`hi-IN`](./hi-IN.json) | `342/366` (93.4%) | ─ |
-| ‼️ | [`ja-JP`](./ja-JP.json) | `342/366` (93.4%) | ─ |
-| ‼️ | [`pt-BR`](./pt-BR.json) | `342/366` (93.4%) | ─ |
-| ‼️ | [`zh-CN`](./zh-CN.json) | `342/366` (93.4%) | ─ |
+|  | [`en-US`](./en-US.json) | `367` (default locale) |  |
+| ✅ | [`de-DE`](./de-DE.json) | `367/367` (100%) | ─ |
+|  | [`en-GB`](./en-GB.json) | `367/367` (100%) | `en-US` |
+| ‼️ | [`es-ES`](./es-ES.json) | `340/367` (92.6%) | ─ |
+| ‼️ | [`fr-FR`](./fr-FR.json) | `340/367` (92.6%) | ─ |
+| ‼️ | [`hi-IN`](./hi-IN.json) | `340/367` (92.6%) | ─ |
+| ‼️ | [`ja-JP`](./ja-JP.json) | `340/367` (92.6%) | ─ |
+| ‼️ | [`pt-BR`](./pt-BR.json) | `340/367` (92.6%) | ─ |
+| ‼️ | [`zh-CN`](./zh-CN.json) | `340/367` (92.6%) | ─ |
 
 <sub>
 ✅ - Fully translated

+ 3 - 2
assets/translations/de-DE.json

@@ -304,8 +304,9 @@
 
   "feature_desc_disableBeforeUnloadPopup": "Verhindere das Erscheinen des Bestätigungs-Popup beim Verlassen der Seite, während ein Song läuft",
   "feature_helptext_disableBeforeUnloadPopup": "Wenn du versuchst, die Seite zu verlassen, während ein Song läuft, erscheint ein Popup, das dich fragt, ob du die Seite wirklich verlassen möchtest. Es könnte etwas in der Art von \"Du hast ungespeicherte Daten\" oder \"Diese Seite fragt, ob du sie schließen möchtest\" sein.\nDiese Funktion deaktiviert dieses Popup vollständig.",
-  "feature_desc_closeToastsTimeout": "Nach wie vielen Sekunden permanente Benachrichtigungen geschlossen werden sollen - 0 für manuelles Schließen",
-  "feature_helptext_closeToastsTimeout": "Die meisten Popups, die in der unteren linken Ecke erscheinen, schließen sich automatisch nach 3 Sekunden, mit Ausnahme von bestimmten wie z.B. beim Liken eines Songs.\nDiese Funktion ermöglicht es dir, eine Zeit festzulegen, nach der permanente Popups geschlossen werden.\nDie anderen Popups bleiben unberührt.\nSetze dies auf 0 für das Standardverhalten, permanente Benachrichtigungen nicht zu schließen.",
+  "feature_desc_autoCloseToasts": "Automatisch alle Toast-Benachrichtigungen schließen, die normalerweise permanent sind",
+  "feature_helptext_autoCloseToasts": "Die meisten Toast-Benachrichtigungen, die in der unteren linken Ecke erscheinen, schließen sich normalerweise nach 3 Sekunden automatisch, mit Ausnahme von bestimmten Benachrichtigungen wie nach dem Liken eines Songs.\nMit dieser Funktion werden die permanenten Toasts automatisch geschlossen. Die anderen bleiben unbeeinflusst.",
+  "feature_desc_closeToastsTimeout": "Nach wie vielen Sekunden die Toasts geschlossen werden sollen",
   "feature_desc_rememberSongTime": "Stelle die Zeit des letzten Songs wieder her, wenn die Seite neu geladen oder wiederhergestellt wird",
   "feature_helptext_rememberSongTime-1": "Wahrscheinlich möchtest du nach Neuladen der Seite oder nach versehentlichem Schließen an derselben Stelle weiterhören.\nDiese Funktion speichert die Zeit des momentan laufenden Songs sobald er für mindestens eine Sekunde abgespielt wurde und stellt sie für eine kurze Zeit im Nachhinein wieder her.",
   "feature_helptext_rememberSongTime-n": "Wahrscheinlich möchtest du nach Neuladen der Seite oder nach versehentlichem Schließen an derselben Stelle weiterhören.\nDiese Funktion speichert die Zeit des momentan laufenden Songs sobald er für mindestens %1 Sekunden abgespielt wurde und stellt sie für eine kurze Zeit im Nachhinein wieder her.",

+ 3 - 2
assets/translations/en-US.json

@@ -304,8 +304,9 @@
 
   "feature_desc_disableBeforeUnloadPopup": "Prevent the confirmation popup that appears when trying to leave the site while a song is playing",
   "feature_helptext_disableBeforeUnloadPopup": "When trying to leave the site while a few seconds into a song that is actively playing, a popup will appear asking you to confirm that you want to leave the site. It might say something along the lines of \"you have unsaved data\" or \"this site is asking if you want to close it\".\nThis feature disables that popup entirely.",
-  "feature_desc_closeToastsTimeout": "After how many seconds to close permanent notifications - 0 to only close them manually (default behavior)",
-  "feature_helptext_closeToastsTimeout": "Most popups that appear in the bottom left corner will close automatically after 3 seconds with the exception of certain ones like when liking a song.\nThis feature allows you to set a time for those permanent popups to be closed.\nThe other kind of popups will stay unaffected.\nSet this to 0 for the default behavior of not closing permanent notifications.",
+  "feature_desc_autoCloseToasts": "Automatically close toast notifications that are usually permanent",
+  "feature_helptext_autoCloseToasts": "Most toast notifications that appear in the bottom left corner will close automatically after 3 seconds with the exception of certain ones like when liking a song.\nWith this feature enabled, the permanent toasts will be automatically closed. The other kind will stay unaffected.",
+  "feature_desc_closeToastsTimeout": "After how many seconds to close the toasts",
   "feature_desc_rememberSongTime": "Remember the last song's time when reloading or restoring the tab",
   "feature_helptext_rememberSongTime-1": "Sometimes when reloading the page or restoring it after accidentally closing it, you want to resume listening at the same point. This feature allows you to do that.\nIn order to record the song's time, you need to play it for %1 second, then its time will be remembered and be restorable for a short while.",
   "feature_helptext_rememberSongTime-n": "Sometimes when reloading the page or restoring it after accidentally closing it, you want to resume listening at the same point. This feature allows you to do that.\nIn order to record the song's time, you need to play it for %1 seconds, then its time will be remembered and be restorable for a short while.",

+ 0 - 2
assets/translations/es-ES.json

@@ -294,8 +294,6 @@
 
   "feature_desc_disableBeforeUnloadPopup": "Evite la ventana emergente de confirmación que aparece al intentar salir del sitio mientras se reproduce una canción",
   "feature_helptext_disableBeforeUnloadPopup": "Cuando intenta salir del sitio mientras está reproduciendo una canción que lleva unos segundos, aparecerá una ventana emergente que le pedirá que confirme que desea salir del sitio. Podría decir algo así como \"tiene datos no guardados\" o \"este sitio está preguntando si desea cerrarlo\".\nEsta función deshabilita completamente esa ventana emergente.",
-  "feature_desc_closeToastsTimeout": "Después de cuántos segundos cerrar las notificaciones permanentes - 0 para cerrarlas solo manualmente (comportamiento predeterminado)",
-  "feature_helptext_closeToastsTimeout": "La mayoría de las notificaciones que aparecen en la esquina inferior izquierda se cerrarán automáticamente después de 3 segundos, con la excepción de ciertas como cuando le gusta una canción.\nEsta función le permite establecer un tiempo para que se cierren las notificaciones permanentes.\nEl otro tipo de notificaciones no se verá afectado.\nEstablezca esto en 0 para el comportamiento predeterminado de no cerrar las notificaciones permanentes.",
   "feature_desc_rememberSongTime": "Recuerde el tiempo de la última canción al volver a cargar o restaurar la pestaña",
   "feature_helptext_rememberSongTime-1": "A veces, al volver a cargar la página o restaurarla después de cerrarla accidentalmente, desea reanudar la escucha en el mismo punto. Esta función le permite hacer eso.\nPara registrar el tiempo de la canción, debe reproducirla durante %1 segundo, luego su tiempo se recordará y se podrá restaurar por un corto tiempo.",
   "feature_helptext_rememberSongTime-n": "A veces, al volver a cargar la página o restaurarla después de cerrarla accidentalmente, desea reanudar la escucha en el mismo punto. Esta función le permite hacer eso.\nPara registrar el tiempo de la canción, debe reproducirla durante %1 segundos, luego su tiempo se recordará y se podrá restaurar por un corto tiempo.",

+ 0 - 2
assets/translations/fr-FR.json

@@ -294,8 +294,6 @@
 
   "feature_desc_disableBeforeUnloadPopup": "Empêcher la fenêtre contextuelle de confirmation qui apparaît lors de la tentative de quitter le site pendant qu'une chanson est en cours de lecture",
   "feature_helptext_disableBeforeUnloadPopup": "Lorsque vous essayez de quitter le site alors que vous êtes quelques secondes dans une chanson qui est en cours de lecture, une fenêtre contextuelle apparaîtra pour vous demander de confirmer que vous voulez quitter le site. Elle pourrait dire quelque chose comme \"vous avez des données non enregistrées\" ou \"ce site demande si vous voulez le fermer\".\nCette fonctionnalité désactive complètement cette fenêtre contextuelle.",
-  "feature_desc_closeToastsTimeout": "Au bout de combien de secondes fermer les notifications permanentes - 0 pour ne les fermer qu'à la main (comportement par défaut)",
-  "feature_helptext_closeToastsTimeout": "La plupart des notifications qui apparaissent dans le coin inférieur gauche se fermeront automatiquement après 3 secondes, à l'exception de certaines comme lorsque vous aimez une chanson.\nCette fonctionnalité vous permet de définir un délai pour la fermeture de ces notifications permanentes.\nLes autres types de notifications resteront inchangés.\nRéglez cette valeur à 0 pour le comportement par défaut de ne pas fermer les notifications permanentes.",
   "feature_desc_rememberSongTime": "Se souvenir du temps de la dernière chanson lors du rechargement ou de la restauration de l'onglet",
   "feature_helptext_rememberSongTime-1": "Parfois, lorsque vous rechargez la page ou la restaurez après l'avoir fermée accidentellement, vous voulez reprendre l'écoute au même point. Cette fonctionnalité vous permet de le faire.\nPour enregistrer le temps de la chanson, vous devez la lire pendant %1 seconde, puis son temps sera mémorisé et pourra être restauré pendant un court instant.",
   "feature_helptext_rememberSongTime-n": "Parfois, lorsque vous rechargez la page ou la restaurez après l'avoir fermée accidentellement, vous voulez reprendre l'écoute au même point. Cette fonctionnalité vous permet de le faire.\nPour enregistrer le temps de la chanson, vous devez la lire pendant %1 secondes, puis son temps sera mémorisé et pourra être restauré pendant un court instant.",

+ 0 - 2
assets/translations/hi-IN.json

@@ -294,8 +294,6 @@
 
   "feature_desc_disableBeforeUnloadPopup": "एक गीत चल रहे होने पर साइट छोड़ने का प्रयास करने पर आने वाली पुष्टि पॉपअप को रोकें",
   "feature_helptext_disableBeforeUnloadPopup": "जब आप वेबसाइट छोड़ने की कोशिश करते हैं जब आप एक गीत को थोड़े समय के लिए सुन रहे होते हैं, तो एक पॉपअप आता है जो आपसे पुष्टि करता है कि क्या आप वाकई साइट छोड़ना चाहते हैं। यह कुछ इस प्रकार का हो सकता है \"आपके पास असहेज डेटा है\" या \"यह साइट आपसे पूछ रही है कि क्या आप इसे बंद करना चाहते हैं\"।\nयह सुविधा इस पॉपअप को पूरी तरह से अक्षम करती है।",
-  "feature_desc_closeToastsTimeout": "कितने सेकंड के बाद स्थायी सूचनाओं को बंद करें - केवल उन्हें मैन्युअल रूप से बंद करने के लिए 0 (डिफ़ॉल्ट व्यवहार)",
-  "feature_helptext_closeToastsTimeout": "बहुत सारी स्थायी सूचनाएँ जो नीचे बाएं कोने में दिखाई देती हैं, वे 3 सेकंड के बाद स्वचालित रूप से बंद हो जाएंगी उनमें से कुछ ऐसी होती हैं जैसे गाना पसंद करने पर।\nयह सुविधा आपको उन स्थायी सूचनाओं को बंद करने के लिए समय निर्धारित करने की अनुमति देती है।\nअन्य प्रकार की स्थायी सूचनाएँ अस्पष्ट रहेंगी।\nइसे 0 के लिए सेट करें ताकि स्थायी सूचनाएँ बंद न हों।",
   "feature_desc_rememberSongTime": "टैब को फिर से लोड करने या बहाल करने पर अंतिम गीत का समय याद रखें",
   "feature_helptext_rememberSongTime-1": "कभी-कभी पृष्ठ को फिर से लोड करने या उसे अनजाने में बंद करने के बाद, आप चाहते हैं कि आप वही समय पर सुनना जारी रखें। यह सुविधा आपको इसे करने की अनुमति देती है।\nगीत का समय याद करने और बहाल करने के लिए, आपको इसे %1 सेकंड तक चलाना होगा, फिर इसका समय याद किया जाएगा और थोड़ी देर के लिए बहाल किया जा सकता है।",
   "feature_helptext_rememberSongTime-n": "कभी-कभी पृष्ठ को फिर से लोड करने या उसे अनजाने में बंद करने के बाद, आप चाहते हैं कि आप वही समय पर सुनना जारी रखें। यह सुविधा आपको इसे करने की अनुमति देती है।\nगीत का समय याद करने और बहाल करने के लिए, आपको इसे %1 सेकंड तक चलाना होगा, फिर इसका समय याद किया जाएगा और थोड़ी देर के लिए बहाल किया जा सकता है।",

+ 0 - 2
assets/translations/ja-JP.json

@@ -294,8 +294,6 @@
 
   "feature_desc_disableBeforeUnloadPopup": "曲が再生されている間にサイトを離れようとすると表示される確認ポップアップを防止する",
   "feature_helptext_disableBeforeUnloadPopup": "曲が再生されている間にサイトを離れようとすると、数秒後にポップアップが表示され、サイトを離れるかどうかを確認するように求められます。それは「保存されていないデータがあります」とか「このサイトを閉じるかどうかを尋ねています」とかのようなことが書かれているかもしれません。\nこの機能はそのポップアップを完全に無効にします。",
-  "feature_desc_closeToastsTimeout": "永続的な通知を閉じるまでの秒数 - 手動で閉じるには 0 (デフォルト動作)",
-  "feature_helptext_closeToastsTimeout": "左下隅に表示されるほとんどのポップアップは、曲を好きにするといった特定のものを除いて、3 秒後に自動的に閉じます。\nこの機能を使用すると、永続的なポップアップを閉じる時間を設定できます。\n他の種類のポップアップは影響を受けません。\n永続的な通知を閉じないデフォルト動作にするには 0 を設定してください。",
   "feature_desc_rememberSongTime": "リロードまたはタブの復元時に最後の曲の時間を記憶する",
   "feature_helptext_rememberSongTime-1": "ページを再読み込みしたり、誤って閉じたりして復元したときに、同じ場所で聞き直したいことがあります。この機能を使用すると、それが可能になります。\n曲の時間を記録するには、%1 秒再生する必要があります。その後、その時間が記憶され、しばらくの間復元可能になります。",
   "feature_helptext_rememberSongTime-n": "ページを再読み込みしたり、誤って閉じたりして復元したときに、同じ場所で聞き直したいことがあります。この機能を使用すると、それが可能になります。\n曲の時間を記録するには、%1 秒再生する必要があります。その後、その時間が記憶され、しばらくの間復元可能になります。",

+ 0 - 2
assets/translations/pt-BR.json

@@ -294,8 +294,6 @@
 
   "feature_desc_disableBeforeUnloadPopup": "Evite a janela de confirmação que aparece ao tentar sair do site enquanto uma música está tocando",
   "feature_helptext_disableBeforeUnloadPopup": "Ao tentar sair do site enquanto uma música está tocando, uma janela de confirmação pode aparecer, pedindo que você confirme que deseja sair do site. Pode dizer algo como \"você tem dados não salvos\" ou \"este site está perguntando se você deseja fechá-lo\".\nEste recurso desativa completamente essa janela de confirmação.",
-  "feature_desc_closeToastsTimeout": "Após quantos segundos fechar as notificações permanentes - 0 para fechá-las apenas manualmente (comportamento padrão)",
-  "feature_helptext_closeToastsTimeout": "A maioria das notificações que aparecem no canto inferior esquerdo fechará automaticamente após 3 segundos, com exceção de certas, como ao curtir uma música.\nEste recurso permite definir um tempo para fechar as notificações permanentes.\nO outro tipo de notificações permanecerá inalterado.\nDefina isso como 0 para o comportamento padrão de não fechar as notificações permanentes.",
   "feature_desc_rememberSongTime": "Lembre-se do tempo da última música ao recarregar ou restaurar a guia",
   "feature_helptext_rememberSongTime-1": "Às vezes, ao recarregar a página ou restaurá-la após fechá-la acidentalmente, você deseja retomar a audição no mesmo ponto. Este recurso permite que você faça isso.\nPara registrar o tempo da música, você precisa reproduzi-la por %1 segundo, então seu tempo será lembrado e restaurável por um curto período.",
   "feature_helptext_rememberSongTime-n": "Às vezes, ao recarregar a página ou restaurá-la após fechá-la acidentalmente, você deseja retomar a audição no mesmo ponto. Este recurso permite que você faça isso.\nPara registrar o tempo da música, você precisa reproduzi-la por %1 segundos, então seu tempo será lembrado e restaurável por um curto período.",

+ 0 - 2
assets/translations/zh-CN.json

@@ -294,8 +294,6 @@
 
   "feature_desc_disableBeforeUnloadPopup": "防止在播放歌曲时尝试离开网站时出现的确认弹出窗口",
   "feature_helptext_disableBeforeUnloadPopup": "当尝试在正在播放的歌曲中几秒钟后离开网站时,将出现一个弹出窗口,询问您是否要离开网站。它可能会说类似于 \"您有未保存的数据\" 或 \"此网站正在询问您是否要关闭它\"。\n此功能完全禁用了该弹出窗口。",
-  "feature_desc_closeToastsTimeout": "多少秒后关闭永久通知 - 0 仅手动关闭(默认行为)",
-  "feature_helptext_closeToastsTimeout": "出现在左下角的大多数弹出窗口将在 3 秒后自动关闭,但有一些例外,例如喜欢一首歌时。\n此功能允许您设置永久弹出窗口关闭的时间。\n其他类型的弹出窗口不受影响。\n将此设置为 0 以使用默认行为,即不关闭永久通知。",
   "feature_desc_rememberSongTime": "记住重新加载或恢复标签时的最后一首歌的时间",
   "feature_helptext_rememberSongTime-1": "有时在重新加载页面或意外关闭后恢复它时,您希望在相同的位置继续听歌。此功能允许您这样做。\n为了记录歌曲的时间,您需要播放它 %1 秒,然后它的时间将被记住,并在短时间内可以恢复。",
   "feature_helptext_rememberSongTime-n": "有时在重新加载页面或意外关闭后恢复它时,您希望在相同的位置继续听歌。此功能允许您这样做。\n为了记录歌曲的时间,您需要播放它 %1 秒,然后它的时间将被记住,并在短时间内可以恢复。",

+ 10 - 8
src/config.ts

@@ -129,15 +129,19 @@ export const migrations: DataMigrationsDict = {
       oldData.locale = "ja-JP";
     if(oldData.locale as string === "en-GB")
       oldData.locale = "en-GB";
-    return useDefaultConfig(oldData, [
-      "resetEverything",
-      // TODO(V2.2):
-      // "autoLikePlayerBarToggleBtn",
-    ]);
+
+    return useDefaultConfig(oldData, ["resetEverything"]);
   },
   // 9 -> 10 (v2.3.0)
   10: (oldData: FeatureConfig) => {
-    const migData = useNewDefaultIfUnchanged(
+    oldData.closeToastsTimeout = clamp(oldData.closeToastsTimeout, featInfo.closeToastsTimeout.min, featInfo.closeToastsTimeout.max);
+
+    oldData.lyricsCacheMaxSize = clamp(oldData.lyricsCacheMaxSize, featInfo.lyricsCacheMaxSize.min, featInfo.lyricsCacheMaxSize.max);
+
+    oldData.autoCloseToasts = oldData.closeToastsTimeout > 0;
+    oldData.closeToastsTimeout = clamp(oldData.closeToastsTimeout, featInfo.closeToastsTimeout.min, featInfo.closeToastsTimeout.max);
+
+    return useNewDefaultIfUnchanged(
       useDefaultConfig(oldData, [
         "aboveQueueBtnsSticky", "autoScrollToActiveSongMode",
         "frameSkip", "frameSkipWhilePlaying",
@@ -153,8 +157,6 @@ export const migrations: DataMigrationsDict = {
         { key: "lyricsCacheMaxSize", oldDefault: 2000 },
       ],
     );
-    migData.lyricsCacheMaxSize = clamp(migData.lyricsCacheMaxSize, featInfo.lyricsCacheMaxSize.min, featInfo.lyricsCacheMaxSize.max);
-    return migData;
   },
 } as const satisfies DataMigrationsDict;
 

+ 3 - 0
src/features/behavior.ts

@@ -43,6 +43,9 @@ export async function initAutoCloseToasts() {
     continuous: true,
     listener: async (toastContElems) => {
       try {
+        if(!getFeature("autoCloseToasts"))
+          return;
+
         for(const toastContElem of toastContElems) {
           const toastElem = toastContElem.querySelector<HTMLElement>("tp-yt-paper-toast#toast");
           if(!toastElem || !toastElem.hasAttribute("allow-click-through"))

+ 11 - 3
src/features/index.ts

@@ -450,12 +450,20 @@ export const featInfo = {
     default: false,
     textAdornment: adornments.reload,
   },
+  autoCloseToasts: {
+    type: "toggle",
+    category: "behavior",
+    supportedSites: ["ytm", "yt"],
+    default: true,
+    reloadRequired: false,
+    enable: noop,
+  },
   closeToastsTimeout: {
-    type: "number",
+    type: "slider",
     category: "behavior",
     supportedSites: ["ytm", "yt"],
-    min: 0,
-    max: 30,
+    min: 0.5,
+    max: 20,
     step: 0.5,
     default: 3,
     unit: "s",

+ 6 - 4
src/features/input.ts

@@ -203,13 +203,13 @@ export async function initAutoLike() {
           if(!likeChan || !likeChan.enabled)
             return;
 
-          if(artistEls.length === 0)
-            return error("Couldn't auto-like channel because the artist element couldn't be found");
+          if(artistEls.length === 0 || channelIds.length === 0)
+            return error("Couldn't auto-like because the artist element couldn't be found");
 
           const { likeBtn, likeState } = getLikeDislikeBtns();
 
           if(!likeBtn)
-            return error("Couldn't auto-like channel because the like button couldn't be found");
+            return error("Couldn't auto-like because the like button couldn't be found");
 
           if(!likeState || likeState === "INDIFFERENT") {
             likeBtn.click();
@@ -221,8 +221,10 @@ export async function initAutoLike() {
               onClick: () => getAutoLikeDialog().then((dlg) => dlg.open()),
             }).catch(e => error("Error while showing auto-like toast:", e));
 
-            log(`Auto-liked ${getCurrentMediaType()} from channel '${likeChan.name}' (${likeChan.id})`);
+            info(`Auto-liked ${getCurrentMediaType()} from channel '${likeChan.name}' (${likeChan.id}) - permalink: https://${getDomain() === "ytm" ? "music.youtube.com/watch?v=" : "youtu.be/"}${new URL(location.href).searchParams.get("v")}`);
           }
+          else
+            info("Skipping auto-like, because the like state is currently set to", likeState);
         };
         timeout = setTimeout(ytmTryAutoLike, autoLikeTimeoutMs);
         siteEvents.on("autoLikeChannelsUpdated", () => setTimeout(ytmTryAutoLike, autoLikeTimeoutMs));

+ 3 - 1
src/types.ts

@@ -588,7 +588,9 @@ export interface FeatureConfig {
   //#region behavior
   /** Whether to completely disable the popup that sometimes appears before leaving the site */
   disableBeforeUnloadPopup: boolean;
-  /** After how many milliseconds to close permanent toasts */
+  /** Whether to automatically close permanent toasts */
+  autoCloseToasts: boolean;
+  /** After how many seconds to close permanent toasts */
   closeToastsTimeout: number;
   /** Remember the last song's time when reloading or restoring the tab */
   rememberSongTime: boolean;