您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Display Twitter avatar on AtCoder user page
// ==UserScript== // @name AtCoder Twitter Avatar // @namespace https://ciffelia.com/ // @version 2.0.0 // @description Display Twitter avatar on AtCoder user page // @author Ciffelia <[email protected]> (https://ciffelia.com/) // @license MIT // @homepage https://github.com/ciffelia/atcoder-twitter-avatar#readme // @supportURL https://github.com/ciffelia/atcoder-twitter-avatar/issues // @match https://atcoder.jp/users/* // @run-at document-end // ==/UserScript== (function () { 'use strict'; const twLinkElm = document.querySelector('a[href*="//twitter.com/"]'); if (twLinkElm !== null) { const screenName = twLinkElm.innerText; const avatarUrl = `https://avatars.io/twitter/${screenName}/small`; const avatarElm = document.createElement('img'); avatarElm.src = avatarUrl; avatarElm.referrerPolicy = 'no-referrer'; Object.assign(avatarElm.style, { width: '20px', height: '20px', marginRight: '5px', borderRadius: '50%' }); twLinkElm.insertAdjacentElement('afterbegin', avatarElm); } }());