-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path禁止Bing按键监听.user.js
More file actions
27 lines (25 loc) · 1.03 KB
/
禁止Bing按键监听.user.js
File metadata and controls
27 lines (25 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// ==UserScript==
// @name 禁止 Bing Keydown 监听
// @namespace https://github.com/luxuxl/
// @version 0.1
// @description Bing 的 Keydown 监听会导致 vimkey 失效, 所以需要禁止
// @author luxuxl
// @match *://bing.com/*
// @match *://cn.bing.com/*
// @match *://www.bing.com/*
// @grant none
// @run-at document-start
// @downloadURL https://github.com/luxuxl/userscripts/raw/refs/heads/main/%E7%A6%81%E6%AD%A2Bing%E6%8C%89%E9%94%AE%E7%9B%91%E5%90%AC.user.js
// ==/UserScript==
(function() {
'use strict';
// 阻止事件监听器安装
const originalAddEventListener = EventTarget.prototype.addEventListener;
EventTarget.prototype.addEventListener = function(type, listener, options) {
if (type === 'keydown' && String(listener).includes('KeyPressScroll')) {
console.log('脚本 "禁用 Bing Keydown 监听" 已执行');
return;
}
return originalAddEventListener.call(this, type, listener, options);
};
})();