2

I am developing a web application. I want to catch the keypress event with javascript / jquery while the user is browsing on another tab, i.e. while the tab in which my web application is running is inactive.

Is it possible to do that, with javascript or another technology?

Ozgur Akcali
  • 5,264
  • 2
  • 31
  • 49
  • 6
    ...and catch the bank password? – Roko C. Buljan Sep 13 '12 at 15:40
  • 1
    i was thinking facebook but that would do some good as well :D you're right I guess, thanks – Ozgur Akcali Sep 13 '12 at 15:43
  • @roko I was actually thinking arrow keys or meta keys over a keyboard, as you can control itunes with skip keys etc. That may no be a security issue, even that is impossible? – Ozgur Akcali Sep 13 '12 at 15:47
  • in that case you cannot rely on browsers (that will NOT allow you to do so) but in the case you're talking about a *same origin* web, you can do it storing your informations in a session or cookie... - or communicate with your server (AJAX, JSON) and refresh your data cross-page. – Roko C. Buljan Sep 13 '12 at 15:52

2 Answers2

2

Sorry. The simple answer is NO

The farthest you can go with javascript is to detect whether/when a window/tab becomes inactive. Read here.


But you sure can do it if you write your own browser plugins. But then again, I shudder to think how far that will get you.

Community
  • 1
  • 1
Robin Maben
  • 22,194
  • 16
  • 64
  • 99
0

I do not believe you can get to that level with JavaScript or jQuery. You need something that can get to a higher level.

Off-hand, you might want to look into a Java Applet.

Austin DeVinney
  • 273
  • 3
  • 12