您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Fixes automatic scroll to top after clicking on a bookmarked post in X (formerly Twitter) Bookmarks page
当前为
- // ==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
- // ==/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);
- });
- })();