Unpress Shortcut Buttons

read the home page lol

安装此脚本?
作者推荐脚本

您可能也喜欢Smoothscroll

安装此脚本
  1. // ==UserScript==
  2. // @name Unpress Shortcut Buttons
  3. // @version 0
  4. // @description read the home page lol
  5. // @author coauthored
  6. // @namespace coauthored
  7. // @match https://www.youtube.com/*
  8. // @match https://www.bilibili.com/*
  9. // @exclude-match https://*.youtube.com/live_chat?*
  10. // @exclude-match https://*.youtube.com/live_chat_replay?*
  11. // @license Unlicense
  12. // @run-at document-start
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16. // The exclude-match rule is just for showcasing some unresonable, yet hardly managable coverage of the script's intention, violating some ppl's habits...
  17. // UNCONFIRMED: Conflicts among the functions XP
  18.  
  19. // author: noahyann
  20. // 禁用空格键、UP键、DN键影响滚动条 DisableSpaceBarScroll
  21. (function(){
  22. document.onkeydown = function() {
  23. if((event.keyCode==32)||(event.keyCode==38)||(event.keyCode==40))
  24. {/* 空格 || UP || DN */
  25. //alert(document.activeElement.tagName);
  26. if(document.activeElement.tagName=='BODY'){
  27. event.keyCode=0;
  28. event.returnValue=false;
  29. }
  30. }
  31. };
  32. })();
  33.  
  34. // namespace GrayFace
  35. //Allows you to open links in new tabs by middle or control clicking on buggy sites like Instagram
  36. function handler(e){
  37. if(e.button == 1 || (e.button == 0 && e.ctrlKey)){
  38. e.stopPropagation();
  39. }
  40. }
  41.  
  42. addEventListener('click', handler, true);
  43. addEventListener('mousedown', handler, true);
  44. addEventListener('mouseup', handler, true);
  45.  
  46. // author unknown
  47. function keyboard_event_handler(e) {
  48. // Don't prevent entering numbers in input areas, removing of the /* and */ to release more targets(?)
  49. if (e.target.tagName == 'INPUT' /*||
  50. e.target.tagName == 'SELECT' ||
  51. e.target.tagName == 'TEXTAREA' ||
  52. e.target.isContentEditable*/
  53. ) {
  54. return;
  55. }
  56. // Trap the mute of a HP latop of mine from sending it to YT :P
  57. // The original trapping (hrashly truncated by me) from here is simialr to Disable YouTube number shortcuts (gf.qytechs.cn/scripts/424823-disable-youtube-number-shortcuts/feedback)
  58. if (e.key == 'AudioVolumeMute') {
  59. e.stopImmediatePropagation();
  60. }
  61. }
  62. window.addEventListener('keydown', keyboard_event_handler, true);
  63.  

QingJ © 2025

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