Clone
2
Module: iFrame Event Key Logger
Jess Williams edited this page 2020-01-13 17:47:06 +10:00

Summary

  • Objective: Log keys through a 100% iframe overlay

  • Authors: antisnatchor

  • Browsers: all except Opera

  • Code

Internal Working

Adds a 100% size invisible iframe and an event listener that fires on keypress.


    // add the pressed key to the keystroke stream array
    function keyPressHandler(evt) {
        evt = evt || window.event;
        if (evt) {
            var keyCode = evt.charCode || evt.keyCode;
            charLogged = String.fromCharCode(keyCode);
            stream.push(charLogged);
        }
    }


Feedback