您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds option to add emojis automatically
当前为
// ==UserScript== // @name IB Lineage Emoji Generator // @namespace http://tampermonkey.net/ // @version 1.1 // @license MIT // @description Adds option to add emojis automatically // @icon https://i.imgur.com/WlkWOkU.png // @author @activetutorial on discord // @match https://infinibrowser.wiki/tools/lineage-maker // @run-at document-end // @grant none // ==/UserScript== (function() { 'use strict'; (window.AT ||= {}).lineageemojis = { mappings: null, buttons: { setEmojisButton: { id: "set-emojis", className: "btn", textContent: "Set Emojis" }, resetEmojisButton: { id: "reset-emojis", className: "btn", textContent: "Reset Emojis" } }, createButtons: function() { this.setEmojisButton = document.createElement("button"); Object.assign(this.setEmojisButton, this.buttons.setEmojisButton); this.resetEmojisButton = document.createElement("button"); Object.assign(this.resetEmojisButton, this.buttons.resetEmojisButton); const btnElement = document.querySelectorAll(".btn")[1]; btnElement.parentElement.appendChild(this.setEmojisButton); btnElement.parentElement.appendChild(document.createTextNode(" ")); btnElement.parentElement.appendChild(this.resetEmojisButton); }, setEmojis: async function() { [...document.querySelector(".recipes").children].forEach(i => { [...i.children].slice(0, -1).forEach(async j => { if (j.firstChild.innerHTML == "⬜") { const response = await fetch("https://infinibrowser.wiki/api/item?id=" + encodeURIComponent(j.childNodes[1].textContent)); const data = await response.json(); this.mappings.set(data.text, data.emoji); j.firstChild.innerHTML = (data.emoji || "⬜"); } }); }); }, resetEmojis: function() { [...document.querySelector(".recipes").children].forEach(i => { [...i.children].slice(0, -1).forEach(j => { this.mappings.set(j.childNodes[1].textContent, "⬜"); j.firstChild.innerHTML = "⬜"; }); }); }, start: function () { if (document.querySelector('.btn')) { this.createButtons(); this.setEmojisButton.addEventListener("click", this.setEmojis.bind(this)); this.resetEmojisButton.addEventListener("click", this.resetEmojis.bind(this)); const originalGet = Map.prototype.get; Map.prototype.get = function(key) { window.AT.lineageemojis.mappings = this; return originalGet.call(this, key); }; } else { setTimeout(this.start.bind(this), 200); } } }; window.AT.lineageemojis.start(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址