views:

41

answers:

1

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>.

A: 

If you want to create trojan, you would better use C++, otherwise, reconcider your project/task. If project needs intercepting of all user input events in browser using JavaScript, then something is completely wrong with this project.

Thanks for the trust, but actually I am trying to create something a-la ToCyrillic for Firefox, and I'm confined to Javascript because that's all Google Chrome allows for extensions.
Eugene Efremov