您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Redirects to StraTAGy and runs handleJPEGImage function
// ==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); } })();