// ==UserScript== // @name Steam Community Profile SteamID Viewer // @namespace www.doctormckay.com // @description Shows a user's SteamIDs on their profile // @include *://steamcommunity.com/id/* // @include *://steamcommunity.com/id/*/ // @include *://steamcommunity.com/profiles/* // @include *://steamcommunity.com/profiles/*/ // @version 1.0.3 // @require https://raw.githubusercontent.com/DoctorMcKay/steam-profile-steamid-viewer/master/modules.min.js // @grant GM_setClipboard // @grant GM.setClipboard // @run-at document-start // ==/UserScript== document.addEventListener('DOMContentLoaded', function() { if(typeof unsafeWindow.g_rgProfileData === 'undefined' || !unsafeWindow.g_rgProfileData.steamid) { return; // guess this isn't a profile } var dropdown = document.querySelector('#profile_action_dropdown .popup_body.popup_menu'); if(dropdown) { // We have a dropdown dropdown.innerHTML += ' View SteamID'; } else { var actions = document.querySelector('.profile_header_actions'); if(actions) { actions.innerHTML += '' + ' '; } } var idDialog; unsafeWindow.OpenSteamIdDialog = exportFunction(function() { unsafeWindow.HideMenu('profile_action_dropdown_link', 'profile_action_dropdown'); var sid = new Modules.SteamID(unsafeWindow.g_rgProfileData.steamid); var html = '
Click to copy
'; html += '

' + sid.getSteam2RenderedID() + '

'; html += '

' + sid.getSteam3RenderedID() + '

'; html += '

' + sid.getSteamID64() + '

'; html += '

https://steamcommunity.com/profiles/' + sid.getSteamID64() + '

'; idDialog = unsafeWindow.ShowAlertDialog(unsafeWindow.g_rgProfileData.personaname + "'s SteamID", html, "Close"); }, unsafeWindow); unsafeWindow.CopyToClipboard = exportFunction(function(text) { GM.setClipboard(text); unsafeWindow.ShowAlertDialog("Text Copied", '"' + text + '" has been copied to your clipboard.', "OK"); idDialog.Dismiss(); }, unsafeWindow); });