您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Forces Facebook groups to sort posts by "Recent Activity" automatically
当前为
- // ==UserScript==
- // @name Facebook Group Sort by Recent
- // @namespace http://tampermonkey.net/
- // @version 1.1
- // @description Forces Facebook groups to sort posts by "Recent Activity" automatically
- // @author CHATgpt
- // @match *://*.facebook.com/*
- // @grant none
- // @license MIT
- // ==/UserScript==
- (function() {
- 'use strict';
- // Function to update sorting if not already set
- function updateSorting() {
- const url = new URL(window.location.href);
- if (!url.searchParams.has("sorting_setting")) {
- url.searchParams.set("sorting_setting", "RECENT_ACTIVITY");
- window.location.replace(url.href);
- }
- }
- // Run once when the script loads
- updateSorting();
- // Observe URL changes (Facebook uses dynamic navigation)
- let lastUrl = location.href;
- const observer = new MutationObserver(() => {
- if (location.href !== lastUrl) {
- lastUrl = location.href;
- updateSorting();
- }
- });
- // Start observing changes to the page
- observer.observe(document, { subtree: true, childList: true });
- })();