Greasy Fork 还支持 简体中文。

Fortunate Maps StraTAGy

Redirects to StraTAGy and runs handleJPEGImage function

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

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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         Fortunate Maps StraTAGy
// @namespace    Bambi
// @version      1.0
// @description  Redirects to StraTAGy and runs handleJPEGImage function
// @license      MIT
// @match        https://fortunatemaps.herokuapp.com/map/*
// @grant        none
// ==/UserScript==
(function() {
    'use strict';

    // Create a button element
    var button = document.createElement('button');
    button.innerHTML = 'Redirect to StraTAGy';

    // Add a click event listener to the button
    button.addEventListener('click', function() {
        // Extract the map code from the URL
        var mapUrl = window.location.href;
        var mapCode = mapUrl.substring(mapUrl.lastIndexOf('/') + 1);

        // Redirect to StraTAGy page and execute handleJPEGImage function
        window.location.href = 'https://bambitp.github.io/StraTAGy/?mapCode=' + encodeURIComponent(mapCode);
    });

    // Find the element on the Fortunate Maps page to append the button to
    var targetElement = document.querySelector('.btn-group.w-100');

    // Append the button to the target element
    if (targetElement) {
        targetElement.appendChild(button);
    }
})();