1.8 - fingers crossed, media fixed
This commit is contained in:
parent
c265da35f6
commit
5ad23deee2
1 changed files with 5 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
// ==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.7
|
// @version 1.8
|
||||||
// @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://www.reddit.com/*
|
// @match https://www.reddit.com/*
|
||||||
|
@ -15,13 +15,13 @@
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// if (window.location.hostname == 'www.reddit.com' && !window.location.hostname.includes('/media')) {
|
|
||||||
// window.location.hostname = 'new.reddit.com';
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Get the current URL
|
// Get the current URL
|
||||||
const currentUrl = window.location.href;
|
const currentUrl = window.location.href;
|
||||||
|
|
||||||
|
// Check if it's a media link
|
||||||
|
const mediaPattern = /\/media($|\?)/;
|
||||||
|
if (mediaPattern.test(currentUrl)) return; // Abort the redirect
|
||||||
|
|
||||||
// Replace www.reddit.com with new.reddit.com
|
// Replace www.reddit.com with new.reddit.com
|
||||||
const newUrl = currentUrl.replace('www.reddit.com', 'new.reddit.com');
|
const newUrl = currentUrl.replace('www.reddit.com', 'new.reddit.com');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue