Reddit - fix "new"

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

目前為 2024-07-15 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
Achernar
評價
0 0 0
版本
0.6.6
建立日期
2024-05-02
更新日期
2024-07-15
尺寸
38.4 KB
授權條款
未知
腳本執行於
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()}})()