@engineer, пользуйся)
(function() {
const triggerWords = ['engineer', 'Русский ТЛЕН', 'shorry'];
// Находим все элементы с классом user-small
const userSmallElements = document.querySelectorAll('.user-small');
userSmallElements.forEach(userSmall => {
const infoElement = userSmall.querySelector('.info');
if (infoElement) {
const infoText = infoElement.textContent || infoElement.innerText;
const infoLower = infoText.toLowerCase();
// Проверяем наличие triggerWords
const shouldRemove = triggerWords.some(word =>
infoLower.includes(word.toLowerCase())
);
if (shouldRemove) {
// Ищем следующий элемент .post-text.ready
const postContainer = userSmall.closest('.post');
if (postContainer) {
const postText = postContainer.querySelector('.post-text.ready');
if (postText) {
postText.innerHTML = '';
postText.textContent = '[Сообщение скрыто]';
postText.style.cssText = `
background-color: #f0f0f0;
padding: 15px;
border-radius: 5px;
color: #999;
font-style: italic;
`;
}
}
// Альтернативный поиск по структуре
const nextSibling = userSmall.nextElementSibling;
if (nextSibling && nextSibling.classList.contains('post-text')) {
nextSibling.innerHTML = '';
nextSibling.textContent = 'Содержимое скрыто по фильтру';
}
}
}
});
})();