Unpress Shortcut Buttons

read the home page lol

安裝腳本?
作者推薦腳本

您可能也會喜歡 Smoothscroll

安裝腳本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name Unpress Shortcut Buttons
// @version 0
// @description read the home page lol
// @author coauthored
// @namespace      coauthored
// @match https://www.youtube.com/*
// @match https://www.bilibili.com/*
// @exclude-match https://*.youtube.com/live_chat?*
// @exclude-match        https://*.youtube.com/live_chat_replay?*
// @license Unlicense
// @run-at document-start
// @grant none
// ==/UserScript==

// The exclude-match rule is just for showcasing some unresonable, yet hardly managable coverage of the script's intention, violating some ppl's habits...
// UNCONFIRMED: Conflicts among the functions XP

// author: noahyann
// 禁用空格键、UP键、DN键影响滚动条 DisableSpaceBarScroll
(function(){
 document.onkeydown = function() {
  if((event.keyCode==32)||(event.keyCode==38)||(event.keyCode==40))
  {/* 空格 || UP || DN  */
   //alert(document.activeElement.tagName);
   if(document.activeElement.tagName=='BODY'){
       event.keyCode=0;
       event.returnValue=false;
   }
  }
 };
})();

// namespace      GrayFace
//Allows you to open links in new tabs by middle or control clicking on buggy sites like Instagram
function handler(e){
	if(e.button == 1 || (e.button == 0 && e.ctrlKey)){
		e.stopPropagation();
	}
}

addEventListener('click', handler, true);
addEventListener('mousedown', handler, true);
addEventListener('mouseup', handler, true);

// author unknown
function keyboard_event_handler(e) {
    // Don't prevent entering numbers in input areas, removing of the /* and */ to release more targets(?)
    if (e.target.tagName == 'INPUT' /*||
	e.target.tagName == 'SELECT' ||
	e.target.tagName == 'TEXTAREA' ||
	e.target.isContentEditable*/
       ) {
	return;
    }
    // Trap the mute of a HP latop of mine from sending it to YT :P
    // The original trapping (hrashly truncated by me) from here is simialr to Disable YouTube number shortcuts (greasyfork.org/scripts/424823-disable-youtube-number-shortcuts/feedback)
if (e.key == 'AudioVolumeMute') {
	e.stopImmediatePropagation();
    }
}
window.addEventListener('keydown', keyboard_event_handler, true);