您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Display username + rating + country flag in game ( if user registered his country in 'bio')
// ==UserScript== // @name Lichess Display Country Flag // @namespace http://example.com // @description Display username + rating + country flag in game ( if user registered his country in 'bio') // @include https://lichess.org/* // @version 2 // @grant none // @run-at document-idle // ==/UserScript== setTimeout(function(){ var $ = window.jQuery; var utop = window.document.getElementsByClassName('ruser-top')[0].innerText.split('\n')[0] if(utop.indexOf(' ') > -1){utop = utop.substring(3);} var url = 'https://lichess.org/api/user/'+utop; var xhr = new XMLHttpRequest(); xhr.open("GET", url); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { var newsArr = JSON.parse(xhr.responseText); console.log(newsArr.profile.country); if(xhr.responseText.indexOf('country') > -1){ var urlflag = 'https://lichess1.org/assets/_1FzRvx/images/flags/'+newsArr.profile.country+'.png' var im = new Image (20,20); im.src = urlflag; document.getElementsByTagName('rating')[0].after(im); im.style.marginLeft = '10px';} }}; xhr.send(); var ubottom = window.document.getElementsByClassName('ruser-bottom')[0].innerText.split('\n')[0] if(ubottom.indexOf(' ') > -1){ubottom = ubottom.substring(3);} var url = 'https://lichess.org/api/user/'+ubottom; var xhr2 = new XMLHttpRequest(); xhr2.open("GET", url); xhr2.onreadystatechange = function () { if (xhr2.readyState === 4) { var newsArr2 = JSON.parse(xhr2.responseText); if(xhr2.responseText.indexOf('country') > -1){ var urlflag = 'https://lichess1.org/assets/_1FzRvx/images/flags/'+newsArr2.profile.country+'.png' var im = new Image (20,20); im.src = urlflag; document.getElementsByTagName('rating')[1].after(im); im.style.marginLeft = '10px'; } }}; xhr2.send() }, 100);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址