您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Appends ?sorting_setting=CHRONOLOGICAL to every Facebook URL change and refreshes the page.
// ==UserScript== // @name Facebook: Force Chronological Feed // @namespace http://tampermonkey.net/ // @version 1.0 // @description Appends ?sorting_setting=CHRONOLOGICAL to every Facebook URL change and refreshes the page. // @author ChatGPT // @license MIT // @match *://*.facebook.com/* // @run-at document-idle // ==/UserScript== (function() { 'use strict'; // Helper function to append ?sorting_setting=CHRONOLOGICAL and refresh the page function appendSortingSettingAndRefresh() { const url = new URL(window.location.href); // Only add sorting_setting=CHRONOLOGICAL if it is not already present if (!url.searchParams.has('sorting_setting')) { url.searchParams.set('sorting_setting', 'CHRONOLOGICAL'); window.history.replaceState({}, '', url.href); // Update the URL without reloading the page location.reload(); // Refresh the page to apply the updated URL } } // Observe URL changes in Facebook's Single Page Application function observeUrlChanges() { let previousUrl = window.location.href; const observer = new MutationObserver(() => { if (window.location.href !== previousUrl) { previousUrl = window.location.href; appendSortingSettingAndRefresh(); // Append the parameter and refresh when the URL changes } }); // Start observing changes to the <body> element observer.observe(document.body, { childList: true, subtree: true }); } // Initialize the script function initialize() { appendSortingSettingAndRefresh(); // Apply the parameter and refresh on initial page load observeUrlChanges(); // Handle dynamic URL changes } // Run the script initialize(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址