Facebook - Force Most Recent

Always set news feed to 'Most Recent'.

目前為 2018-12-26 提交的版本,檢視 最新版本

// ==UserScript==
// @name        Facebook - Force Most Recent
// @namespace   https://greasyfork.org/users/222319
// @version     1.0.1
// @date        2018-12-24
// @description Always set news feed to 'Most Recent'.
// @author      Explisam <[email protected]>
// @compatible  chrome
// @compatible  firefox
// @compatible  opera
// @compatible  safari
// @license     MIT License <https://opensource.org/licenses/MIT>
// @include     *www.facebook.com
// @include     *www.facebook.com/
// @include     *www.facebook.com/?*
// @run-at      document-start
// ==/UserScript==

(function() {
    'use strict';
    var url_string = window.location.href;
    var url = new URL(url_string);
    var sk = url.searchParams.get("sk");
    var p = /(?<=\?).*/.exec(url_string);

    if (sk !== "h_chr") {
        var recover = p ? "&" + p : "";
        window.location.replace("https://www.facebook.com/?sk=h_chr" + recover);
    }
})();