ProtonDB Status Badge

Add a badge of ProtonDB Status to Steam store page with shields.io.

  1. // ==UserScript==
  2. // @name ProtonDB Status Badge
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Add a badge of ProtonDB Status to Steam store page with shields.io.
  6. // @author eggplants
  7. // @homepage https://github.com/eggplants
  8. // @match *://store.steampowered.com/app/*
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. /*jshint esversion: 6 */
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. var D = document;
  19.  
  20. const appid = D.querySelector("meta[property='og:url']").content.split('/')[4];
  21. const badgeHref = 'https://www.protondb.com/app/' + appid;
  22. const badgeSrc = `https://img.shields.io/badge/dynamic/json.svg
  23. ?uri=https://www.protondb.com/api/v1/reports/summaries/${appid}.json
  24. &query=$.trendingTier
  25. &label=ProtonDB
  26. &colorB=e3e3e3
  27. &style=plastic`.replace(/\s+/g, "");
  28.  
  29. var protonElm = D.createElement('div');
  30. protonElm.innerHTML = `
  31. <div class="dev_row">
  32. <div class="subtitle column">ProtonDB:</div>
  33. <div class="summary column">
  34. <a href="${badgeHref}" target="_blank">
  35. <img src="${badgeSrc}" />
  36. </a>
  37. </div>
  38. </div>`.trim();
  39.  
  40. D.querySelector('div.user_reviews').appendChild(protonElm.firstChild);
  41.  
  42. })();

QingJ © 2025

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