js-tampermonkey-public-scripts/Удалить блок Рекомендации.user.js
Unkas Amanjolov 42b29defae first commit
2024-10-07 10:25:50 +05:00

49 lines
1.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ==UserScript==
// @name Удалить блок Рекомендации
// @namespace https://github.com/le91
// @version 1.0
// @description Удалить блок Рекомендации где выводиться всякая хуйня!!!
// @author Lukas Endigo
// @match https://www.youtube.com/results?search_query=irDA+windows+software
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
function startRemove(){
//============================================================
var contentsElement = document.getElementById('contents');
if (contentsElement) {
var spans = contentsElement.querySelectorAll('.style-scope.ytd-item-section-renderer');
spans.forEach(function(span) {
// Проверить, начинается ли текст span с "Рекомендации"
if (span.innerText.trim().startsWith('Рекомендации')) {
//console.log(span.innerText);
span.remove();
}
});
}
//============================================================
}
// удалить новости с правой части экрана
setTimeout(function() {
try {
startRemove()
} catch { console.log('блок уже удален первый эпат') }
}, 3000);
setTimeout(function() {
try {
startRemove()
} catch { console.log('блок уже удален второй эпат') }
}, 13000);
})();