Last active
April 15, 2025 10:07
-
-
Save SkyyySi/ef58fad341d6593b4404cf7d3ce114a2 to your computer and use it in GitHub Desktop.
A small userscript for automatically redirecting to the original english version whenever Reddit auto-translates a post
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 Reddit AI-translation disabler | |
// @namespace github.com/SkyyySi | |
// @match *://reddit.com/* | |
// @match *://www.reddit.com/* | |
// @grant none | |
// @version 1.0.0 | |
// @author SkyyySi | |
// @description Automatically redirect to the original english version whenever Reddit auto-translates a post | |
// @license 0BSD; https://opensource.org/license/0bsd | |
// @homepageURL https://gist.github.com/SkyyySi/ef58fad341d6593b4404cf7d3ce114a2 | |
// @supportURL https://gist.github.com/SkyyySi/ef58fad341d6593b4404cf7d3ce114a2 | |
// @installURL https://gist.githubusercontent.com/SkyyySi/ef58fad341d6593b4404cf7d3ce114a2/raw/redditAiTranslationDisabler.user.js | |
// @downloadURL https://gist.githubusercontent.com/SkyyySi/ef58fad341d6593b4404cf7d3ce114a2/raw/redditAiTranslationDisabler.user.js | |
// @updateURL https://gist.githubusercontent.com/SkyyySi/ef58fad341d6593b4404cf7d3ce114a2/raw/redditAiTranslationDisabler.user.js | |
// @run-at document-start | |
// ==/UserScript== | |
//////////////////////////////////////////////////////////////////////////////// | |
((async () => { | |
// Parse the current page URL. `document.URL` is only a string, while | |
// `document.location` | |
const url = new URL(document.URL); | |
// Check if the URL contains a suffix like "?tl=de", and if not, we don't | |
// need to do anything. | |
if (!url.searchParams.has("tl")) { | |
return; | |
} | |
// Translations are on - burn them with fire! | |
url.searchParams.delete("tl"); | |
document.location.search = url.search; | |
})()); | |
//////////////////////////////////////////////////////////////////////////////// | |
// Zero-Clause BSD | |
// =============== | |
// | |
// Permission to use, copy, modify, and/or distribute this software for | |
// any purpose with or without fee is hereby granted. | |
// | |
// THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL | |
// WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES | |
// OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE | |
// FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY | |
// DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN | |
// AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT | |
// OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment