修复页面手势滚动

屏蔽input、textarea占用页面滚动快捷键(Ctrl+Home,Ctrl+End, PageUp,PageDown)

// ==UserScript==
// @name        修复页面手势滚动
// @namespace   https://github.com/qinxs
// @description 屏蔽input、textarea占用页面滚动快捷键(Ctrl+Home,Ctrl+End, PageUp,PageDown)
// @author      qinxs
// @version     1.0
// @include   http:*
// @include   https:*
// @grant       none
// ==/UserScript==
(function(){
  
  'use strict';
  document.addEventListener("keydown", function(e) {
    var keyCode = e.keyCode || e.which;
    var ctrlKey = e.ctrlKey || e.metaKey;
    
    if((ctrlKey && [35,36].includes(keyCode)) || [33,34].includes(keyCode)) {
      document.activeElement.blur();
      document.body.click();
    }

    return false;
  })
  
})();