Created
January 29, 2026 23:16
-
-
Save luckycdev/cad858e365e96d6a23fcedc578328011 to your computer and use it in GitHub Desktop.
AnimeKAI Fix Unhidden Tabs Content Userscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name AnimeKAI Fix Unhidden Tabs Content | |
| // @namespace https://github.com/luckycdev | |
| // @version 1.0 | |
| // @description Hide unhidden tab dropdown content on AnimeKAI | |
| // @match *://animekai.to/* | |
| // @match *://animekai.im/* | |
| // @match *://animekai.la/* | |
| // @match *://animekai.nl/* | |
| // @match *://animekai.vc/* | |
| // @match *://anikai.to/* | |
| // @grant none | |
| // ==/UserScript== | |
| (function () { | |
| 'use strict'; | |
| function fixDropdown(li) { | |
| const ul = li.querySelector('ul'); | |
| if (!ul || ul.dataset.dropdownFixed) return; | |
| ul.dataset.dropdownFixed = 'true'; | |
| ul.style.visibility = 'hidden'; | |
| ul.style.opacity = '0'; | |
| ul.style.pointerEvents = 'none'; | |
| li.addEventListener('mouseenter', () => { | |
| ul.style.visibility = 'visible'; | |
| ul.style.opacity = '1'; | |
| ul.style.pointerEvents = 'auto'; | |
| }); | |
| li.addEventListener('mouseleave', () => { | |
| ul.style.visibility = 'hidden'; | |
| ul.style.opacity = '0'; | |
| ul.style.pointerEvents = 'none'; | |
| }); | |
| } | |
| function findDropdowns() { | |
| const menu = document.querySelector('.nav-menu'); | |
| if (!menu) return; | |
| const links = menu.querySelectorAll(':scope > ul > li > a'); | |
| for (const link of links) { | |
| const text = link.textContent.trim(); | |
| if (text !== 'Genres' && text !== 'Types') continue; | |
| const li = link.parentElement; | |
| if (!li) continue; | |
| fixDropdown(li); | |
| } | |
| } | |
| findDropdowns(); | |
| const observer = new MutationObserver(findDropdowns); | |
| observer.observe(document.body, { childList: true, subtree: true }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment