Nitter/Xcancel 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

// ==UserScript==
// @name         Nitter/Xcancel 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://xcancel.com/*
// @grant        none
// @version 0.0.1.20250509102344
// @namespace https://gf.qytechs.cn/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: 'piped.video',
        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);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址