Created
January 10, 2020 16:25
-
-
Save VictorXLR/17e3db402792e8dc19c4491dc3b321bd to your computer and use it in GitHub Desktop.
Simple Keylogger.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get the HTML tag of the page | |
var obj = document.documentElement | |
// event listener for keypress | |
obj.addEventListener('keypress', pushedKey) | |
// function to be called on keypress | |
function pushedKey(e) { | |
var key = e.code | |
key = key.slice(-1) | |
obj.textContent += " "+key; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment