Last active
September 4, 2015 09:34
-
-
Save jeffutter/511a372470471fd72d1e to your computer and use it in GitHub Desktop.
Simulate Magnetic Credit Card Swipe (only works in Firefox)
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
"%B4000000000000002^CardUser/John^030510100000019301000000877000000?;4000000000000002=0305101193010877?".split('').forEach(function(k){ | |
var e = new KeyboardEvent("keydown", {key: k, char: k, charCode: k.charCodeAt(0), keyCode: k.charCodeAt(0), which: k.charCodeAt(0)}); | |
window.dispatchEvent(e); | |
}); | |
var ev = document.createEvent('KeyboardEvent');; ev.initKeyEvent( | |
'keydown', true, true, window, false, false, false, false, 13, 0); | |
document.body.dispatchEvent(ev); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment