Greasy Fork is available in English.

MCStacker Button Fix

Make MCStacker buttons work like how they should 2/1/2025

// ==UserScript==
// @name        MCStacker Button Fix
// @namespace   MCStacker
// @match       https://mcstacker.net/*
// @grant       none
// @version     1.1
// @author      RedStrider
// @description Make MCStacker buttons work like how they should 2/1/2025
// @grant        GM_addStyle
// @license MIT
// ==/UserScript==

(function() {
  'use strict';
// the color gets messed up so this is a fix
   GM_addStyle(`
a:visited.mainButtons {
  color: var(--main-button-text-color);
}
a:visited:hover.mainButtons {
  color: var(--main-button-text-hover-color);
}
    `);

  const urlParams = new URLSearchParams(window.location.search);
  const command = urlParams.get('command');
  if(command){
    javascript:loadForm(command)
  }
  
  let links = document.querySelectorAll('a.mainButtons');
  links.forEach(link => {
    if(link.href.startsWith("javascript:loadForm")){
      let answer = link.href.match(/loadForm\('([^']+)'\)/);
      link.href = "?command=" + answer[1];
    }
  });
})();