Greasy Fork

Greasy Fork is available in English.

MouseHunt - Show Adventure Book

Adds a button to show adventure book under kingdom dropdown

当前为 2021-02-10 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         MouseHunt - Show Adventure Book
// @author       Yigit "drocan" Sever
// @namespace    http://greasyfork.icu/en/users/223891-yi%C4%9Fit-sever
// @version      0.1
// @description  Adds a button to show adventure book under kingdom dropdown
// @match        http://www.mousehuntgame.com/*
// @match        https://www.mousehuntgame.com/*
// ==/UserScript==


function addButton() {

    const target = document.querySelector("li .forum");
    if (target) {
        const li = document.createElement("li");
        li.className = "show_adv_book";
        const button = document.createElement("a");
        button.href = "#";
        button.innerText = "Adventure Book";
        button.onclick = function () {
            hg.views.AdventureBookView.show();
        };
        const icon = document.createElement("div");
        icon.className = "icon";
        button.appendChild(icon);
        li.appendChild(button);
        target.insertAdjacentElement("afterend", li);
    }
}

$(document).ready(function() {
    //If current page is main camp or journal
    var pageTitle = document.title;
    if (pageTitle.includes("Hunter's Camp") || pageTitle.includes("Journal Page")) {
        addButton();
    }
});