Neopets Quick Quests

Open specific Neopets pages by right-clicking on quest descriptions or task descriptions.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Neopets Quick Quests
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  Open specific Neopets pages by right-clicking on quest descriptions or task descriptions.
// @author       BandanaWaddleDee24
// @match        *://www.neopets.com/*
// @grant        none
// @license MIT

// ==/UserScript==

(function () {
    'use strict';

    document.addEventListener('contextmenu', (event) => {
        const target = event.target;

        if (!target || (!target.classList.contains('ql-quest-description') && !target.classList.contains('ql-task-description'))) {
            return;
        }

        let url = null;

        switch (target.textContent.trim()) {
            case 'Purchase Item(s)':
                url = 'https://www.neopets.com/generalstore.phtml?store_type=';
                break;
            case 'Spin the Wheel of Mediocrity':
                url = 'https://www.neopets.com/prehistoric/mediocrity.phtml';
                break;
            case 'Spin the Wheel of Excitement':
                url = 'https://www.neopets.com/faerieland/wheel.phtml';
                break;
            case 'Spin the Wheel of Knowledge':
                url = 'https://www.neopets.com/medieval/knowledge.phtml';
                break;
            case 'Spin the Wheel of Monotony':
                url = 'https://www.neopets.com/prehistoric/monotony.phtml';
                break;
            case 'Spin the Wheel of Misfortune':
                url = 'https://www.neopets.com/halloween/wheel/index.phtml';
                break;
            case 'Customise your Neopet':
                url = 'https://www.neopets.com/customise/?view=BlueowPenguin';
                break;
            case 'Play a game':
                url = 'https://www.neopets.com/games/h5game.phtml?game_id=1391';
                break;
            case 'Feed a Pet':
            case 'Feed your Neopet':
            case 'Groom a Pet':
                url = 'https://www.neopets.com/home/';
                break;
        }

        if (url) {
            event.preventDefault(); 
            window.open(url, '_blank');
        }
    });
})();