mirror of
https://github.com/chev2/scripts-styles.git
synced 2026-04-27 05:01:41 +00:00
UserScript redirects: Use simpler domain replacement
location.hostname is a lot easier to use than replacing the domain in location.href
This commit is contained in:
parent
456bc8b095
commit
6ed3b1cd25
2 changed files with 4 additions and 4 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Redirect: New Reddit to Old Reddit
|
// @name Redirect: New Reddit to Old Reddit
|
||||||
// @author Chev <riskyrains@proton.me> (https://github.com/chev2)
|
// @author Chev <riskyrains@proton.me> (https://github.com/chev2)
|
||||||
// @version 1.0.0
|
// @version 1.0.1
|
||||||
// @description Redirects from new Reddit to old Reddit.
|
// @description Redirects from new Reddit to old Reddit.
|
||||||
// @namespace github.com/chev2
|
// @namespace github.com/chev2
|
||||||
// @license Apache-2.0
|
// @license Apache-2.0
|
||||||
|
|
@ -21,5 +21,5 @@
|
||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
location.replace(location.href.replace("www.reddit.com/", "old.reddit.com/"));
|
location.hostname = "old.reddit.com";
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Redirect: Twitter to Nitter
|
// @name Redirect: Twitter to Nitter
|
||||||
// @author Chev <riskyrains@proton.me> (https://github.com/chev2)
|
// @author Chev <riskyrains@proton.me> (https://github.com/chev2)
|
||||||
// @version 1.0.2
|
// @version 1.0.3
|
||||||
// @description Redirects from Twitter to Nitter, a Twitter alternative front-end.
|
// @description Redirects from Twitter to Nitter, a Twitter alternative front-end.
|
||||||
// @namespace github.com/chev2
|
// @namespace github.com/chev2
|
||||||
// @license Apache-2.0
|
// @license Apache-2.0
|
||||||
|
|
@ -23,5 +23,5 @@
|
||||||
|
|
||||||
// Put your instance domain here
|
// Put your instance domain here
|
||||||
const INSTANCE_DOMAIN = "nitter.nl"
|
const INSTANCE_DOMAIN = "nitter.nl"
|
||||||
location.replace(location.href.replace("twitter.com/", `${INSTANCE_DOMAIN}/`));
|
location.hostname = INSTANCE_DOMAIN;
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue