Created
April 9, 2025 10:42
-
-
Save dvygolov/f9bf8cadf5d269dafd56bb25d8a0689d to your computer and use it in GitHub Desktop.
removes unnecessary text from ad section in Dolphin Cloud: https://yellowweb.top/dolphincloud
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
// 1. Заменяем лишние div на иконку с тултипом | |
document.querySelectorAll( | |
'.v-data-table__wrapper table tbody tr td:nth-child(3) > div:first-child > div:nth-child(2)' | |
).forEach(originalDiv => { | |
const content = originalDiv.innerHTML; | |
const tooltipWrapper = document.createElement('span'); | |
tooltipWrapper.style.position = 'relative'; | |
tooltipWrapper.style.cursor = 'pointer'; | |
tooltipWrapper.style.display = 'inline-block'; | |
tooltipWrapper.style.zIndex = '10000'; | |
const infoIcon = document.createElement('span'); | |
infoIcon.textContent = 'ℹ️'; | |
infoIcon.style.fontSize = '16px'; | |
const tooltip = document.createElement('div'); | |
tooltip.innerHTML = content; | |
tooltip.style.position = 'fixed'; | |
tooltip.style.backgroundColor = '#fff'; | |
tooltip.style.border = '1px solid #ccc'; | |
tooltip.style.padding = '10px'; | |
tooltip.style.boxShadow = '0 2px 10px rgba(0,0,0,0.3)'; | |
tooltip.style.zIndex = '9999'; | |
tooltip.style.whiteSpace = 'normal'; | |
tooltip.style.display = 'none'; | |
tooltip.style.maxWidth = '300px'; | |
tooltipWrapper.addEventListener('mouseenter', (e) => { | |
tooltip.style.display = 'block'; | |
const rect = e.target.getBoundingClientRect(); | |
tooltip.style.top = rect.bottom + 'px'; | |
tooltip.style.left = rect.left + 'px'; | |
document.body.appendChild(tooltip); | |
}); | |
tooltipWrapper.addEventListener('mouseleave', () => { | |
tooltip.style.display = 'none'; | |
if (tooltip.parentNode === document.body) { | |
document.body.removeChild(tooltip); | |
} | |
}); | |
tooltipWrapper.appendChild(infoIcon); | |
originalDiv.replaceWith(tooltipWrapper); | |
}); | |
// 2. Удаляем кастомную ширину и высоту у <img> | |
document.querySelectorAll('.v-data-table__wrapper img').forEach(img => { | |
img.style.width = '64px'; | |
img.style.height = '64px'; | |
img.removeAttribute('width'); | |
img.removeAttribute('height'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment