Old Reddit button

Provides a button to go to the same page on old.reddit when accidentally ending up on new Reddit.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Old Reddit button
// @version      1.0
// @description  Provides a button to go to the same page on old.reddit when accidentally ending up on new Reddit.
// @author       Phoenix
// @include      https://*.reddit.com/*
// @exclude	     https://old.reddit.com/*
// @grant        none
// @license      MIT
// @namespace https://greasyfork.org/users/952476
// ==/UserScript==

(function() {
  'use strict';
  var node;
  node = document.createElement("DIV");
  node.style = `
  	    display: flex;
		justify-content: center;
		align-items: center;
		position: fixed;
		top: 9px;
		left: 135px;
		width: 160px;
		height: 30px;
		background-color: red;
		border-radius: 15px;
		z-index: 1000;
		cursor:pointer;
		color: #fff;
		font-weight: bold;`;
  node.textContent = "Switch to old.reddit";
  node.addEventListener("click", function() {location.href = location.href.replace('https://www.','https://old.').replace('https://new.','https://old.'); });
  document.body.appendChild(node);
})();