Open TsukiZero opened 8 months ago
I think it will most likely introduce an infinite loop.
In a userscript, AFAIK, best option to use for this case is // @run-at document-start
pragma, which is good for redirecting the HTML interface to the direct-image-url but upon loading that url — since the headers are set to NOT accept a direct image — it will get redirected back to the HTML interface once again; just like when you try to open the direct-image-url in a new tab.
Eidt: I don't think the more advanced GM_
options can give access to HTTP headers either. see this.
just for convenience for users that may need to patch it themselves if Reddit does something.
Here is my attempt: https://github.com/themojache/userscripts/blob/main/reddit-image-redirect.user.js.
Feel free to open an issue/PR for suggestions.
just for convenience for users that may need to patch it themselves if Reddit does something.