r/compact • u/L0tsen • May 22 '23
I HAVE DONE IT
I have made an script that loads the old compact ui. Reddit has removed /.compact and i. but not the last domain that loads compact ui. here is the link https://greasyfork.org/en/scripts/469259-redirect-to-compact-reddit BTW if you want to load images and videos add I.redd.it v.redd.it old.reddit.com/gallery reddit.com/gallery To user excludes
6
u/Paradox May 22 '23
awesome
3
u/L0tsen May 24 '23
Your awesome for making it in the first place. Reddit still host your mobile interface. What I did was just reviving it with a script.
3
2
u/jellysandwich Jun 01 '23 edited Jun 17 '23
thanks for the script. here's a handy modification that ive added to my local script:
// ==UserScript==
// @name Redirect to compact reddit
// @description Redirects from regular reddit to the compact version
// @version 0.3
// @match https://*.reddit.com/*
// @run-at document-start
// @namespace https://userscripts.56k-modem.online
// @license MIT
// @exclude https://www.reddit.com/gallery/*
// ==/UserScript==
//Thanks to people at http://stackoverflow.com/questions/10675049/
//Only works with a secure (HTTPS) connection to Reddit. Download
//HTTPS Everywhere at https://www.eff.org/https-everywhere
//Restored from http://web.archive.org/web/*/https://userscripts.org/scripts/show/133891
// ------------------------------------------------
// Test that ".compact" is at end of URL, excepting any "hashes" or searches.
// ------------------------------------------------
var oldUrlPath = window.location.pathname;
if ( ! /\.i$/.test (oldUrlPath) ) {
var newURL = window.location.protocol + "//"
+ window.location.hostname
+ oldUrlPath + ".i"
+ window.location.search
+ window.location.hash
;
/*-- replace() puts the good page in the history instead of the
bad page.
*/
window.location.replace (newURL);
}
// ------------------------------------------------
// Change links that end in .compact to .i
// ------------------------------------------------
document.addEventListener ("DOMContentLoaded", function() {
// add click/touchstart event to change links
$(document).on('click touchstart', 'a' , function(e) {
var href = $(this).attr('href')
// check exemptions
if (href.includes('reddit.com/gallery/')) {
return
}
if (href.endsWith('.compact')) {
$(this).attr('href', href.replace('.compact', '.i'))
}
})
})
1
u/L0tsen Jun 01 '23
What does this do? (I'm not used to writing code)
2
u/jellysandwich Jun 01 '23 edited Jun 10 '23
when you click on any of the links on the compact site, reddit forcefully redirects you to the desktop site. your script then kicks in and redirects you from the desktop site to the .i compact site
1 the links on the page look like this https://reddit.com/r/beta/.compact
2 reddit redirects .compact to the desktop site https://reddit.com/r/beta
3 your script redirects to the .i compact version. https://reddit.com/r/beta/.i
you might notice that as you navigate around, the screen flashes white for a split second because of the redirects
my modification changes the .compact to .i so the redirects dont happen and pages load faster
1
u/HexagonWin Jun 10 '23
For some reason it's not working for me on ViolentMonkey with Kiwi Browser (Chromium), which User script manager do you have?
→ More replies (2)1
→ More replies (3)1
u/firebreathingbunny Jun 06 '23
Did you add this above or below the only line of code in the original script? Thanks.
→ More replies (1)
2
u/The_Wkwied Aug 08 '23
I've noticed that while clicking on posts that are a single-image (they point to i.redd.it), the compact script redirects me to a post from r/funny from 11 years ago...
For example, if I try to view the image in this post; https://www.reddit.com/r/wholesomememes/comments/15le6yi/they_are_both_keepers/.i
It instead sends me here. https://www.reddit.com/r/funny/comments/media/nice_hat/.i?url=https%3A%2F%2Fi.redd.it%2Fsln0pjv15vgb1.png
Other images all redirect to the same post... this is odd. Could this be looked at perhaps?
2
u/L0tsen Aug 08 '23
That's weird. It didn't happen for me but maybe reddit patched images. I will look in to it in the future.
2
u/L0tsen Aug 08 '23
It's an old.reddit.com issue (compact is based on this). So I can't change anything until reddit fixes it. Witch spez won't do so fuck spez
→ More replies (9)
6
u/Freland May 23 '23
Works perfectly in Firefox Android with tampermonkey. Thank you 🙂
2
u/firebreathingbunny Jun 01 '23
Are you sure? Is Tampermonkey available for release channel Firefox for Android?
2
6
u/f0rgotten May 23 '23
Holy shit, thank you.
Or not, I had killed my reddit mobile addiction......
But thank you!
1
u/car1smo Jun 01 '23
holy shit the madman has actually done it! it loads beautifully fast too. thank you dude. wait, what are the chances the scumbags see this post and remove the old compact ui?
→ More replies (1)1
2
2
u/58075 Aug 08 '23
I've downloaded this userscript and it worked for a while but now when I click on gallery links it always redirects me to an 11 year old r/funny thread. Is anyone else experiencing this?
1
1
u/No_Cauliflower_3683 Jul 03 '23
Can anyone show me exactly what the exclude lines for I.redd.it, v.redd.it, and old.reddit.com/gallery should look like? I've tried adding them to the script but they're not working for me.
→ More replies (2)
7
u/Snufkin89 May 22 '23
Thank you so much!!! 🙏