Skip to content

Userscripts in Browsers

// ==UserScript==
// @name Reddit Redirect to Old Subdomain
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Redirects www.reddit.com to old.reddit.com while keeping the rest of the URL
// @author You
// @match *://www.reddit.com/*
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
'use strict';
const currentUrl = location.href;
const hostname = location.hostname;
// Check if the hostname is www.reddit.com
if (hostname === "www.reddit.com") {
// Exclude URLs that start with www.reddit.com/media?url=
// These are Reddit's internal image/media viewer URLs that should not be redirected to old.reddit.com
if (!currentUrl.startsWith("https://www.reddit.com/media?url=")) {
location.replace(currentUrl.replace("www.reddit.com", "old.reddit.com"));
}
}
})();
// ==UserScript==
// @name google.com - Decline cookies
// @namespace Violentmonkey Scripts
// @match https://consent.google.com/m
// @grant none
// @version 1.0
// @author -
// @description -
// ==/UserScript==
//
const results = Array.from(document.querySelectorAll('span'))
.find(el => el.textContent === 'Alles afwijzen').click()
// Thanks to https://stackoverflow.com/a/45869942