Hide MAL-Sync Chapter Popups

Hides MAL-Sync popups that contain "Chapter: X/X" so they don't appear after finishing a chapter.

目前為 2025-09-25 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Hide MAL-Sync Chapter Popups
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Hides MAL-Sync popups that contain "Chapter: X/X" so they don't appear after finishing a chapter.
// @author       YourName
// @match        (Insert your urls here)
// @run-at       document-end
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
  const hideChapterFlash = () => {
    document.querySelectorAll('.flash.flashinfo').forEach(el => {
      const txt = el.textContent || '';
      if (/Chapter:\s*\d+\s*\/\s*\d+/i.test(txt)) {
        el.style.display = 'none';
        el.style.visibility = 'hidden';
        el.style.pointerEvents = 'none';
      }
    });
  };

  new MutationObserver(hideChapterFlash).observe(document.documentElement, {
    childList: true,
    subtree: true
  });

  hideChapterFlash();
})();