Greasy Fork

Greasy Fork is available in English.

Fimfiction - Group Button Shows Recent Threads

Changes the Group button to default to the Recent Threads page.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Fimfiction - Group Button Shows Recent Threads
// @namespace    arcum42
// @version      0.2
// @description  Changes the Group button to default to the Recent Threads page.
// @author       arcum42
// @match        https://www.fimfiction.net/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    
    // Text plus group icon
    var allGroupsText = `<i class="fa fa-group"></i>All Groups`;

    // Grab the first match for all of the following buttons with css.
    var mainGroup = document.querySelector(".user_toolbar a[href='/groups']");
    var groupThreads = document.querySelector(".user_toolbar a[href='/groups/threads']");
    var groupDiv = document.querySelector(".user_toolbar li.divider");

    // Swap the urls for the buttons in question.
    mainGroup.href = "/groups/threads";
    groupThreads.href = "/groups";

    // Remove the divider to make it look nicer, and rename "Recent Threads" to "All Groups" with an appropriate icon.
    groupDiv.remove();
    groupThreads.innerHTML = allGroupsText;

})();