Last active
August 8, 2024 05:07
-
-
Save e-t-l/46eb62521ffbeec349bf70f1e0f68adf to your computer and use it in GitHub Desktop.
Force-Chrono-Groups
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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
https://gist.github.com/e-t-l/46eb62521ffbeec349bf70f1e0f68adf.js