Reverse Order of Quest in SMMO

Reverse the order of quests listed on the quests page in Simple MMO.

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 or Violentmonkey 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.

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

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

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

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

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

// ==UserScript==
// @name         Reverse Order of Quest in SMMO
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  Reverse the order of quests listed on the quests page in Simple MMO.
// @author       @dngda
// @match        https://web.simple-mmo.com/quests*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=simple-mmo.com
// @grant        none
// @license      GNU GPLv3
// ==/UserScript==

(function () {
    "use strict";

    function reverseChildren(parent) {
        for (var i = 1; i < parent.childNodes.length; i++) {
            parent.insertBefore(parent.childNodes[i], parent.firstChild);
        }
    }

    const rootObserver = new MutationObserver((mutations) => {
        for (const mutation of mutations) {
            for (const node of mutation.addedNodes) {
                if (
                    node.nodeType === Node.ELEMENT_NODE &&
                    node.matches(
                        "div[x-data='expedition'] > div.grid > div.relative > div > div"
                    )
                ) {
                    reverseChildren(node);
                }
            }
        }
    });

    rootObserver.observe(document.body, { childList: true, subtree: true });
})();