// ==UserScript== // @name 米哈游数据 获取及推送 // @namespace remio/script-mihoyo-bbs // @version 0.0.1 // @author kasuie // @description 暂且只支持了原神角色和武器 // @license MIT // @icon https://www.google.com/s2/favicons?sz=64&domain=bbs.mihoyo.com // @match https://bbs.mihoyo.com/* // @require https://code.jquery.com/jquery-3.7.1.min.js // @grant GM.addStyle // @grant GM.deleteValue // @grant GM.getValue // @grant GM.listValues // @grant GM.setValue // @grant GM.xmlHttpRequest // @downloadURL https://update.greasyfork.icu/scripts/529497/%E7%B1%B3%E5%93%88%E6%B8%B8%E6%95%B0%E6%8D%AE%20%E8%8E%B7%E5%8F%96%E5%8F%8A%E6%8E%A8%E9%80%81.user.js // @updateURL https://update.greasyfork.icu/scripts/529497/%E7%B1%B3%E5%93%88%E6%B8%B8%E6%95%B0%E6%8D%AE%20%E8%8E%B7%E5%8F%96%E5%8F%8A%E6%8E%A8%E9%80%81.meta.js // ==/UserScript== (function ($) { 'use strict'; var _GM = /* @__PURE__ */ (() => typeof GM != "undefined" ? GM : void 0)(); const storage = { set(key, val) { return _GM.setValue(key, val); }, get(key, defaultValue) { return _GM.getValue(key, defaultValue); }, all() { return _GM.listValues(); }, del(key) { return _GM.deleteValue(key); }, async clear() { let keys = this.all(); for (let key of await keys) { _GM.deleteValue(key); } } }; const request = (data) => { return new Promise((resolve, reject) => { if (!data.method) { data.method = "get"; } if (!data.timeout) { data.timeout = 6e4; } data.onload = function(res) { try { resolve(JSON.parse(res.responseText)); } catch (error) { reject(error); } }; data.onerror = function(e) { reject(e); }; data.ontimeout = function() { reject("timeout"); }; _GM.xmlHttpRequest(data); }); }; let params = null; const BaseUrl = "https://example.com"; const onAppend = (ele, data) => $(ele).append(data); const init = () => { const $button = $(" `); $(".close-btn").on("click", onCloseModal); $(".submit-btn").on("click", onSubmit); init(); })($);