1.7 - major rewrite, lets test
This commit is contained in:
parent
7e675e32c0
commit
c265da35f6
1 changed files with 15 additions and 5 deletions
|
@ -1,12 +1,13 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Use old new Reddit
|
// @name Use old new Reddit
|
||||||
// @namespace https://codeberg.org/okseby/newnewredditsucks
|
// @namespace https://codeberg.org/okseby/newnewredditsucks
|
||||||
// @version 1.6
|
// @version 1.7
|
||||||
// @description forward the ugly new reddit to the older new reddit
|
// @description forward the ugly new reddit to the older new reddit
|
||||||
// @author okseby
|
// @author okseby
|
||||||
// @match https://*.reddit.com/*
|
// @match https://www.reddit.com/*
|
||||||
// @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com
|
// @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com
|
||||||
// @grant none
|
// @grant none
|
||||||
|
// @run-at document-start
|
||||||
// @updateURL https://codeberg.org/okseby/newnewredditsucks/raw/branch/main/newnewredditsucks.user.js
|
// @updateURL https://codeberg.org/okseby/newnewredditsucks/raw/branch/main/newnewredditsucks.user.js
|
||||||
// @downloadURL https://codeberg.org/okseby/newnewredditsucks/raw/branch/main/newnewredditsucks.user.js
|
// @downloadURL https://codeberg.org/okseby/newnewredditsucks/raw/branch/main/newnewredditsucks.user.js
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
@ -14,7 +15,16 @@
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
if (window.location.hostname == 'www.reddit.com' && !window.location.hostname.includes('/media')) {
|
// if (window.location.hostname == 'www.reddit.com' && !window.location.hostname.includes('/media')) {
|
||||||
window.location.hostname = 'new.reddit.com';
|
// window.location.hostname = 'new.reddit.com';
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
// Get the current URL
|
||||||
|
const currentUrl = window.location.href;
|
||||||
|
|
||||||
|
// Replace www.reddit.com with new.reddit.com
|
||||||
|
const newUrl = currentUrl.replace('www.reddit.com', 'new.reddit.com');
|
||||||
|
|
||||||
|
// Redirect to the new URL
|
||||||
|
window.location.replace(newUrl);
|
||||||
})();
|
})();
|
Loading…
Add table
Add a link
Reference in a new issue