您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Pretend to be GM
// ==UserScript== // @name GMify // @version 20231020-3 // @description Pretend to be GM // @author soup_steward // @match https://www.chess.com/* // @match https://chess.com/* // @require http://code.jquery.com/jquery-latest.js // @grant none // @license MIT // @inject-into content // @namespace https://greatest.deepsurf.us/users/964951 // ==/UserScript== function waitForElm(selector) { return new Promise(resolve => { if (document.querySelector(selector)) { return resolve(document.querySelector(selector)); } const observer = new MutationObserver(mutations => { if (document.querySelector(selector)) { resolve(document.querySelector(selector)); observer.disconnect(); } }); observer.observe(document.body, { childList: true, subtree: true }); }); } function setGmStatus(){ $('#board-layout-player-bottom > div > div.player-tagline > div.player-game-over-component > div > span.rating-score-rating').html( parseInt($('#board-layout-player-bottom > div > div.player-tagline > div.player-game-over-component > div > span.rating-score-rating').html()) +2000 ); $('.user-tagline-rating').html( parseInt($('.user-tagline-rating').html().replace("(","").replace(")","")) +2000 ); $('#board-layout-player-bottom > div > div.player-tagline > div.user-tagline-component').prepend('<a href="/members/titled-players" target="_blank" class="user-chess-title-component" data-tooltip-target="10">GM</a>'); }; waitForElm('.rating-score-rating').then((elm) => { setGmStatus(); setElo(); }); waitForElm('#board-layout-player-bottom > div > div.player-tagline > div > span').then((elm) => { setGmStatus(); setElo(); }); $('#board-layout-player-bottom > div > div.player-tagline > div.player-game-over-component > div > span.rating-score-rating').bind('DOMSubtreeModified', function(e) { setGmStatus(); //setElo(); });