Facebook - Force Most Recent

Always set news feed to 'Most Recent'.

当前为 2018-12-26 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Facebook - Force Most Recent
  3. // @namespace https://greasyfork.org/users/222319
  4. // @version 1.0.1
  5. // @date 2018-12-24
  6. // @description Always set news feed to 'Most Recent'.
  7. // @author Explisam <explisam@gmail.com>
  8. // @compatible chrome
  9. // @compatible firefox
  10. // @compatible opera
  11. // @compatible safari
  12. // @license MIT License <https://opensource.org/licenses/MIT>
  13. // @include *www.facebook.com
  14. // @include *www.facebook.com/
  15. // @include *www.facebook.com/?*
  16. // @run-at document-start
  17. // ==/UserScript==
  18.  
  19. (function() {
  20. 'use strict';
  21. var url_string = window.location.href;
  22. var url = new URL(url_string);
  23. var sk = url.searchParams.get("sk");
  24. var p = /(?<=\?).*/.exec(url_string);
  25.  
  26. if (sk !== "h_chr") {
  27. var recover = p ? "&" + p : "";
  28. window.location.replace("https://www.facebook.com/?sk=h_chr" + recover);
  29. }
  30. })();