Skip to content

Instantly share code, notes, and snippets.

@e-t-l
Last active February 7, 2024 23:00
Show Gist options
  • Save e-t-l/46eb62521ffbeec349bf70f1e0f68adf to your computer and use it in GitHub Desktop.
Save e-t-l/46eb62521ffbeec349bf70f1e0f68adf to your computer and use it in GitHub Desktop.
Force-Chrono-Groups
// ==UserScript==
// @name Chrono-Sort-Groups
// @namespace e-t-l
// @homepage https://gist.github.com/e-t-l/46eb62521ffbeec349bf70f1e0f68adf
// @downloadURL https://gist.github.com/e-t-l/46eb62521ffbeec349bf70f1e0f68adf/raw/6b8bc048615daab230facb6283ebeb18b2914a4f/Force-Chrono-Group.user.js
// @match https://www.facebook.com/groups/*
// @match https://www.reddit.com/r/*
// @version 2.4
// @author e-t-l
// @license CC0-1.0
// ==/UserScript==
let mURL = window.location;
let mHref = mURL.href;
let mPath = mURL.pathname;
let mHost = mURL.hostname;
if ( mHost === "www.facebook.com" ) {
if ( !mHref.includes("sorting_setting") ) {
window.location = mHref.concat("?sorting_setting=CHRONOLOGICAL");
}
} else if ( mHost === "www.reddit.com" ) {
if ( mPath.split("/").length === 4 ) {
if ( mPath.substring(mPath.length-1) === "/" ) {
window.location = mHref.concat("new");
} else {
window.location = mHref.concat("/new");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment