2

In an ongoing project (Windows, .NET C#) we encountered a bottleneck in our development: we have to observe the change of the current tab in all major browsers (IE,FF, Chrome, Opera, Safari).

As soon as tab change event has been captured, it must be written to a file.

Is this feasible?

Savvas Sopiadis
  • 8,213
  • 10
  • 34
  • 53

3 Answers3

2

What i finally did was the following:

tracked the EVENT_OBJECT_NAMECHANGE for the Window title

as soon as the title gets changed i know there was something "new" loaded, so i checked for the URL of the browser using various techniques (nDDE for Firefox and Opera, checking for a specific Window Class for Chrome, etc...! Thorsten is right by saying that it's impossible, so i implemented only for the major browsers)

Savvas Sopiadis
  • 8,213
  • 10
  • 34
  • 53
  • EVENT_OBJECT_NAMECHANGE events occur a lot, it is triggered even when you move the mouse on the same tab of the same window ! how did you avoid that ? or you just ignore the same callbacks ? – JohnTube Feb 25 '14 at 14:36
0

I don't know how this should be done... One thing you could try is to find the window handle of the browser's tab control and hook into it, but that's quite a nasty task. And there's no guarantee that they don't use a custom tab control, so I'd say this can't be done.

Can you give some more information on why you need this? Maybe there's some other solution you didn't think of?

Thorsten Dittmar
  • 55,956
  • 8
  • 91
  • 139
  • This is an application which measures personnel performance: whenever someone visits a web page her superior should know about it. I already managed to hook to the FOREGROUND event for the active window (be it IE or FF or ...) but when switching from tab to tab (changing focused tab) of course this event does not get fired! It's not clear to me to which event i have to hook to (if this is possible). – Savvas Sopiadis Jan 21 '13 at 11:25
0

You can combine these two to get what you want:

Is there a way to detect if a browser window is not currently active?

And:

Javascript; communication between tabs/windows with same origin

Community
  • 1
  • 1
mattmanser
  • 5,719
  • 3
  • 38
  • 50
  • Actually I don't think that he has access to the web sites being browsed. From the comment to my answer I guess that they just want to monitor web access. – Thorsten Dittmar Jan 21 '13 at 12:14