Greasy Fork 还支持 简体中文。

Reddit - fix "new"

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

اعتبارا من 26-06-2024. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

المؤلف
Achernar
التقييمات
0 0 0
الإصدار
0.6.1
تم إنشاؤه
02-05-2024
تم تحديثه
26-06-2024
الحجم
36.9 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()}})()