Skip to content

Instantly share code, notes, and snippets.

@VictorXLR
Created January 10, 2020 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VictorXLR/17e3db402792e8dc19c4491dc3b321bd to your computer and use it in GitHub Desktop.
Save VictorXLR/17e3db402792e8dc19c4491dc3b321bd to your computer and use it in GitHub Desktop.
Simple Keylogger.js
// 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