Greasy Fork is available in English.

Reddit - fix "new"

Fix "new" reddit behaviour: long-lived page, internal links, moderator page

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
作者
Achernar
1日のインストール数
3
累計インストール数
28
評価
0 0 0
バージョン
0.5
作成日
2024/05/02
更新日
2024/06/21
ライセンス
不明
対象サイト
Update 2024/06/18: Reddit has now enabled "long-lived page" everywhere. Hence, the update today disables "Trigger LLP" if it is enabled. It will be disabled by default for new installations.
FIX: Also, the loading sign is now correctly hidden. (bug mostly in FF) You can try it again. It should work correctly (hopefully).



Some of you are still using "new.reddit" instead of "www.reddit", or have left it with regrets. Here is a userscript to fix its behavior and other things broken when it was replaced by "sh" on "www".

I still dislike "sh" with its bugs and shortcomings. (lacks of some infos, functions, ...).

On "new" the long-lived page behavior has been broken. Posting or replying triggers it, The userscript uses this trick.

The userscript also fixes the remaining links to "www". It fixes the notifications as well as (driven by options, some enabled) the page interface, the "www" links in posts/comments, and the "old" links in posts/comments (off by default).

(Moderation tool) - It fixes links in Modmail (on by default) too.
(Moderation tool) - It restores (option on by default) the previous "Mod Log" link in the left menu of the mod page (to continue to use the long-lived page behavior for it too). By default it leaves the menu item to the new "sh."version (can be hidden by an option).

The userscript options dialog can be triggered from Tampermonkey toolbar icon: "Settings" menu item attached to the userscript name. This menu item is available on "new.", "www." and modmail pages. (not on "old.")

The dialog can also be triggered in the user menu on "new.", by clicking the "double eyes" icon (labelled "View Options").

Note: the LLP trick triggers the display of the new post form. You can hide the visual effect by setting an option.


Here are bookmarklets that can be useful to go from one site to another. Create a bookmark and paste the following code in the URL part (starting with "javascript:...").

  • switch to "new":
    javascript:(function(){if (location.host.endsWith('.reddit.com') && (location.host !='new.reddit.com') ) location.host='new.reddit.com';})()

  • switch to "old":
    javascript:(function(){if (location.host.endsWith('.reddit.com') && (location.host !='old.reddit.com') ) location.host='old.reddit.com';})()

  • switch to "sh":
    javascript:(function(){if (location.host.endsWith('.reddit.com') && (location.host !='sh.reddit.com') ) location.host='sh.reddit.com';})()

  • switch to "www" (different method which works when this userscript is running):
    javascript:(function(){if (location.host.endsWith('.reddit.com') && (location.host !='www.reddit.com') ) {var a=document.createElement('a'); a.href=location.href.replace(/^(.*?reddit.com)/, 'https://www.reddit.com' ); a.rel='noreferrer'; a.click()}})()