CSGO Links Helper

Add links on steam and faceit

  1. // ==UserScript==
  2. // @name CSGO Links Helper
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Add links on steam and faceit
  6. // @require https://cdn.bootcss.com/bignumber.js/8.1.1/bignumber.min.js
  7. // @author maxinimize
  8. // @match https://www.faceit.com/*/players/*
  9. // @match https://steamcommunity.com/id/*
  10. // @match https://steamcommunity.com/profiles/*
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. const SteamToESEA = (steamID) => {
  18. const steamID3 = BigNumber(steamID).minus('76561197960265728');
  19. const z = steamID3.dividedToIntegerBy(2);
  20. const y = BigNumber(steamID).modulo(2);
  21. const eseaResult = `https://play.esea.net/index.php?s=search&query=1%3A${y.toString()}%3A${z.toString()}`;
  22. return eseaResult;
  23. }
  24.  
  25. const currentUrl = window.location.href;
  26. if (currentUrl.includes('faceit')) {
  27. window.setTimeout(function() {
  28. const faceitlogin = $('#main-container-height-wrapper > div > div > section.page-title.page-title--with-bg.page-title--with-inset > div.page-title__content > div.page-title__content__title.page-title__content--flexible.page-title__content--dark-bg > h1').text();
  29. const [url1, url2, url3] = [
  30. 'https://faceitstats.com/player,'+faceitlogin,
  31. 'https://www.faceit-stats.me/?user='+faceitlogin,
  32. 'https://faceitelo.net/player/'+faceitlogin
  33. ];
  34. const [faceit1, faceit2, faceit3] = [
  35. $(`<li class="subpage-nav__list__item"> <a class="subpage-nav__list__link" href="${url1}" target="_blank">facitstats</a></li>`),
  36. $(`<li class="subpage-nav__list__item"> <a class="subpage-nav__list__link" href="${url2}" target="_blank">facit-stats</a></li>`),
  37. $(`<li class="subpage-nav__list__item"> <a class="subpage-nav__list__link" href="${url3}" target="_blank">facitelo</a></li>`)
  38. ]
  39. for (let faceit of [faceit1, faceit2, faceit3]) {
  40. $('#main-container-height-wrapper > div > div > nav > ul').append(faceit);
  41. }
  42. }, 2000);
  43. }
  44.  
  45. if(currentUrl.includes("steam")) {
  46. const urlFaceit = `https://www.faceit.com/en/search/overview/${window.g_rgProfileData.steamid}`;
  47. const urlESEA = SteamToESEA(window.g_rgProfileData.steamid);
  48. const faceit = $J(`<div class="profile_count_link"><a id="faceit" href="${urlFaceit}" target="_blank"><span class="count_link_label">FACEIT</span></a></div>`);
  49. const esea = $J(`<div class="profile_count_link"><a id="esea" href="${urlESEA}" target="_blank"><span class="count_link_label">ESEA</span></a></div>`);
  50. // es_profile_link css
  51. faceit.css({
  52. 'display': 'inline-block',
  53. 'margin-top': '10px'
  54. })
  55. // add missing div for private profile
  56. const privateBan = $J('body > div.responsive_page_frame.with_header > div.responsive_page_content > div.responsive_page_template_content > div.no_header.profile_page.private_profile > div.profile_content > div > div.profile_rightcol');
  57. const privateNoBan = $J('body > div.responsive_page_frame.with_header > div.responsive_page_content > div.responsive_page_template_content > div.no_header.profile_page.private_profile > div.profile_content');
  58. if(privateBan) {
  59. privateBan.append($J(`<div class="profile_item_links"></div>`));
  60. }
  61. if(!privateBan && privateNoBan) {
  62. privateNoBan.append($J(`<div><div class="profile_rightcol"><div class="profile_item_links"></div></div></div`))
  63. }
  64. $J('div.profile_item_links').append(faceit);
  65. $J('div.profile_item_links').append(esea);
  66. }
  67. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址