// Remove sissy content
(() => {
const CONTAINER_SELECTOR = '.smash-video';
const HASHTAG_SELECTOR = '.hashtag';
function processContainer(container) {
if (!container.querySelector('video')) return;
const tags = container.querySelectorAll(HASHTAG_SELECTOR);
for (const tag of tags) {
const text = (tag.textContent || '').trim().toLowerCase();
if (text === '#sissified') {
container.remove();
return;
}
}
}
function initialScan() {
document.querySelectorAll(CONTAINER_SELECTOR).forEach(processContainer);
}
function observeDynamic() {
const mo = new MutationObserver(mutations => {
const toProcess = new Set();
for (const m of mutations) {
for (const node of m.addedNodes) {
if (node.nodeType !== 1) continue;
const el = node;
if (el.matches?.(CONTAINER_SELECTOR)) toProcess.add(el);
el.querySelectorAll?.(CONTAINER_SELECTOR).forEach(c => toProcess.add(c));
const ancestor = el.closest?.(CONTAINER_SELECTOR);
if (ancestor) toProcess.add(ancestor);
}
}
toProcess.forEach(processContainer);
});
mo.observe(document.body || document.documentElement, { childList: true, subtree: true });
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => {
initialScan();
observeDynamic();
});
} else {
initialScan();
observeDynamic();
}
})();