Greasy Fork

来自缓存

Greasy Fork is available in English.

Nitter Preference Tweaks: Infinite Scroll + HLS + mp4 + Non-sticky Profile

Keeps all default settings; enables infinite scrolling, HLS, mp4 playback; disables sticky profile on Nitter and Xcancel

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Nitter Preference Tweaks: Infinite Scroll + HLS + mp4 + Non-sticky Profile
// @description  Keeps all default settings; enables infinite scrolling, HLS, mp4 playback; disables sticky profile on Nitter and Xcancel
// @match        https://nitter.net/*
// @match        https://nitter.privacyredirect.com/*
// @match        https://xcancel.com/*
// @match        https://nitter.space/*
// @match        https://nitter.tiekoetter.com/*
// @version 0.0.1.20250904154127
// @namespace http://greasyfork.icu/users/1435046
// ==/UserScript==

(function() {
    // Prevent applying preferences more than once per session
    if (sessionStorage.getItem('prefsSet')) return;

    // Build preferences payload
    const prefs = new URLSearchParams({
        referer: '/',
        theme: 'Nitter',
        infiniteScroll: 'on',
        stickyProfile: '',      // unchecked
        bidiSupport: '',
        hideTweetStats: '',
        hideBanner: '',
        hidePins: '',
        hideReplies: '',
        squareAvatars: '',
        mp4Playback: 'on',
        hlsPlayback: 'on',
        proxyVideos: 'on',
        muteVideos: '',
        autoplayGifs: 'on',
        replaceTwitter: 'nitter.net',
        replaceYouTube: '',
        replaceReddit: 'teddit.net'
    });

    // Determine saveprefs endpoint based on current host
    const host = location.host;
    const saveUrl = `https://${host}/saveprefs`;

    // Send preferences
    fetch(saveUrl, {
        method: 'POST',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        body: prefs
    }).then(() => {
        sessionStorage.setItem('prefsSet', 'true');
    }).catch(console.error);
})();