GMail Steam URL highlighter

Replace Steam URI's in GMail with actual links

  1. // ==UserScript==
  2. // @name GMail Steam URL highlighter
  3. // @namespace http://tampermonkey.net/
  4. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.slim.min.js
  5. // @require https://gf.qytechs.cn/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=115012
  6. // @version 1.0.1
  7. // @description Replace Steam URI's in GMail with actual links
  8. // @author deiga
  9. // @match https://mail.google.com/*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. const steamUrlReplacer = function () {
  17. const elem = Array.from(document.querySelectorAll('.gs div')).filter(function(item) { return item.textContent.indexOf('steam://') > -1; })[0];
  18. if (elem) {
  19. var elemHtml = elem.innerHTML;
  20. if (elemHtml.indexOf('href="steam://') === -1) {
  21. elem.innerHTML = elemHtml.replace(/steam:\/\/.*$/m,'<a href="$&">$&</a>').replace('<wbr>','');
  22. }
  23. }
  24. };
  25.  
  26. waitForKeyElements (".gs div:contains('steam://')", steamUrlReplacer);
  27. })();

QingJ © 2025

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