Skip to content

Instantly share code, notes, and snippets.

@avin
Last active December 9, 2025 11:56
Show Gist options
  • Select an option

  • Save avin/c737daa581e78b638c8768320480d43e to your computer and use it in GitHub Desktop.

Select an option

Save avin/c737daa581e78b638c8768320480d43e to your computer and use it in GitHub Desktop.
VSCode/Cursor hide file explorer hover tooltips
(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());
})();
@avin
Copy link
Author

avin commented Dec 9, 2025

use it with custom-ui-style extention as

"custom-ui-style.external.imports": [
    {
      "type": "js",
      "url": "https://gist.githubusercontent.com/avin/c737daa581e78b638c8768320480d43e/raw/d7c05838a637c47d43f7696d227da5346020ac8e/no-hover.js",
    },
  ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment