Steam显示英文游戏名

在商店页显示双语游戏名称,点击名称可以复制。

目前为 2021-09-08 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Show_English_Name
  3. // @name:zh-CN Steam显示英文游戏名
  4. // @namespace https://blog.chrxw.com
  5. // @version 1.0
  6. // @description 在商店页显示双语游戏名称,点击名称可以复制。
  7. // @description:zh-CN 在商店页显示双语游戏名称,点击名称可以复制。
  8. // @author Chr_
  9. // @include /https://store\.steampowered\.com\/app\/\d+/
  10. // @require https://gf.qytechs.cn/scripts/431423-async-requests/code/Async_Requests.js
  11. // @connect store.steampowered.com
  12. // @license AGPL-3.0
  13. // @icon https://blog.chrxw.com/favicon.ico
  14. // @grant GM_setClipboard
  15. // @grant GM_xmlhttpRequest
  16. // ==/UserScript==
  17.  
  18.  
  19. (() => {
  20. 'use strict';
  21.  
  22. let appid = (window.location.pathname.match(/\/app\/(\d+)/) ?? [null, null])[1];
  23.  
  24. if (appid === null) { return; }
  25.  
  26. $http.getText(`https://store.steampowered.com/app/${appid}/?l=english`).then(html => {
  27. let en_title = (html.match(/<title>([\s\S]+)<\/title>/) ?? [, ''])[1];
  28.  
  29. en_title = en_title.replace(/ on Steam$/, '');
  30.  
  31. let t = setInterval(() => {
  32. let ele = document.getElementById('appHubAppName');
  33. if (ele != null) {
  34. clearInterval(t);
  35. let raw_title = ele.textContent
  36. if (raw_title.toLowerCase() != en_title.toLowerCase()) {
  37. ele.textContent = `${raw_title} (${en_title})`;
  38. ele.title = '点击复制';
  39. }
  40. ele.addEventListener('click', () => {
  41. GM_setClipboard(data, { type: 'text', mimetype: 'text/plain' });
  42. });
  43. }
  44. }, 500);
  45. });
  46. })();
  47.  

QingJ © 2025

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