userscript에서 keydown 이벤트를 캡처하고 웹 사이트 자체에서 이벤트를 숨길 필요가 있습니다. 나는. 웹 사이트는 keypress를 감지 할 수 없어야합니다. 내가 함께 테스트입니다 https://www.robertnitsch.de/test/userscript에서 keydown 이벤트 캡처 및 웹 사이트에서 숨기기
: 내 테스트 웹 사이트에서 확인 할 수
// ==UserScript==
// @name test
// @namespace www.robertnitsch.de
// @description test
// @include https://www.robertnitsch.de/test/
// @version 1
// @grant none
// ==/UserScript==
document.addEventListener("keydown", function(evt) {
console.log("userscript", evt);
evt.stopPropagation();
return false;
}, true);
그러나, 페이지가 여전히를 keyDown 이벤트를 감지 할 수 있습니다 :
는 내가 Greasemonkey와 userscript에 다음 코드를 시도 a, s, d 등 간단한 키
Jquery allowed ?? –
예, jQuery를 사용할 수 있습니다. – robert