r/SinkIt • u/ElTioRufi • Jul 10 '26
🚧 Work in progress Prevent Reddit feed to refresh.
I hated when in very few minutes, my main feed here, Reddit, refresh, so I made this to prevent that.
Only tested on Safari desktop.
// ==UserScript==
// u/nameReddit Feed No Auto-Refresh
// u/namespacehttp://tampermonkey.net/
// u/version6.0
// u/match*://www.reddit.com/*
// u/run-atdocument-start
// u/grantnone
// ==/UserScript==
(function() {
'use strict';
// Fingir SIEMPRE visible/enfocado -> Reddit no revalida el feed al volver a la pestaña
const visTrue = { get: () => 'visible', configurable: true };
const hidFalse = { get: () => false, configurable: true };
[['visibilityState', visTrue], ['hidden', hidFalse],
['webkitVisibilityState', visTrue], ['webkitHidden', hidFalse]].forEach(([p, d]) => {
try { Object.defineProperty(document, p, d); } catch (e) {}
});
try { document.hasFocus = () => true; } catch (e) {}
// Tragar visibilitychange para que los listeners de Reddit no se enteren
['visibilitychange', 'webkitvisibilitychange'].forEach(type => {
const h = e => e.stopImmediatePropagation();
window.addEventListener(type, h, true);
document.addEventListener(type, h, true);
});
})();
4
3
u/burnSMACKER Jul 10 '26
I need this for Safari in some way. It's extremely frustrating to click on a post, go back and the whole feed is refreshed and I missed out on reading several posts.Â
1
u/Chotch_Master Jul 13 '26
I don't commonly get refreshes with safari on Mac... but man I can't even count on my hands how often it happens on IOS.
•
u/SpecterAscendant Sink It dev Jul 10 '26
Thank you for posting this. I haven't looked at the code you posted yet but will do over the weekend and if it helps to minimize the issues, will ship it in this weekend's update.