Last active
December 9, 2025 11:56
-
-
Save avin/c737daa581e78b638c8768320480d43e to your computer and use it in GitHub Desktop.
VSCode/Cursor hide file explorer hover tooltips
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
| (function() { | |
| let styleElement = null; | |
| let explorer = null; | |
| function createStyle() { | |
| if (!styleElement) { | |
| styleElement = document.createElement('style'); | |
| styleElement.textContent = `.workbench-hover-container { display: none !important; }`; | |
| document.head.appendChild(styleElement); | |
| } | |
| } | |
| function removeStyle() { | |
| if (styleElement) { | |
| styleElement.remove(); | |
| styleElement = null; | |
| } | |
| } | |
| function onExplorerEnter() { | |
| createStyle(); | |
| } | |
| function onExplorerLeave() { | |
| setTimeout(() => { | |
| if (!explorer?.matches(':hover')) removeStyle(); | |
| }, 500); | |
| } | |
| // Ждем появления explorer | |
| const observer = new MutationObserver(() => { | |
| explorer = document.querySelector('#workbench\\.view\\.explorer'); | |
| if (explorer && !explorer._listenersAttached) { | |
| explorer.addEventListener('mouseenter', onExplorerEnter); | |
| explorer.addEventListener('mouseleave', onExplorerLeave); | |
| explorer._listenersAttached = true; | |
| } | |
| }); | |
| observer.observe(document.body, { childList: true, subtree: true }); | |
| // Cleanup при unload | |
| window.addEventListener('beforeunload', () => observer.disconnect()); | |
| })(); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use it with custom-ui-style extention as