Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to counts the browser tabs having a particular site open ?

272 views
Skip to first unread message

Pinakee

unread,
Sep 10, 2009, 4:09:02 AM9/10/09
to
How can I count the tabs of a browser having a particular site open ?

Ex. : If I have 10 tabs open of IE and 5 of them are having
"www.microsoft.com" open in them, my code should be able to show the count as
5.


Alexey Smirnov

unread,
Sep 10, 2009, 4:52:06 AM9/10/09
to
On Sep 10, 10:09 am, Pinakee <Pina...@discussions.microsoft.com>
wrote:

If this is regarding how to detect and prevent multiple windows on
YOUR website, then please take a look at
http://www.codeproject.com/KB/aspnet/MultipleTabWindows.aspx

Hope this helps

Pinakee

unread,
Sep 10, 2009, 5:57:01 AM9/10/09
to
No.
Actually we want to logout a user on closing of the browser. So, if at least
one of the tabs is having the site open, we'll not be signing out the user.

Andrew Morton

unread,
Sep 10, 2009, 6:34:03 AM9/10/09
to
Pinakee wrote:
> Actually we want to logout a user on closing of the browser. So, if
> at least one of the tabs is having the site open, we'll not be
> signing out the user.

What happens if the user loses network connectivity? How will you log them
out in that circumstance?

Andrew


Pinakee

unread,
Sep 10, 2009, 7:34:01 AM9/10/09
to
There is a session checks for the user's existense. In case, one doesn't come
back within 30 min. we log of the user.

Alexey Smirnov

unread,
Sep 10, 2009, 9:38:52 AM9/10/09
to
On Sep 10, 11:57 am, Pinakee <Pina...@discussions.microsoft.com>
wrote:

> No.
> Actually we want to logout a user on closing of the browser. So, if at least
> one of the tabs is having the site open, we'll not be signing out the user.
>
>

First of all, you can't check in js if user has opened the same site
twice. And this makes no sense. Imagine, you have opened it twice and
wanted to close one of the window. Following your idea, you will be
automatically disconnected from the other window. ?

Alexey Smirnov

unread,
Sep 10, 2009, 9:43:11 AM9/10/09
to
> > Andrew- Hide quoted text -
>
> - Show quoted text -

I think it makes sense to prevent multiple windows in this case

Pinakee

unread,
Sep 11, 2009, 1:32:01 AM9/11/09
to
The basic aim is to check the browser tabs having a site open. If that can be
captured then a part of the problem will be solved.
Is that possible ?

Alexey Smirnov

unread,
Sep 11, 2009, 7:59:02 AM9/11/09
to
> > automatically disconnected from the other window. ?- Hide quoted text -

>
> - Show quoted text -

Theoretically, you can add a javascript to count a timeout on the
page. After 25-30 min it will show a popup: "Your session is about to
expire. Would you like to remain logged in?" If user clicked something
then he is still browsing the page, if not - you can "delete" the
session. If user opened two windows he will get this message twice. If
you don't like to show it twice, you can add an ajax call to get the
timeout value out of the server. You can save all active sessions in
the database and a time when each session was validate last time. It
means that once user clicked to continue the session you will save it
in the database and check it from another window using ajax.

Jesse Houwing

unread,
Sep 14, 2009, 8:34:57 AM9/14/09
to
> "Alexey Smirnov" wrote:
>
>> On Sep 10, 11:57 am, Pinakee<Pina...@discussions.microsoft.com>
>> wrote:
>>> No.
>>> Actually we want to logout a user on closing of the browser. So, if at least
>>> one of the tabs is having the site open, we'll not be signing out the user.
>>>
>>>
>>
>> First of all, you can't check in js if user has opened the same site
>> twice. And this makes no sense. Imagine, you have opened it twice and
>> wanted to close one of the window. Following your idea, you will be
>> automatically disconnected from the other window. ?
>>
* Pinakee wrote, On 11-9-2009 7:32:
> The basic aim is to check the browser tabs having a site open. If
that can be
> captured then a part of the problem will be solved.
> Is that possible ?
>

No that is not possible. It would open IE up to a load of privacy issues
if it were. Especially now that every tab runs in it's own process,
things like this will become increasingly more difficult.

--
Jesse Houwing
jesse.houwing at sogeti.nl

0 new messages