I am trying to write an extension for Google Chrome. I want to capture any keyboard input on a given page, and do something magic to it. I am able to do most of what I need with these lines:
document.addEventListener("keydown", function(event) { OnKeyDown(event); }, false);
document.addEventListener("keyup", function(event) { OnKeyDown(event); }, false);
document.addEventListener("keypress", function(event) { OnKeyPress(event); }, false);`
This works in most places, except for Google Mail. I am not getting these events when typing into the body of an email, because as it turns out, it s actually a <body>
element, inside an <iframe>
.