diff --git a/LE: Delete NoPopular Video.js b/LE: Delete NoPopular Video.js new file mode 100644 index 0000000..40b77f4 --- /dev/null +++ b/LE: Delete NoPopular Video.js @@ -0,0 +1,31 @@ +// ==UserScript== +// @name LE: Delete NoPopular Video +// @namespace http://tampermonkey.net/ +// @version 2025-01-04 +// @description try to take over the world! +// @author LE +// @match https://www.youtube.com/watch?v=* +// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com +// @grant none +// @run-at document-end +// ==/UserScript== + +(function() { + + document.querySelectorAll(`span.inline-metadata-item.style-scope.ytd-video-meta-block`).forEach(span => { + const text = span.textContent.trim(); + // Проверяем, соответствует ли текст нужному шаблону + if (/^\d+\sпросмотр*/.test(text)) { + let parent = span; + // Поднимаемся по дереву, пока не найдем + while (parent && parent.tagName !== 'YTD-COMPACT-VIDEO-RENDERER') { + parent = parent.parentElement; + } + // Удаляем найденный элемент + if (parent) { + parent.remove(); + } + } + }); + +})(); \ No newline at end of file