Last active
March 8, 2026 00:11
-
-
Save Sellyme/6c27bce46447d95eabcf402cf4e66e5a to your computer and use it in GitHub Desktop.
Userscript to add legendary count to Steam Hunters profile headers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name [SH] Legendary Count | |
| // @description Shows legendary achievement count on user profiles. | |
| // @version 0.3.1 | |
| // @changelog 0.3.1 - enable auto-updating | |
| // @changelog 0.3 - Add link to list of achievements on text label | |
| // @author Sellyme | |
| // @match https://steamhunters.com/id/* | |
| // @match https://steamhunters.com/profiles/* | |
| // @exclude https://steamhunters.com/id/*/apps/* | |
| // @exclude https://steamhunters.com/profiles/*/apps/* | |
| // @downloadURL https://gist.githubusercontent.com/Sellyme/6c27bce46447d95eabcf402cf4e66e5a/raw | |
| // @updateURL https://gist.githubusercontent.com/Sellyme/6c27bce46447d95eabcf402cf4e66e5a/raw | |
| // @grant GM_addStyle | |
| // ==/UserScript== | |
| GM_addStyle('.legendary_liststat { color: unset !important; }'); | |
| GM_addStyle('.legendary_liststat:hover { text-decoration: underline; }'); | |
| (function(){ | |
| (new MutationObserver(check)).observe(document, {childList: true, subtree: true}); | |
| })(); | |
| function check(changes, observer) { | |
| //only run onece profile JSON object is loaded | |
| if (typeof sh !== 'undefined') { | |
| observer.disconnect(); | |
| inject_legendaries(); | |
| } | |
| } | |
| function inject_legendaries() { | |
| var stat_header = document.getElementsByClassName('list-stats')[0]; | |
| var li = document.createElement('li'); | |
| console.log(sh.model.steamUser.steamId); | |
| var html_text = "<div><span>" + sh.model.steamUser.legendaryAchievementUnlockCount.toLocaleString() + | |
| "<i class='icon icon-certificate' style='color:rgb(255,160,64)' aria-hidden='true'></i></span><name><a href=" + | |
| "'https://steamhunters.com/profiles/" + sh.model.steamUser.steamId + "/achievements?rarity=legendary'" + | |
| " class='legendary_liststat'>legendary achievements</a></name></div>"; | |
| li.innerHTML = html_text; | |
| stat_header.appendChild(li); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment