// ==UserScript== // @name X (Twitter) Bookmark Scroll Position Keeper // @namespace http://tampermonkey.net/ // @version 0.1 // @description Fixes automatic scroll to top after clicking on a bookmarked post in X (formerly Twitter) Bookmarks page // @match https://x.com/i/bookmarks* // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; let posY = 0; window.addEventListener('scroll', function() { const scrollPosition = window.scrollY; // Get the vertical scroll position if (window.scrollY === 0) { console.log("back to zero!"); window.scrollTo(0, posY); } else { posY = scrollPosition; } console.log(scrollPosition); }); })();