您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Directly downloads the latest mod from re146's website, report bugs to Discord @EmmetPotet
当前为
- // ==UserScript==
- // @name Emmet's Direct Factorio Mods Downloader 2024
- // @namespace https://re146.dev/
- // @version 1.2
- // @description Directly downloads the latest mod from re146's website, report bugs to Discord @EmmetPotet
- // @author Discord @EmmetPotet
- // @match https://mods.factorio.com/mod/*
- // @icon https://www.google.com/s2/favicons?sz=64&domain=re146.dev/factorio/mods
- // @grant none
- // @license MIT
- // ==/UserScript==
- (async function() {
- 'use strict';
- const modUrlMatch = location.href.match(/^https:\/\/mods\.factorio\.com\/mod\/([^\/]+)/);
- if (!modUrlMatch) return;
- const modName = modUrlMatch[1];
- const buttonWrapper = document.getElementsByClassName('button-green text-center');
- const button = document.getElementsByClassName('btn mod-download-button btn-download')[0];
- let modVersion;
- for (const dd of document.querySelectorAll('dt')) {
- if (dd.innerHTML == "Latest Version:") {
- modVersion = dd.nextElementSibling.innerHTML.trim().split(" ")[0];
- button.childNodes[1].classList.remove("disabled");
- button.childNodes[1].setAttribute('href', `https://mods-storage.re146.dev/${modName}/${modVersion}.zip?anticache=${Math.random}`);
- button.childNodes[1].setAttribute('title', `You don't need to own Factorio to download mods. ;3`);
- }
- }
- })();