Open link in steam client

Opens steamcommunity and steam store page in steam client when you right click while holding ctrl

  1. // ==UserScript==
  2. // @name Open link in steam client
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description Opens steamcommunity and steam store page in steam client when you right click while holding ctrl
  6. // @author Bum
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  8. // @match https://steamcommunity.com/*
  9. // @match https://store.steampowered.com/*
  10. // @grant GM_addStyle
  11. // ==/UserScript==
  12.  
  13. $(document).keydown(function(event){
  14. if(event.which=="17")
  15. cntrlIsPressed = true;
  16. });
  17.  
  18. $(document).keyup(function(){
  19. cntrlIsPressed = false;
  20. });
  21.  
  22. var cntrlIsPressed = false;
  23.  
  24.  
  25. (function() {
  26. 'use strict';
  27.  
  28. if (document.addEventListener) {
  29. document.addEventListener('contextmenu', function(e) {if(cntrlIsPressed)
  30. {
  31. window.location.replace("steam://openurl/" + window.location.href);
  32. cntrlIsPressed = false;
  33. e.preventDefault();}
  34. }, false);
  35. } else {
  36. document.attachEvent('oncontextmenu', function() {
  37. if(cntrlIsPressed){
  38. window.location.replace("steam://openurl/" + window.location.href);
  39. cntrlIsPressed = false;
  40. window.event.returnValue = false;
  41. }
  42. });
  43. }
  44. })();

QingJ © 2025

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