Threads: по умолчанию лента Подписки
Автоматически переключает домашнюю ленту с «Для вас» на «Подписки» при загрузке страницы.
Код для копирования
// Switch the home feed from "For you" to "Following" automatically
function pickFollowing() {
if (location.pathname !== '/' && !/^\/\?/.test(location.pathname + location.search)) return;
const tabs = document.querySelectorAll('[role="tab"], [role="menuitem"]');
for (const t of tabs) {
const label = (t.textContent || '').trim().toLowerCase();
if ((label === 'following' || label === 'obserwowani' || label === 'abonnements') &&
t.getAttribute('aria-selected') !== 'true') {
t.click();
return;
}
}
}
let done = false;
function tryOnce() { if (!done) { pickFollowing(); } }
tryOnce();
const obs = new MutationObserver(() => { if (!done) tryOnce(); });
obs.observe(document.documentElement, { childList: true, subtree: true });
setTimeout(() => { done = true; obs.disconnect(); }, 8000);
Как использовать этот пример
- Скопируй код кнопкой выше.
- Установи JustZix (2 минуты) и открой расширение на нужной странице.
- Добавь новое правило, совпадающее с этой страницей.
- Вставь код в панель JavaScript правила и сохрани — он запускается при каждом заходе на страницу.
Оцени этот пример
Оценок пока нет — оцени первым.