Facebook and Group Sort by CHRONOLOGICAL

Forces Facebook groups to sort posts by newest/chronological automatically

目前为 2025-03-07 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Facebook and Group Sort by CHRONOLOGICAL
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description Forces Facebook groups to sort posts by newest/chronological automatically
  6. // @author CHATgpt
  7. // @include *facebook.com*
  8. // @match *://*.facebook.com/*
  9. // @exclude *facebook.com/reel/*
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // Function to update sorting if not already set
  18. function updateSorting() {
  19. const url = new URL(window.location.href);
  20. if (!url.searchParams.has("sorting_setting")) {
  21. url.searchParams.set("sorting_setting", "CHRONOLOGICAL"); // change to RECENT_ACTIVITY if you want
  22. window.location.replace(url.href);
  23. }
  24. }
  25.  
  26. // Run once when the script loads
  27. updateSorting();
  28.  
  29. // Observe URL changes (Facebook uses dynamic navigation)
  30. let lastUrl = location.href;
  31. const observer = new MutationObserver(() => {
  32. if (location.href !== lastUrl) {
  33. lastUrl = location.href;
  34. updateSorting();
  35. }
  36. });
  37.  
  38. // Start observing changes to the page
  39. observer.observe(document, { subtree: true, childList: true });
  40. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址