Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Imgpls – An extension to load Imgur images directly (andadinosaur.com)
144 points by goranmoomin on Aug 19, 2024 | hide | past | favorite | 73 comments


It's pretty amazing imgur has lasted this long. Free image hosts usually have a limited lifespan.


Indeed, I thought reddit self-hosting images would be its death for this reason: it's just a moneysink. But it seems to be going well.

Perhaps the rest of the site's traffic is subsidizing what they spend on the image hosting? Or maybe bandwidth and storage costs are finally lower than how much each image costs, given that our eyes haven't gotten any better and so a certain size jpeg is simply good enough?


Imgur is a popular social media site in its own right


I imagine deleting all the porn certainly helped


But it hasn't, while it had a good run, it stopped being an image host in 2023 :

https://wiki.archiveteam.org/index.php/Imgur

(With screws tightened even more in 2024.)

Before you reply that you technically still can use Imgur, that's also still the case for Imageshack - but you cannot rely on them any more, unless you are a paid user.


Same would be nice for i.redd.it


I am using a chrome extension that modifies headers[1]. It modifies headers for reddit images.

I have these rules defined inside

    url:https://preview.redd.it/, domain:true, sub:true, header:Accept, add:true, modify:false, remove:false, header_value:image/*
    url:https://i.redd.it/, domain:true, sub:true, header:Accept, add:true, modify:false, remove:false, header_value:image/*

With these defined, an image just opens like an image, without any reddit wrapped around it.

[1] https://chromewebstore.google.com/detail/modify-header-value...


Thanks for this. I just threw your comment on Llama and asked for a userscript that would also be compatible with old reddit. It gave me this https://pastebin.com/0d7mhcBu and it's been working fine. I can now middle/right click an image and open it fully in a new tab instead of that new webpage.


I believe I'm using this add-on in Firefox:

https://addons.mozilla.org/en-US/firefox/addon/load-reddit-i...

Though, given that I think the solution to this can be generalized, I think it is about time someone made a more general extension that can apply this across a wide variety of sites that misuse the `Accept` header for unwanted behavior.

(Also, since mangling the Accept header is the best way to avoid unwanted WebP/AVIF/HEIC transcodes without fully disabling support for these better image formats, it'd be nice if that was also rolled into such an extension.)


Shame that the extension doesn't seem to be compatible with Firefox on Android, since Reddit's mobile site is borderline unusable for displaying images, doubly so if you want to zoom/scroll them.


FWIW, even though it is annoying as hell, you may override the extension compatibility on Firefox for Android.

https://blog.mozilla.org/addons/2020/09/29/expanded-extensio...

This suggests it only works in Nightly, but it also works in Fennec F-Droid, so frankly you should consider switching to that if you can. (I wish Fennec F-Droid could just allow arbitrary extensions and extension side-loading, but I guess it would be non-trivial. Thanks Mozilla!)


Ohhh I didn't know that, thanks!


> that misuse the `Accept` header for unwanted behavior

Is there any other "misuse" to be aware of apart from just serving formats you don't prefer?


Yes, this is exactly what Imgur and Reddit are doing. They're serving you an HTML page that requires JavaScript, riddled with ads, when you intended to link to an image file. This happens because when the user agent navigates to a URL, it prefers text/html over other formats, so it's possible to distinguish it from an <img> fetch. This is a feature, but I do take the stance that it is a misuse of the feature as it is done on Reddit and Imgur, just the same as how abusing the window.open API for popup ads was (and how, in that era, it was relatively promptly taken care of by user agents, back when the word "user" in user agent meant anything.)

I didn't at any point call serving formats I "don't prefer" (I do prefer AVIF) "abuse" of the Accept header. I just don't want images that were JPEGs to be transcoded to even lossier WebP/AVIF/HEIC files when I browse to them. Sure, if it's part of the page layout it's not a big deal, but when I'm viewing the original size image, it should be, ideally, the original image. I don't actually care if the image is WebP/AVIF/HEIC natively, that is not a problem.


I feel like at this point, browsers should at least not prefer text/html if "open image in new tab" or similar is used.


Or if the path ends in a known binary file extension.


This won't work if implemented browser-wide as malicious website will just adjust the URLs for their images to compensate. In general, URL file extension snooping only causes more problems than it solves.


Maybe. It seems sensible to me that if the UA is requesting a path that ends in .jpg (for instance), they're expecting a JPEG and the UA should accept image/jpeg. At least if this escalates the arms race, user-hostile websites won't commit this specific crime, instead they'll serve content that better matches the URL.


> This happens because when the user agent navigates to a URL, it prefers text/html over other formats, so it's possible to distinguish it from an <img> fetch. This is a feature

Is it though? What non user-hostile things does it enable?


I think you're thinking about this slightly backwards. What else would you expect the browser to do, given a URL and no other context? Would it not ... prefer text/html? It's a hypertext browser, it prefers hypertext.

For many, many years, content negotiation was not adversarial, and there was little reason to believe it ever would be. Until it was, of course.

So how do we fix it, telling every page view we'd prefer if it were a JPEG? Probably not. Of course, you could make "Open Image in New Tab" do some magic to ensure that it acts like an image fetch: that sounds like a good idea.

> What non user-hostile things does it enable?

Content negotiation in general is pretty good. In theory, it lets a web server pick the best possible format that is supported by your client. For example, it would be possible for the server to transparently serve you a JPEG XL-compressed JPEG if your browser supports it, or fall back to the original (identical but larger) JPEG image if it does not.

Is there a good reason to prefer text/html? I know this will be unpopular but I believe that "upgrading" GIF links to WebMs in <video> tags is not user hostile in and of itself. GIF89a is a pretty antiquated format and LZW compression of 8bpc frame deltas is not exactly state of the art anymore; the difference between a GIF and a WebM of the same thing is usually multiple megabytes of bandwidth, and that can be extremely annoying, especially on mobile clients. Of course if you make it hard to access the original file, this will reasonably irritate people, but I think broadly the idea behind it is reasonable.

Being able to distinguish a navigation fetch from an <img> fetch is actually good because it would let the server behave in a more user-friendly fashion on the navigation fetch, for example by serving only formats that would be most likely to be useful to the user. Unfortunately, we can't have nice things, so it seems like some day content negotiation will have to be partly gimped.


Oh, now I see! It was a sincere question; was not aware of this practice and yes, I would call that misuse as well.


I honestly did assume it was a sincere question, but I will admit I was rubbed a bit the wrong way about "serving formats you don't prefer" because I was trying to word my original comment carefully enough to avoid that implication.

Internet commenting has definitely taught me many times that it is actually really hard to convey what you're thinking accurately.


I think you are looking for Sink it for reddit! I have been using it for a while and it works wonderfully

https://apps.apple.com/it/app/sink-it-for-reddit/id644987363...


Nice to see my creation out in the wild. Happy to listen to any feature requests! :)


Any way to change the text font size on the reddit site? This is something even the native app doesn't handle very well.


Figured out if I change the font size in browser controls before I create shortcut on home screen then font size remains as set


For iOS you can most likely just get something working with Redirect Web, which from my understanding this app is effectively doing the same thing of redirecting links.


Sending different Accept headers for <img> and direct requests was a mistake.


Does this mean it’s possible to make a safari extension to automatically take you to old.reddit.com whenever you hit a reddit link?



Just FYI, it's out on Chrome, Firefox and Edge too in addition to MacOS and iPadOS. Links on the site gosinkit[dot]com Disclaimer - I made this.


It is possible. There has been one on Chrome for years I use every day: https://chromewebstore.google.com/detail/old-reddit-redirect...


Just a quick heads up. I missed some DMs on Reddit because I have a FF extension to automatically redirect me to old.reddit.com because the notification indicator at the top wasn't lit.


I discovered the same thing, but when I saw the DMs I missed over the years I was glad to have missed them. They were all scammy.


I have been doing this using iOS Shortcuts and a regex for years. Except instead of old I redirect to a redlib instance.


StopTheMadness free iOS browser extension can redirect arbitrary URLs based on regex.


StopTheMadness didn’t fit my needs iirc. I have heard “Redirect Web for Safari” is a decent alternative solution though, have yet to try it


At least it has worked reliably for old.reddit and yt->invidious.


There's also alternative frontends like Rimgo : https://codeberg.org/rimgo/rimgo Then you can use LibRedirect to redirect all imgur urls to a more friendly frontend. (Now there's the issue of imgur aggressive block of datacenter/vpn IPs but it's another story)


LibRedirect is nice, but it often redirects to rate-limited instances. Why is this not checked before redirecting me.


Could pull directly from the Internet Archive if the object exists?


IMO we shouldn't rely on TIA to deliver content because the original source is really bad. They have limited resources and are already being abused by lazy devs, moreover the picture you will get might have been modified to be something else on the archive.


The user you’re replying to asked how to solve a practical problem and you responded with philosophy.

While I don’t disagree with what you said in principle, being able to fall-back to TIA for removed/deleted images would probably solve the issue 95% of the time.


Are we talking about removed/deleted images? My impression was that the suggestion was to use TIA to circumvent imgur's rate limit. Which is an application I find very questionable.

> The user you’re replying to asked how to solve a practical problem and you responded with philosophy.

If you never apply your morals you may as well not have them. Not to mention that overusing a free resource might cause it to be restricted in the future


Last I checked, HN isn’t OPs personal army, as it were. I’m sure that the replier is aware of what was being asked, and what they were responding with. To suggest otherwise is condescending.

This is a social network. This sort of conversion is not just allowed, but encouraged. Perhaps you’d feel more at home on a Stack Exchange website, where like-minded individuals will stand alongside you in enforcing a strict Q&A format, even when it doesn’t make sense to.


Please make a Giphy version!!!


I love this idea for an extension and have wanted something to do exactly this, but it doesn’t seem to work for me. I checked the enablement and the permissions, but the imgur test image link still loads the full page.


Yeah, it's not working for me too in Safari iPhone, if someone figures it out please reply.


What's different from Imagus, that works on 90% of the sites I visit?


Imagus (atleast how I've used it) just pops up an image if you hover on it. Imagus removes the extra crap when showing you the pop up.

This seems to be if you are given a link to an "image" it displays only the image and not the extra crap.


Are you able to use imagus on the phone? I love imagus too, but the images in this app seem to convey that this is meant for opening imgur links on mobile.


Imagus (never heard of it before) is apparently not on Safari while this one is only for Safari.


Sounds like an app, not an extension. This would be nice to have in Firefox... and for Tumblr images, too.


It’s an app because that’s the only way to distribute iOS safari extensions


Ah, I didn't know that.


App: https://f-droid.org/en/packages/com.ensoft.imgurviewer/

Not a perfect experience but easily preferable over the original webpage and works for more than just imgur


It's a shame that we are getting to a place to have an extension for each site to avoid dark patterns. May be just all in one extension just like Greasemonkey.


> May be just all in one extension

StopTheMadness is kind of that.

https://underpassapp.com/StopTheMadness/


It's unfortunate bordering on ironic that both of these are available only through the App Store.


all safari extensions are app store only


I'm aware. And the App Store is a prime example of the corporate culture causing the problems these extensions mitigate.


We should just have custom clients for every website. Just simple HTTP clients that talk to the remote servers directly and pulls and displays the data we want.


Dark patterns like trying to make money? Most people seem to agree that hotlinking is bad, but that's pretty much was imgur has exclusively been used for since its inception.


> Most people seem to agree that hotlinking is bad

Not at all.

> but that's pretty much was imgur has exclusively been used for since its inception

It's what imgur was built for and how it attracted users in the first place.


I disagree a lot with both the things you said. What arguments are there in favor of stealing bandwidth?

I think you're right that initially Imgur was happy to host images for reddit if it drove traffic to their homepage. They don't then "owe" their users who have paid a total of $0 to keep doing that forever if it stops being profitable to them.


Meanwhile, my entry in the Header Editor extension:

accept image_imgur

Match type: Domain

Match rules: i.imgur.com

Execute type: normal

Header name: accept

Header value: image/avif,image/jxl,image/webp,/;q=0.8

I have a very similar one for i.reddit.com

Together with Redirector, those might be the two most undervalued extensions I'm using.



Yes, that's what I'm using.


It's still wild to me how "closed" iOS got browser extensions before Chrome on Android.


because the most popular extension would be an adblocker


it's arguably harder to make an extension system when you can't write your own broswer and you'd have no way to distribute them either because the platform dictator doesn't allow it

https://support.mozilla.org/en-US/kb/add-ons-firefox-ios


Shouldn't this have been a firefox mobile extension?


As per the page, the author made it to fix a personal annoyance. It makes sense they made it work for whatever browser they use.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: