Skip to content

Instantly share code, notes, and snippets.

@heavyLobster2
Last active May 18, 2019 20:10
Show Gist options
  • Save heavyLobster2/77c55e7574af635dc0df359199b231c7 to your computer and use it in GitHub Desktop.
Save heavyLobster2/77c55e7574af635dc0df359199b231c7 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Redirect Tumblr Safe Mode
// @description Redirects Tumblr safe mode blogs to Tumbex
// @version 1.0.0
// @author heavyLobster2
// @namespace github.com/heavyLobster2
// @downloadURL https://gist.github.com/heavyLobster2/77c55e7574af635dc0df359199b231c7/raw/RedirectTumblrSafeMode.user.js
// @match *://*.tumblr.com/safe-mode?*
// @run-at document-start
// @grant none
// ==/UserScript==
(function () {
"use strict";
var originalUrlString = (new URL(window.location.href)).searchParams.get("url");
if (originalUrlString && originalUrlString.length > 0) {
var blogName = (new URL(originalUrlString)).hostname.split(".")[0];
window.location.replace("https://www.tumbex.com/" + blogName + ".tumblr");
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment